-This plugin will help you to show the bottom sheet to the top of the screen
- isShowCloseButton
- closeButtonRadius
- closeButtonBackgroundColor
- closeButtonIcon
- child
- context
Install the dependencies and devDependencies and start the server.
flutter pub add top_bottom_sheet_flutter
flutter pub get
Or
dependencies:
top_bottom_sheet_flutter: $currentVersion$
void showSheet() {
TopModalSheet.show(
context: context,
isShowCloseButton: true,
closeButtonRadius: 20.0,
closeButtonBackgroundColor: Colors.white,
child: Container(
color: Colors.white,
child: SizedBox(
height: MediaQuery.of(context).size.height / 2,
child: ListView.separated(
itemBuilder: (BuildContext context, int index) {
return ListTile(
title: const Text('Ankit Tiwari'),
subtitle: const Text('tiwariankit496@gmail.com'),
leading: FloatingActionButton(
heroTag: index,
backgroundColor: Colors.white,
onPressed: () {},
child: const FlutterLogo(),
),
);
},
itemCount: 30,
separatorBuilder: (BuildContext context, int index) {
return const Divider();
},
),
),
));
}