1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2024-12-28 22:51:59 +00:00
This commit is contained in:
Alex 2024-12-20 13:01:18 -06:00
parent 90f893df66
commit 5645f9982d
No known key found for this signature in database
GPG key ID: 53CD082B3A5E1082

View file

@ -42,6 +42,9 @@ class OnboardingPage extends HookConsumerWidget {
OnboardingGalleryPermission( OnboardingGalleryPermission(
onNextPage: () => toNextPage(), onNextPage: () => toNextPage(),
), ),
OnboardingLocationPermission(
onNextPage: () => toNextPage(),
),
], ],
), ),
), ),
@ -225,19 +228,78 @@ class OnboardingGalleryPermission extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Padding( return Padding(
padding: const EdgeInsets.all(24.0), padding: const EdgeInsets.all(24.0),
child: Column( child: PermissionInfoTemplate(
icon: Icons.perm_media_outlined,
title: "Gallery Permission",
subtitle:
"We use the read and write permission of the media gallery for the following actions",
descriptionList: [
'Display the local videos and images',
'Read the file content to upload to your Immich instance',
'Remove media from the device on your request',
],
onConfirm: onNextPage,
),
);
}
}
class OnboardingLocationPermission extends StatelessWidget {
final VoidCallback onNextPage;
const OnboardingLocationPermission({super.key, required this.onNextPage});
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.all(24.0),
child: PermissionInfoTemplate(
icon: Icons.location_on_outlined,
title: "Location Permission",
subtitle:
"We use the always on, precise location access for the following actions",
descriptionList: [
'Display the local videos and images',
'Read the file content to upload to your Immich instance',
'Remove media from the device on your request',
],
onConfirm: onNextPage,
),
);
}
}
class PermissionInfoTemplate extends StatelessWidget {
final String title;
final String subtitle;
final List<String> descriptionList;
final VoidCallback onConfirm;
final IconData icon;
const PermissionInfoTemplate({
super.key,
required this.title,
required this.subtitle,
required this.descriptionList,
required this.onConfirm,
required this.icon,
});
@override
Widget build(BuildContext context) {
return Column(
children: [ children: [
Row( Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
Icon( Icon(
Icons.perm_media_outlined, icon,
size: 24, size: 32,
color: context.primaryColor.withAlpha(250), color: context.primaryColor.withAlpha(250),
), ),
const SizedBox(width: 16), const SizedBox(width: 16),
Text( Text(
"Gallery Permission", title,
style: context.textTheme.headlineSmall?.copyWith( style: context.textTheme.headlineSmall?.copyWith(
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
color: context.primaryColor, color: context.primaryColor,
@ -247,24 +309,20 @@ class OnboardingGalleryPermission extends StatelessWidget {
), ),
const SizedBox(height: 16), const SizedBox(height: 16),
Text( Text(
"We use the read and write permission of the media gallery for the following actions", subtitle,
style: context.textTheme.headlineSmall?.copyWith( style: context.textTheme.headlineSmall?.copyWith(
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
color: context.colorScheme.onSurface.withAlpha(220), color: context.colorScheme.onSurface.withAlpha(220),
), ),
), ),
const SizedBox(height: 40), const SizedBox(height: 40),
const BulletList([ BulletList(descriptionList),
'Display the local videos and images',
'Read the file content to upload to your Immich instance',
'Remove media from the device on your request',
]),
const Spacer(), const Spacer(),
SizedBox( SizedBox(
height: 48, height: 48,
width: double.infinity, width: double.infinity,
child: ElevatedButton( child: ElevatedButton(
onPressed: onNextPage, onPressed: onConfirm,
child: const Text( child: const Text(
'OK', 'OK',
style: TextStyle( style: TextStyle(
@ -275,7 +333,6 @@ class OnboardingGalleryPermission extends StatelessWidget {
), ),
), ),
], ],
),
); );
} }
} }