Replies: 1 comment
-
If I recall correctly, I encountered some strange behavior when using DraggableScrollableSheet. You can try this example: Choice<String>.prompt(
title: 'Categories',
multiple: true,
value: multipleSelected,
onChanged: setMultipleSelected,
itemCount: choices.length,
itemBuilder: (state, i) {
return CheckboxListTile(
value: state.selected(choices[i]),
onChanged: state.onSelected(choices[i]),
title: ChoiceText(
choices[i],
highlight: state.search?.value,
),
);
},
promptDelegate: (context, modal) {
return showModalBottomSheet(
context: context,
isDismissible: true,
isScrollControlled: true,
useRootNavigator: true,
builder: (_) => modal,
);
},
listBuilder: (itemBuilder, itemCount) {
return DraggableScrollableSheet(
expand: false,
initialChildSize: 0.5,
builder: (_, controller) {
return ListView.builder(
controller: controller,
itemCount: itemCount,
itemBuilder: (context, i) => itemBuilder(i),
);
},
);
},
) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
If you use DraggableScrollableSheet, you can have the bottom sheet move when scrolling down to take up more space on the screen.
An example snippet from my project Tail App
Beta Was this translation helpful? Give feedback.
All reactions