Accept button text as a param
This commit is contained in:
parent
f7a8402c8b
commit
136d704acb
|
@ -10,9 +10,11 @@ import 'package:photos/ui/thumbnail_widget.dart';
|
|||
|
||||
class BackupFolderSelectionPage extends StatefulWidget {
|
||||
final bool shouldSelectAll;
|
||||
final String buttonText;
|
||||
|
||||
const BackupFolderSelectionPage(
|
||||
this.shouldSelectAll, {
|
||||
const BackupFolderSelectionPage({
|
||||
@required this.shouldSelectAll,
|
||||
@required this.buttonText,
|
||||
Key key,
|
||||
}) : super(key: key);
|
||||
|
||||
|
@ -106,7 +108,7 @@ class _BackupFolderSelectionPageState extends State<BackupFolderSelectionPage> {
|
|||
child: Container(
|
||||
padding: EdgeInsets.only(left: 60, right: 60, bottom: 32),
|
||||
child: button(
|
||||
"start backup",
|
||||
widget.buttonText,
|
||||
fontSize: 18,
|
||||
onPressed: _backedupFolders.length == 0
|
||||
? null
|
||||
|
|
|
@ -349,7 +349,12 @@ class _HomeWidgetState extends State<HomeWidget> {
|
|||
.hasGrantedLimitedPermissions()) {
|
||||
PhotoManager.presentLimited();
|
||||
} else {
|
||||
routeToPage(context, BackupFolderSelectionPage());
|
||||
routeToPage(
|
||||
context,
|
||||
BackupFolderSelectionPage(
|
||||
shouldSelectAll: true,
|
||||
buttonText: "start backup",
|
||||
));
|
||||
}
|
||||
},
|
||||
),
|
||||
|
|
|
@ -42,7 +42,12 @@ class _LoadingPhotosWidgetState extends State<LoadingPhotosWidget> {
|
|||
if (LocalSyncService.instance.hasGrantedLimitedPermissions()) {
|
||||
// Do nothing, let HomeWidget refresh
|
||||
} else {
|
||||
routeToPage(context, BackupFolderSelectionPage(true));
|
||||
routeToPage(
|
||||
context,
|
||||
BackupFolderSelectionPage(
|
||||
shouldSelectAll: true,
|
||||
buttonText: "start backup",
|
||||
));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue