2022-10-20 09:10:17 +00:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:photo_manager/photo_manager.dart';
|
2023-04-06 08:41:56 +00:00
|
|
|
import 'package:photos/generated/l10n.dart';
|
2022-10-20 09:10:17 +00:00
|
|
|
import 'package:photos/services/local_sync_service.dart';
|
|
|
|
import 'package:photos/ui/common/gradient_button.dart';
|
2023-06-06 09:57:17 +00:00
|
|
|
import 'package:photos/ui/settings/backup/backup_folder_selection_page.dart';
|
2022-10-20 09:10:17 +00:00
|
|
|
import 'package:photos/utils/navigation_util.dart';
|
|
|
|
|
|
|
|
class StartBackupHookWidget extends StatelessWidget {
|
|
|
|
final Widget headerWidget;
|
|
|
|
|
|
|
|
const StartBackupHookWidget({super.key, required this.headerWidget});
|
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Column(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
children: [
|
|
|
|
headerWidget,
|
|
|
|
Padding(
|
|
|
|
padding: const EdgeInsets.only(top: 64),
|
|
|
|
child: Image.asset(
|
|
|
|
"assets/onboarding_safe.png",
|
|
|
|
height: 206,
|
|
|
|
),
|
|
|
|
),
|
|
|
|
Text(
|
2023-04-06 08:41:56 +00:00
|
|
|
S.of(context).noPhotosAreBeingBackedUpRightNow,
|
2022-10-20 09:10:17 +00:00
|
|
|
style: Theme.of(context)
|
|
|
|
.textTheme
|
2023-06-13 06:41:31 +00:00
|
|
|
.bodySmall!
|
2022-10-20 09:10:17 +00:00
|
|
|
.copyWith(fontFamily: 'Inter-Medium', fontSize: 16),
|
|
|
|
),
|
|
|
|
Center(
|
|
|
|
child: Material(
|
|
|
|
type: MaterialType.transparency,
|
|
|
|
child: Container(
|
|
|
|
width: double.infinity,
|
|
|
|
height: 64,
|
|
|
|
padding: const EdgeInsets.fromLTRB(20, 0, 20, 0),
|
|
|
|
child: GradientButton(
|
|
|
|
onTap: () async {
|
|
|
|
if (LocalSyncService.instance
|
|
|
|
.hasGrantedLimitedPermissions()) {
|
|
|
|
PhotoManager.presentLimited();
|
|
|
|
} else {
|
|
|
|
routeToPage(
|
|
|
|
context,
|
2023-04-06 08:41:56 +00:00
|
|
|
BackupFolderSelectionPage(
|
|
|
|
buttonText: S.of(context).startBackup,
|
2022-10-20 09:10:17 +00:00
|
|
|
),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
},
|
2023-04-06 08:41:56 +00:00
|
|
|
text: S.of(context).startBackup,
|
2022-10-20 09:10:17 +00:00
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
const Padding(padding: EdgeInsets.all(50)),
|
|
|
|
],
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|