π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
[mobile][photos] center checkbox widget for delete confirmation sheet
Priyanshu Dangare735b6ab5bdc5
diff --git a/mobile/apps/photos/lib/l10n/intl_en.arb b/mobile/apps/photos/lib/l10n/intl_en.arbindex 0a8c450e0e..edb11b9c95 100644--- a/mobile/apps/photos/lib/l10n/intl_en.arb+++ b/mobile/apps/photos/lib/l10n/intl_en.arb@@ -511,7 +511,7 @@"deleteFromDevice": "Delete from device","deleteFromBoth": "Delete from both","moreOptions": "More options",- "setAsDefault": "Set as default",+ "setAsMyDefaultChoice": "Set as my default choice","newAlbum": "New album","albums": "Albums","ente": "Ente",diff --git a/mobile/apps/photos/lib/utils/delete_file_util.dart b/mobile/apps/photos/lib/utils/delete_file_util.dartindex 03fb4edfa4..5a36014460 100644--- a/mobile/apps/photos/lib/utils/delete_file_util.dart+++ b/mobile/apps/photos/lib/utils/delete_file_util.dart@@ -1218,21 +1218,24 @@ class DeleteConfirmationSheetState extends State<DeleteConfirmationSheet> {ConstrainedBox(constraints: const BoxConstraints(minHeight: 48),child: _isMoreOptionsShown- ? LabeledControlComponent(- control: CheckboxComponent(- selected: _isSetAsDefaultSelected,- onChanged: (value) {+ ? Center(+ child: LabeledControlComponent(+ control: CheckboxComponent(+ selected: _isSetAsDefaultSelected,+ onChanged: (value) {+ setState(() {+ _isSetAsDefaultSelected = value;+ });+ },+ ),+ label: l10n.setAsMyDefaultChoice,+ foreground: context.componentColors.textLight,+ onTap: () {setState(() {- _isSetAsDefaultSelected = value;+ _isSetAsDefaultSelected = !_isSetAsDefaultSelected;});},),- label: l10n.setAsDefault,- onTap: () {- setState(() {- _isSetAsDefaultSelected = !_isSetAsDefaultSelected;- });- },): _MoreOptionsButton(onTap: () {diff --git a/mobile/apps/photos/test/utils/delete_file_util_test.dart b/mobile/apps/photos/test/utils/delete_file_util_test.dartindex b224d3604e..6c2aa7f17c 100644--- a/mobile/apps/photos/test/utils/delete_file_util_test.dart+++ b/mobile/apps/photos/test/utils/delete_file_util_test.dart@@ -119,7 +119,14 @@ void main() {ButtonComponentVariant.secondary,ButtonComponentVariant.critical,]);- expect(find.text('Set as default'), findsOneWidget);+ expect(find.text('Set as my default choice'), findsOneWidget);+ expect(+ find.ancestor(+ of: find.byType(LabeledControlComponent),+ matching: find.byType(Center),+ ),+ findsOneWidget,+ );expect(find.byTooltip('Close'), findsOneWidget);expect(find.text('Cancel'), findsNothing);_expectVisibleButtonsInOrder(tester, [