Skip to content

Commit

Permalink
beauty mutliselect
Browse files Browse the repository at this point in the history
  • Loading branch information
gitsimon committed Dec 17, 2021
1 parent 3ac0be1 commit 5a4d396
Showing 1 changed file with 6 additions and 13 deletions.
19 changes: 6 additions & 13 deletions lib/views/crud/model_list.dart
Expand Up @@ -73,8 +73,9 @@ class _ModelObjectListState extends ConsumerState<ModelObjectList> {
modelItems,
modelItemsNotifier,
showDelete: selected.isNotEmpty,
multiSelectMode: multiSelectMode,
onMultiSelect: () => setState(() {
multiSelectMode = true;
multiSelectMode = !multiSelectMode;
}),
),
),
Expand Down Expand Up @@ -116,6 +117,7 @@ class _ModelObjectListState extends ConsumerState<ModelObjectList> {
ModelItems modelItems,
ModelItemsNotifier modelItemsNotifier, {
bool showDelete = false,
bool multiSelectMode = false,
VoidCallback? onMultiSelect,
}) {
return Container(
Expand All @@ -131,19 +133,10 @@ class _ModelObjectListState extends ConsumerState<ModelObjectList> {
child: Row(
children: [
if (onMultiSelect != null)
// OutlinedButton(
// onPressed: onMultiSelect,
// child: const Icon(
// Icons.check_box,
// size: 20,
// ),
// style: ButtonStyle(
// shape: MaterialStateProperty.all(const CircleBorder()),
// ),
// ),
ElevatedButton.icon(
OutlinedButton.icon(
onPressed: onMultiSelect,
icon: const Icon(Icons.check_box),
icon: Icon(
multiSelectMode ? Icons.check_box : Icons.check_box_outlined),
label: const Text('multi edit'),
),
if (showDelete)
Expand Down

0 comments on commit 5a4d396

Please sign in to comment.