fix: pop sheet list not scrollable

This commit is contained in:
Kingkor Roy Tirtho 2023-06-17 13:17:38 +06:00
parent 0cedc7a418
commit cca5625df7

View File

@ -74,40 +74,38 @@ class AdaptivePopSheetList<T> extends StatelessWidget {
showModalBottomSheet( showModalBottomSheet(
context: context, context: context,
useRootNavigator: useRootNavigator, useRootNavigator: useRootNavigator,
isScrollControlled: true,
showDragHandle: true,
constraints: BoxConstraints(
maxHeight: mediaQuery.size.height * 0.6,
),
builder: (context) { builder: (context) {
return Padding( return Padding(
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0).copyWith(top: 0),
child: DefaultTextStyle( child: DefaultTextStyle(
style: theme.textTheme.titleMedium!, style: theme.textTheme.titleMedium!,
child: Column( child: SingleChildScrollView(
mainAxisSize: MainAxisSize.min, child: Column(
children: [ mainAxisSize: MainAxisSize.min,
if (headings != null) ...[ children: [
Container( if (headings != null) ...[
width: 180, ...headings!,
height: 6, const SizedBox(height: 8),
decoration: BoxDecoration( Divider(
color: theme.colorScheme.primary, color: theme.colorScheme.primary,
borderRadius: BorderRadius.circular(999), thickness: 0.3,
endIndent: 16,
indent: 16,
), ),
), ],
const SizedBox(height: 8), ...children.map(
...headings!, (item) => _AdaptivePopSheetListItem(
const SizedBox(height: 8), item: item,
Divider( onSelected: onSelected,
color: theme.colorScheme.primary, ),
thickness: 0.3, )
endIndent: 16,
indent: 16,
),
], ],
...children.map( ),
(item) => _AdaptivePopSheetListItem(
item: item,
onSelected: onSelected,
),
)
],
), ),
), ),
); );