From cca5625df7e432da8581a4504306baad154deb48 Mon Sep 17 00:00:00 2001 From: Kingkor Roy Tirtho Date: Sat, 17 Jun 2023 13:17:38 +0600 Subject: [PATCH] fix: pop sheet list not scrollable --- .../adaptive/adaptive_pop_sheet_list.dart | 52 +++++++++---------- 1 file changed, 25 insertions(+), 27 deletions(-) diff --git a/lib/components/shared/adaptive/adaptive_pop_sheet_list.dart b/lib/components/shared/adaptive/adaptive_pop_sheet_list.dart index 9a9e96307..08cc5551f 100644 --- a/lib/components/shared/adaptive/adaptive_pop_sheet_list.dart +++ b/lib/components/shared/adaptive/adaptive_pop_sheet_list.dart @@ -74,40 +74,38 @@ class AdaptivePopSheetList extends StatelessWidget { showModalBottomSheet( context: context, useRootNavigator: useRootNavigator, + isScrollControlled: true, + showDragHandle: true, + constraints: BoxConstraints( + maxHeight: mediaQuery.size.height * 0.6, + ), builder: (context) { return Padding( - padding: const EdgeInsets.all(8.0), + padding: const EdgeInsets.all(8.0).copyWith(top: 0), child: DefaultTextStyle( style: theme.textTheme.titleMedium!, - child: Column( - mainAxisSize: MainAxisSize.min, - children: [ - if (headings != null) ...[ - Container( - width: 180, - height: 6, - decoration: BoxDecoration( + child: SingleChildScrollView( + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + if (headings != null) ...[ + ...headings!, + const SizedBox(height: 8), + Divider( color: theme.colorScheme.primary, - borderRadius: BorderRadius.circular(999), + thickness: 0.3, + endIndent: 16, + indent: 16, + ), + ], + ...children.map( + (item) => _AdaptivePopSheetListItem( + item: item, + onSelected: onSelected, ), - ), - const SizedBox(height: 8), - ...headings!, - const SizedBox(height: 8), - Divider( - color: theme.colorScheme.primary, - thickness: 0.3, - endIndent: 16, - indent: 16, - ), + ) ], - ...children.map( - (item) => _AdaptivePopSheetListItem( - item: item, - onSelected: onSelected, - ), - ) - ], + ), ), ), );