π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
[mob][photos] stateful widget controlling flow
laurenspriem0ad3878bbde5
diff --git a/mobile/lib/ui/components/bulk_edit_widget.dart b/mobile/lib/ui/components/bulk_edit_widget.dartindex 175476ba28..9200163ec7 100644--- a/mobile/lib/ui/components/bulk_edit_widget.dart+++ b/mobile/lib/ui/components/bulk_edit_widget.dart@@ -4,7 +4,7 @@ import "package:photos/models/file/file.dart";import "package:photos/theme/ente_theme.dart";import "package:photos/ui/viewer/file/thumbnail_widget.dart";-class BulkEditDateBottomSheet extends StatelessWidget {+class BulkEditDateBottomSheet extends StatefulWidget {final Iterable<EnteFile> enteFiles;const BulkEditDateBottomSheet({@@ -12,18 +12,29 @@ class BulkEditDateBottomSheet extends StatelessWidget {required this.enteFiles,});+ @override+ State<BulkEditDateBottomSheet> createState() =>+ _BulkEditDateBottomSheetState();+}++class _BulkEditDateBottomSheetState extends State<BulkEditDateBottomSheet> {+ // Single date or shift date+ bool showSingleOrShiftChoice = true;+ bool singleSelected = true;+@overrideWidget build(BuildContext context) {- final photoCount = enteFiles.length;+ final photoCount = widget.enteFiles.length;if (photoCount == 0) {return const SizedBox.shrink();}final colorScheme = getEnteColorScheme(context);- final firstFileTime =- DateTime.fromMicrosecondsSinceEpoch(enteFiles.first.creationTime!);+ final firstFileTime = DateTime.fromMicrosecondsSinceEpoch(+ widget.enteFiles.first.creationTime!,+ );DateTime startDate = firstFileTime;DateTime endDate = firstFileTime;- for (final file in enteFiles) {+ for (final file in widget.enteFiles) {if (file.creationTime == null) {continue;}@@ -48,18 +59,23 @@ class BulkEditDateBottomSheet extends StatelessWidget {children: [// Photo count and date range sectionPhotoDateHeaderWidget(- enteFiles: enteFiles,+ enteFiles: widget.enteFiles,startDate: startDate,endDate: endDate,),- SelectDateOrShiftWidget(- onSelectOneDate: () {- Navigator.pop(context);- },- onShiftDates: () {- Navigator.pop(context);- },- ),+ if (showSingleOrShiftChoice)+ SelectDateOrShiftWidget(+ onSelectOneDate: () {+ showSingleOrShiftChoice = false;+ singleSelected = true;+ setState(() {});+ },+ onShiftDates: () {+ showSingleOrShiftChoice = false;+ singleSelected = false;+ setState(() {});+ },+ ),// Bottom indicator lineconst SizedBox(height: 48),