1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2024-12-28 06:31:58 +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(
onNextPage: () => toNextPage(),
),
OnboardingLocationPermission(
onNextPage: () => toNextPage(),
),
],
),
),
@ -225,19 +228,78 @@ class OnboardingGalleryPermission extends StatelessWidget {
Widget build(BuildContext context) {
return Padding(
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: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Icon(
Icons.perm_media_outlined,
size: 24,
icon,
size: 32,
color: context.primaryColor.withAlpha(250),
),
const SizedBox(width: 16),
Text(
"Gallery Permission",
title,
style: context.textTheme.headlineSmall?.copyWith(
fontWeight: FontWeight.w600,
color: context.primaryColor,
@ -247,24 +309,20 @@ class OnboardingGalleryPermission extends StatelessWidget {
),
const SizedBox(height: 16),
Text(
"We use the read and write permission of the media gallery for the following actions",
subtitle,
style: context.textTheme.headlineSmall?.copyWith(
fontWeight: FontWeight.w400,
color: context.colorScheme.onSurface.withAlpha(220),
),
),
const SizedBox(height: 40),
const BulletList([
'Display the local videos and images',
'Read the file content to upload to your Immich instance',
'Remove media from the device on your request',
]),
BulletList(descriptionList),
const Spacer(),
SizedBox(
height: 48,
width: double.infinity,
child: ElevatedButton(
onPressed: onNextPage,
onPressed: onConfirm,
child: const Text(
'OK',
style: TextStyle(
@ -275,7 +333,6 @@ class OnboardingGalleryPermission extends StatelessWidget {
),
),
],
),
);
}
}