Skip to content

Commit

Permalink
docs: change example of listGroupedCheckbox
Browse files Browse the repository at this point in the history
  • Loading branch information
liodali committed Aug 30, 2021
1 parent 618dd1a commit 8b5379c
Showing 1 changed file with 18 additions and 10 deletions.
28 changes: 18 additions & 10 deletions example/lib/list_of_grouped.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,25 @@ class _ListOfGroupedState extends State<ListOfGrouped> {

@override
Widget build(BuildContext context) {
return SingleChildScrollView(
child: Column(
children: [
ListGroupedCheckbox<String>(
return Stack(
children: [
Positioned(
top: 0,
left: 0,
right: 0,
bottom: 64,
child: ListGroupedCheckbox<String>(
controller: controller,
isScrollable: true,
groupTitles: List.generate(5, (index) => "groupe $index"),
values: List.generate(
5,
(i) =>
List.generate(5, (j) => "${(i + Random().nextInt(100)) * j}"),
(i) => List.generate(
5, (j) => "${(i + Random().nextInt(100)) * j}"),
),
titles: List.generate(
5,
(i) => List.generate(5, (j) => "Title:$i-$j"),
(i) => List.generate(5, (j) => "Title:$i-$j"),
),
mapItemGroupedType: {
1: GroupedType.Chips,
Expand All @@ -52,15 +57,18 @@ class _ListOfGroupedState extends State<ListOfGrouped> {
print(list);
},
),
ElevatedButton(
),
Align(
alignment: Alignment.bottomCenter,
child: ElevatedButton(
onPressed: () async {
final list = await controller.allSelectedItems;
print(list);
},
child: Text("see data"),
),
],
),
),
],
);
}
}

0 comments on commit 8b5379c

Please sign in to comment.