diff --git a/lib/ui/backup_folder_selection_page.dart b/lib/ui/backup_folder_selection_page.dart index 1caa8e027..359efc4ad 100644 --- a/lib/ui/backup_folder_selection_page.dart +++ b/lib/ui/backup_folder_selection_page.dart @@ -14,12 +14,12 @@ import 'package:photos/ui/loading_widget.dart'; import 'package:photos/ui/thumbnail_widget.dart'; class BackupFolderSelectionPage extends StatefulWidget { - final bool shouldSelectAll; + final bool isOnboarding; final String buttonText; const BackupFolderSelectionPage({ @required this.buttonText, - this.shouldSelectAll = false, + this.isOnboarding = false, Key key, }) : super(key: key); @@ -49,7 +49,7 @@ class _BackupFolderSelectionPageState extends State { for (final file in _latestFiles) { _allFolders.add(file.deviceFolder); } - if (widget.shouldSelectAll) { + if (widget.isOnboarding) { _selectedFolders.addAll(_allFolders); } _selectedFolders.removeWhere((folder) => !_allFolders.contains(folder)); @@ -61,7 +61,7 @@ class _BackupFolderSelectionPageState extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: widget.shouldSelectAll + appBar: widget.isOnboarding ? null : AppBar( elevation: 0, @@ -136,37 +136,63 @@ class _BackupFolderSelectionPageState extends State { }, ), Expanded(child: _getFolders()), - Hero( - tag: "select_folders", - child: Container( - width: double.infinity, - decoration: BoxDecoration( - boxShadow: [ - BoxShadow( - color: Theme.of(context).backgroundColor, - blurRadius: 24, - offset: Offset(0, -8), - spreadRadius: 4, - ) - ], + Column( + children: [ + Hero( + tag: "select_folders", + child: Container( + width: double.infinity, + decoration: BoxDecoration( + boxShadow: [ + BoxShadow( + color: Theme.of(context).backgroundColor, + blurRadius: 24, + offset: Offset(0, -8), + spreadRadius: 4, + ) + ], + ), + padding: widget.isOnboarding + ? EdgeInsets.only(left: 20, right: 20) + : EdgeInsets.only( + top: 16, + left: 20, + right: 20, + bottom: Platform.isIOS ? 60 : 32, + ), + child: OutlinedButton( + child: Text(widget.buttonText), + onPressed: _selectedFolders.isEmpty + ? null + : () async { + await Configuration.instance + .setPathsToBackUp(_selectedFolders); + Bus.instance.fire(BackupFoldersUpdatedEvent()); + Navigator.of(context).pop(); + }, + ), + ), ), - padding: EdgeInsets.only( - left: 20, - right: 20, - bottom: Platform.isIOS ? 60 : 32, - ), - child: OutlinedButton( - child: Text(widget.buttonText), - onPressed: _selectedFolders.isEmpty - ? null - : () async { - await Configuration.instance - .setPathsToBackUp(_selectedFolders); - Bus.instance.fire(BackupFoldersUpdatedEvent()); - Navigator.of(context).pop(); - }, - ), - ), + widget.isOnboarding + ? Padding( + padding: EdgeInsets.only( + top: 16, + bottom: Platform.isIOS ? 48 : 32, + ), + child: GestureDetector( + onTap: () { + Navigator.of(context).pop(); + }, + child: Text( + "Skip", + style: Theme.of(context).textTheme.caption.copyWith( + decoration: TextDecoration.underline, + ), + ), + ), + ) + : Container(), + ], ), ], ), diff --git a/lib/ui/home_widget.dart b/lib/ui/home_widget.dart index 41571b0b1..137d7d147 100644 --- a/lib/ui/home_widget.dart +++ b/lib/ui/home_widget.dart @@ -480,7 +480,6 @@ class _HomeWidgetState extends State { routeToPage( context, BackupFolderSelectionPage( - shouldSelectAll: true, buttonText: "Start backup", ), ); diff --git a/lib/ui/loading_photos_widget.dart b/lib/ui/loading_photos_widget.dart index 2a9db2418..4a8101c52 100644 --- a/lib/ui/loading_photos_widget.dart +++ b/lib/ui/loading_photos_widget.dart @@ -47,7 +47,7 @@ class _LoadingPhotosWidgetState extends State { routeToPage( context, BackupFolderSelectionPage( - shouldSelectAll: true, + isOnboarding: true, buttonText: "Start backup", ), );