π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
[photos] Fix backup folder selection page UI spacing and typography
Prateek Sunal856a4c466c0a
diff --git a/mobile/apps/photos/lib/ui/settings/backup/backup_folder_selection_page.dart b/mobile/apps/photos/lib/ui/settings/backup/backup_folder_selection_page.dartindex b645ee3293..fb6604a294 100644--- a/mobile/apps/photos/lib/ui/settings/backup/backup_folder_selection_page.dart+++ b/mobile/apps/photos/lib/ui/settings/backup/backup_folder_selection_page.dart@@ -87,6 +87,7 @@ class _BackupFolderSelectionPageState extends State<BackupFolderSelectionPage> {@overrideWidget build(BuildContext context) {+ final textTheme = getEnteTextTheme(context);return Scaffold(appBar: _treatAsOnboarding? null@@ -94,139 +95,126 @@ class _BackupFolderSelectionPageState extends State<BackupFolderSelectionPage> {elevation: 0,title: const Text(""),),- body: Column(- mainAxisAlignment: MainAxisAlignment.start,- children: [- const SizedBox(- height: 0,- ),- SafeArea(- child: Container(- padding: const EdgeInsets.fromLTRB(24, 8, 24, 8),- child: Text(- AppLocalizations.of(context).selectFoldersForBackup,- textAlign: TextAlign.left,- style: TextStyle(- color: Theme.of(context).colorScheme.onSurface,- fontFamily: 'Inter-Bold',- fontSize: 32,- fontWeight: FontWeight.bold,+ body: SafeArea(+ top: _treatAsOnboarding,+ bottom: false,+ child: Column(+ mainAxisAlignment: MainAxisAlignment.start,+ children: [+ Padding(+ padding: EdgeInsets.fromLTRB(+ 24,+ _treatAsOnboarding ? 8 : 0,+ 24,+ 8,+ ),+ child: Align(+ alignment: Alignment.centerLeft,+ child: Text(+ AppLocalizations.of(context).selectFoldersForBackup,+ textAlign: TextAlign.left,+ style: textTheme.h2Bold,),),),- ),- Padding(- padding: const EdgeInsets.only(left: 24, right: 48),- child: Text(- AppLocalizations.of(context)- .selectedFoldersWillBeEncryptedAndBackedUp,- style:- Theme.of(context).textTheme.bodySmall!.copyWith(height: 1.3),+ Padding(+ padding: const EdgeInsets.only(left: 24, right: 24),+ child: Align(+ alignment: Alignment.centerLeft,+ child: Text(+ AppLocalizations.of(context)+ .selectedFoldersWillBeEncryptedAndBackedUp,+ style: textTheme.smallMuted,+ ),+ ),),- ),- const Padding(- padding: EdgeInsets.all(10),- ),- _deviceCollections == null- ? const SizedBox.shrink()- : GestureDetector(- behavior: HitTestBehavior.translucent,- child: Padding(- padding: const EdgeInsets.fromLTRB(24, 6, 64, 12),- child: Align(- alignment: Alignment.centerLeft,- child: Text(- _selectedDevicePathIDs.length ==- _allDevicePathIDs.length- ? AppLocalizations.of(context).unselectAll- : AppLocalizations.of(context).selectAll,- textAlign: TextAlign.right,- style: const TextStyle(- decoration: TextDecoration.underline,- fontSize: 16,+ const SizedBox(height: 20),+ _deviceCollections == null+ ? const SizedBox.shrink()+ : GestureDetector(+ behavior: HitTestBehavior.translucent,+ child: Padding(+ padding: const EdgeInsets.fromLTRB(24, 6, 64, 12),+ child: Align(+ alignment: Alignment.centerLeft,+ child: Text(+ _selectedDevicePathIDs.length ==+ _allDevicePathIDs.length+ ? AppLocalizations.of(context).unselectAll+ : AppLocalizations.of(context).selectAll,+ textAlign: TextAlign.right,+ style: const TextStyle(+ decoration: TextDecoration.underline,+ fontSize: 16,+ ),),),),+ onTap: () {+ final hasSelectedAll = _selectedDevicePathIDs.length ==+ _allDevicePathIDs.length;+ // Flip selection+ if (hasSelectedAll) {+ _selectedDevicePathIDs.clear();+ } else {+ _selectedDevicePathIDs.addAll(_allDevicePathIDs);+ }+ _deviceCollections!.sort((first, second) {+ return first.name+ .toLowerCase()+ .compareTo(second.name.toLowerCase());+ });+ setState(() {});+ },),- onTap: () {- final hasSelectedAll = _selectedDevicePathIDs.length ==- _allDevicePathIDs.length;- // Flip selection- if (hasSelectedAll) {- _selectedDevicePathIDs.clear();- } else {- _selectedDevicePathIDs.addAll(_allDevicePathIDs);- }- _deviceCollections!.sort((first, second) {- return first.name- .toLowerCase()- .compareTo(second.name.toLowerCase());- });- setState(() {});- },- ),- Expanded(child: _getFolders()),- SafeArea(- child: Padding(- padding: const EdgeInsets.only(bottom: 12),- child: Column(- children: [- Container(- width: double.infinity,- decoration: BoxDecoration(- boxShadow: [- BoxShadow(- color: getEnteColorScheme(context).backgroundBase,- blurRadius: 24,- offset: const Offset(0, -8),- spreadRadius: 4,+ Expanded(child: _getFolders()),+ SafeArea(+ top: false,+ child: Padding(+ padding: const EdgeInsets.only(left: 20, right: 20, bottom: 12),+ child: Column(+ mainAxisSize: MainAxisSize.min,+ children: [+ SizedBox(+ width: double.infinity,+ child: OutlinedButton(+ onPressed:+ _treatAsOnboarding && _selectedDevicePathIDs.isEmpty+ ? null+ : () async {+ await updateFolderSettings();+ },+ child: Text(+ widget.isFirstBackup+ ? AppLocalizations.of(context).startBackup+ : AppLocalizations.of(context).backup,),- ],- ),- padding: const EdgeInsets.only(left: 20, right: 20),- child: OutlinedButton(- onPressed:- _treatAsOnboarding && _selectedDevicePathIDs.isEmpty- ? null- : () async {- await updateFolderSettings();- },- child: Text(- widget.isFirstBackup- ? AppLocalizations.of(context).startBackup- : AppLocalizations.of(context).backup,),),- ),- _treatAsOnboarding- ? const SizedBox(height: 20)- : const SizedBox.shrink(),- _treatAsOnboarding- ? GestureDetector(- key: const ValueKey("skipBackupButton"),- behavior: HitTestBehavior.opaque,- onTap: () {- Navigator.of(context).pop(false);- },- child: Padding(- padding: const EdgeInsets.only(bottom: 8),+ _treatAsOnboarding+ ? const SizedBox(height: 20)+ : const SizedBox.shrink(),+ _treatAsOnboarding+ ? GestureDetector(+ key: const ValueKey("skipBackupButton"),+ behavior: HitTestBehavior.opaque,+ onTap: () {+ Navigator.of(context).pop(false);+ },child: Text(AppLocalizations.of(context).skip,- style: Theme.of(context)- .textTheme- .bodySmall!- .copyWith(- decoration: TextDecoration.underline,- ),+ style: textTheme.smallMuted.copyWith(+ decoration: TextDecoration.underline,+ ),),- ),- )- : const SizedBox.shrink(),- ],+ )+ : const SizedBox.shrink(),+ ],+ ),),),- ),- ],+ ],+ ),),);}@@ -307,7 +295,7 @@ class _BackupFolderSelectionPageState extends State<BackupFolderSelectionPage> {_sortFiles();final scrollController = ScrollController();return Container(- padding: const EdgeInsets.symmetric(horizontal: 20),+ padding: const EdgeInsets.only(left: 20, right: 20, bottom: 8),child: Scrollbar(controller: scrollController,thumbVisibility: true,@@ -362,7 +350,7 @@ class _BackupFolderSelectionPageState extends State<BackupFolderSelectionPage> {? _pathIDToItemCount![deviceCollection.id] ?? 0: -1;return Padding(- padding: const EdgeInsets.only(bottom: 1, right: 1),+ padding: const EdgeInsets.only(bottom: 8, right: 1),child: Container(decoration: BoxDecoration(border: Border.all(