From 8b5379cf9486c3f0d9b418627bbfd7cd2cc61a63 Mon Sep 17 00:00:00 2001 From: dali Date: Mon, 30 Aug 2021 20:21:58 +0100 Subject: [PATCH] docs: change example of listGroupedCheckbox --- example/lib/list_of_grouped.dart | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/example/lib/list_of_grouped.dart b/example/lib/list_of_grouped.dart index 86d8e52..9f3b870 100644 --- a/example/lib/list_of_grouped.dart +++ b/example/lib/list_of_grouped.dart @@ -29,20 +29,25 @@ class _ListOfGroupedState extends State { @override Widget build(BuildContext context) { - return SingleChildScrollView( - child: Column( - children: [ - ListGroupedCheckbox( + return Stack( + children: [ + Positioned( + top: 0, + left: 0, + right: 0, + bottom: 64, + child: ListGroupedCheckbox( 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, @@ -52,15 +57,18 @@ class _ListOfGroupedState extends State { print(list); }, ), - ElevatedButton( + ), + Align( + alignment: Alignment.bottomCenter, + child: ElevatedButton( onPressed: () async { final list = await controller.allSelectedItems; print(list); }, child: Text("see data"), ), - ], - ), + ), + ], ); } }