google addin
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:package_info_plus/package_info_plus.dart';
|
||||
import 'package:url_launcher/url_launcher.dart';
|
||||
import '../services/app_settings.dart';
|
||||
import '../utils/translations.dart';
|
||||
import '../services/notification_service.dart';
|
||||
@@ -12,6 +13,8 @@ import 'camera_settings_screen.dart';
|
||||
class SettingsScreen extends StatelessWidget {
|
||||
const SettingsScreen({super.key});
|
||||
|
||||
static const _privacyPolicyUrl = 'https://sdkovinarmuta.si/privacy-and-policy/';
|
||||
|
||||
static final Future<PackageInfo> _packageInfo = PackageInfo.fromPlatform();
|
||||
|
||||
@override
|
||||
@@ -119,6 +122,17 @@ class SettingsScreen extends StatelessWidget {
|
||||
),
|
||||
]),
|
||||
|
||||
SectionHeader(t('About')),
|
||||
GroupCard(children: [
|
||||
SettingsTile(
|
||||
title: t('Privacy policy'),
|
||||
onTap: () => launchUrl(
|
||||
Uri.parse(_privacyPolicyUrl),
|
||||
mode: LaunchMode.externalApplication,
|
||||
),
|
||||
),
|
||||
]),
|
||||
|
||||
const SizedBox(height: 28),
|
||||
FutureBuilder<PackageInfo>(
|
||||
future: _packageInfo,
|
||||
@@ -233,23 +247,27 @@ class SettingsScreen extends StatelessWidget {
|
||||
final s = AppSettings.instance;
|
||||
showModalBottomSheet(
|
||||
context: context,
|
||||
// 7 options exceed the default 9/16 height cap on smaller phones
|
||||
isScrollControlled: true,
|
||||
builder: (sheet) => SafeArea(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
_SheetTitle(s.t('Remind me')),
|
||||
for (final h in AppSettings.reminderHourOptions)
|
||||
SheetOption(
|
||||
label: _hoursBefore(h),
|
||||
selected: h == s.reminderHours,
|
||||
selectedColor: s.bulletColor,
|
||||
onTap: () {
|
||||
s.setReminderHours(h).then((_) => _reschedule());
|
||||
Navigator.pop(sheet);
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
],
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
_SheetTitle(s.t('Remind me')),
|
||||
for (final h in AppSettings.reminderHourOptions)
|
||||
SheetOption(
|
||||
label: _hoursBefore(h),
|
||||
selected: h == s.reminderHours,
|
||||
selectedColor: s.bulletColor,
|
||||
onTap: () {
|
||||
s.setReminderHours(h).then((_) => _reschedule());
|
||||
Navigator.pop(sheet);
|
||||
},
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user