From 77ed84550526c8f42e3d570a2a59f21f4cb386be Mon Sep 17 00:00:00 2001 From: suvaissov Date: Mon, 31 May 2021 13:59:41 +0600 Subject: [PATCH] Bottom Draggable Sheet fix to PageBuilder --- lib/views/home/tabs/KassaTab.dart | 57 ++++++++++++------- .../tabs/kassaView/ProductAddBottomSheet.dart | 2 +- pubspec.yaml | 2 +- 3 files changed, 37 insertions(+), 24 deletions(-) diff --git a/lib/views/home/tabs/KassaTab.dart b/lib/views/home/tabs/KassaTab.dart index d4075ba..f37be9c 100644 --- a/lib/views/home/tabs/KassaTab.dart +++ b/lib/views/home/tabs/KassaTab.dart @@ -248,27 +248,40 @@ class KassaTab extends StatelessWidget { void showModalBottomSheetCatalog(BuildContext context, String action) { - showModalBottomSheet( - context: context, - isScrollControlled: true, - backgroundColor: Colors.transparent, - builder: (context) { - return DraggableScrollableSheet( - initialChildSize: 0.8, - maxChildSize: 0.95, - minChildSize: 0.5, - builder: (BuildContext context, ScrollController scrollController) { - if (action == 'add') { - return ProductAddBottomSheet( - scrollController: scrollController, - ); - } else { - return CatalogBottomSheet( - scrollController: scrollController, - ); - } - }, - ); - }); + + if (action == 'add') { + Navigator.push( + context, + MaterialPageRoute(builder: (context) => ProductAddBottomSheet()) + ); + } else { + Navigator.push( + context, + MaterialPageRoute(builder: (context) => CatalogBottomSheet()) + ); + } + + // showModalBottomSheet( + // context: context, + // isScrollControlled: true, + // backgroundColor: Colors.transparent, + // builder: (context) { + // return DraggableScrollableSheet( + // initialChildSize: 0.8, + // maxChildSize: 0.95, + // minChildSize: 0.5, + // builder: (BuildContext context, ScrollController scrollController) { + // if (action == 'add') { + // return ProductAddBottomSheet( + // scrollController: scrollController, + // ); + // } else { + // return CatalogBottomSheet( + // scrollController: scrollController, + // ); + // } + // }, + // ); + // }); } } diff --git a/lib/views/home/tabs/kassaView/ProductAddBottomSheet.dart b/lib/views/home/tabs/kassaView/ProductAddBottomSheet.dart index 9ff7521..19423c2 100644 --- a/lib/views/home/tabs/kassaView/ProductAddBottomSheet.dart +++ b/lib/views/home/tabs/kassaView/ProductAddBottomSheet.dart @@ -51,7 +51,7 @@ class _ProductAddBottomSheetState extends State { ), ), body: Padding( - padding: const EdgeInsets.only(top: 15, left: 10, right: 15), + padding: EdgeInsets.only(top: 15, left: 10, right: 15, bottom: 0 ), child: ListView( controller: widget.scrollController, children: [ diff --git a/pubspec.yaml b/pubspec.yaml index b9c6fe6..05a344e 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: aman_kassa_flutter description: A new Flutter project. -version: 1.2.2+28 +version: 1.2.3+29 environment: sdk: '>=2.3.0 <3.0.0' dependencies: