Accept button text as a param

This commit is contained in:
vishnukvmd 2021-07-11 23:35:07 +05:30
parent f7a8402c8b
commit 136d704acb
3 changed files with 17 additions and 5 deletions

View file

@ -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

View file

@ -349,7 +349,12 @@ class _HomeWidgetState extends State<HomeWidget> {
.hasGrantedLimitedPermissions()) {
PhotoManager.presentLimited();
} else {
routeToPage(context, BackupFolderSelectionPage());
routeToPage(
context,
BackupFolderSelectionPage(
shouldSelectAll: true,
buttonText: "start backup",
));
}
},
),

View file

@ -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",
));
}
}
});