forked from immich-app/immich
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move selection logic to asset grid class
- Loading branch information
Showing
6 changed files
with
354 additions
and
328 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
76 changes: 36 additions & 40 deletions
76
.../home/ui/disable_multi_select_button.dart → ...set_grid/disable_multi_select_button.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,36 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:hooks_riverpod/hooks_riverpod.dart'; | ||
|
||
class DisableMultiSelectButton extends ConsumerWidget { | ||
const DisableMultiSelectButton({ | ||
Key? key, | ||
required this.onPressed, | ||
required this.selectedItemCount, | ||
}) : super(key: key); | ||
|
||
final Function onPressed; | ||
final int selectedItemCount; | ||
|
||
@override | ||
Widget build(BuildContext context, WidgetRef ref) { | ||
return Positioned( | ||
top: 10, | ||
left: 0, | ||
child: Padding( | ||
padding: const EdgeInsets.only(left: 16.0, top: 46), | ||
child: Padding( | ||
padding: const EdgeInsets.symmetric(horizontal: 4.0), | ||
child: ElevatedButton.icon( | ||
onPressed: () { | ||
onPressed(); | ||
}, | ||
icon: const Icon(Icons.close_rounded), | ||
label: Text( | ||
'$selectedItemCount', | ||
style: const TextStyle( | ||
fontWeight: FontWeight.w600, | ||
fontSize: 18, | ||
), | ||
), | ||
), | ||
), | ||
), | ||
); | ||
} | ||
} | ||
import 'package:flutter/material.dart'; | ||
import 'package:hooks_riverpod/hooks_riverpod.dart'; | ||
|
||
class DisableMultiSelectButton extends ConsumerWidget { | ||
const DisableMultiSelectButton({ | ||
Key? key, | ||
required this.onPressed, | ||
required this.selectedItemCount, | ||
}) : super(key: key); | ||
|
||
final Function onPressed; | ||
final int selectedItemCount; | ||
|
||
@override | ||
Widget build(BuildContext context, WidgetRef ref) { | ||
return Padding( | ||
padding: const EdgeInsets.only(left: 16.0, top: 15), | ||
child: Padding( | ||
padding: const EdgeInsets.symmetric(horizontal: 4.0), | ||
child: ElevatedButton.icon( | ||
onPressed: () { | ||
onPressed(); | ||
}, | ||
icon: const Icon(Icons.close_rounded), | ||
label: Text( | ||
'$selectedItemCount', | ||
style: const TextStyle( | ||
fontWeight: FontWeight.w600, | ||
fontSize: 18, | ||
), | ||
), | ||
), | ||
), | ||
); | ||
} | ||
} |
Oops, something went wrong.