nice_sheet 0.0.1
nice_sheet: ^0.0.1 copied to clipboard
A customizable Slack-style bottom sheet widget for Flutter applications. Provides easy-to-use action menus with support for common operations like reply, edit, copy, and delete.
import 'package:flutter/material.dart';
import 'package:nice_sheet/nice_sheet.dart'; // Add this import
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
),
home: const MyHomePage(title: 'Flutter Demo Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
const MyHomePage({super.key, required this.title});
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
List<String> items = ['Item 1', 'Item 2', 'Item 3', 'Item 4', 'Item 5'];
return Scaffold(
appBar: AppBar(
backgroundColor: Theme.of(context).colorScheme.inversePrimary,
title: Text(widget.title),
),
body: ListView.builder(
itemCount: items.length,
itemBuilder: (BuildContext context, int index) {
return ListTile(
title: Text(items[index]),
onTap: () {
// Show the checkbox sheet
NiceSheet.showBottomSheet(
context,
items[index],
backgroundColor: Colors.white,
textColor: Theme.of(context).colorScheme.onPrimary,
onTapEdit: () {
Navigator.pop(context);
},
onTapDelete: () {
Navigator.pop(context);
},
);
},
);
},
),
);
}
}