ente/lib/ui/gallery_footer_widget.dart

69 lines
2.1 KiB
Dart
Raw Normal View History

2021-05-12 21:12:18 +00:00
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:photo_manager/photo_manager.dart';
import 'package:photos/services/local_sync_service.dart';
2021-07-11 18:35:16 +00:00
import 'package:photos/ui/backup_folder_selection_page.dart';
import 'package:photos/utils/navigation_util.dart';
2021-05-12 21:12:18 +00:00
class GalleryFooterWidget extends StatelessWidget {
const GalleryFooterWidget({Key key}) : super(key: key);
@override
Widget build(BuildContext context) {
return Column(
children: [
Padding(padding: EdgeInsets.all(12)),
Divider(
height: 1,
color: Theme.of(context).buttonColor.withOpacity(0.4),
),
Container(
padding: EdgeInsets.fromLTRB(28, 36, 28, 46),
child: OutlinedButton(
style: OutlinedButton.styleFrom(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
),
padding: EdgeInsets.fromLTRB(50, 20, 50, 20),
side: BorderSide(
width: 2,
2021-06-29 04:53:34 +00:00
color: Theme.of(context).buttonColor.withOpacity(1),
2021-05-12 21:12:18 +00:00
),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: [
Icon(
Icons.cloud_upload,
2021-06-29 04:53:34 +00:00
color: Colors.white,
2021-05-12 21:12:18 +00:00
),
Padding(padding: EdgeInsets.all(6)),
Text(
"preserve more",
style: TextStyle(
2021-06-29 04:53:34 +00:00
color: Colors.white,
2021-05-12 21:12:18 +00:00
),
),
],
),
onPressed: () async {
if (LocalSyncService.instance.hasGrantedLimitedPermissions()) {
await PhotoManager.presentLimited();
} else {
2021-07-11 18:35:16 +00:00
routeToPage(
context,
BackupFolderSelectionPage(
buttonText: "preserve",
),
);
}
2021-05-12 21:12:18 +00:00
},
),
),
],
);
}
}