diff --git a/assets/google_fonts/Cabin-Bold.ttf b/assets/google_fonts/Cabin-Bold.ttf new file mode 100644 index 0000000..6d99c37 Binary files /dev/null and b/assets/google_fonts/Cabin-Bold.ttf differ diff --git a/assets/google_fonts/Cabin-BoldItalic.ttf b/assets/google_fonts/Cabin-BoldItalic.ttf new file mode 100644 index 0000000..ceb6b47 Binary files /dev/null and b/assets/google_fonts/Cabin-BoldItalic.ttf differ diff --git a/assets/google_fonts/Cabin-Italic.ttf b/assets/google_fonts/Cabin-Italic.ttf new file mode 100644 index 0000000..b51ce91 Binary files /dev/null and b/assets/google_fonts/Cabin-Italic.ttf differ diff --git a/assets/google_fonts/Cabin-Medium.ttf b/assets/google_fonts/Cabin-Medium.ttf new file mode 100644 index 0000000..61a4477 Binary files /dev/null and b/assets/google_fonts/Cabin-Medium.ttf differ diff --git a/assets/google_fonts/Cabin-MediumItalic.ttf b/assets/google_fonts/Cabin-MediumItalic.ttf new file mode 100644 index 0000000..15eaf51 Binary files /dev/null and b/assets/google_fonts/Cabin-MediumItalic.ttf differ diff --git a/assets/google_fonts/Cabin-Regular.ttf b/assets/google_fonts/Cabin-Regular.ttf new file mode 100644 index 0000000..cea1ddd Binary files /dev/null and b/assets/google_fonts/Cabin-Regular.ttf differ diff --git a/assets/google_fonts/Cabin-SemiBold.ttf b/assets/google_fonts/Cabin-SemiBold.ttf new file mode 100644 index 0000000..046dd5f Binary files /dev/null and b/assets/google_fonts/Cabin-SemiBold.ttf differ diff --git a/assets/google_fonts/Cabin-SemiBoldItalic.ttf b/assets/google_fonts/Cabin-SemiBoldItalic.ttf new file mode 100644 index 0000000..537efc8 Binary files /dev/null and b/assets/google_fonts/Cabin-SemiBoldItalic.ttf differ diff --git a/assets/google_fonts/Cabin_Condensed-Bold.ttf b/assets/google_fonts/Cabin_Condensed-Bold.ttf new file mode 100644 index 0000000..4291733 Binary files /dev/null and b/assets/google_fonts/Cabin_Condensed-Bold.ttf differ diff --git a/assets/google_fonts/Cabin_Condensed-BoldItalic.ttf b/assets/google_fonts/Cabin_Condensed-BoldItalic.ttf new file mode 100644 index 0000000..50ed132 Binary files /dev/null and b/assets/google_fonts/Cabin_Condensed-BoldItalic.ttf differ diff --git a/assets/google_fonts/Cabin_Condensed-Italic.ttf b/assets/google_fonts/Cabin_Condensed-Italic.ttf new file mode 100644 index 0000000..6be67f6 Binary files /dev/null and b/assets/google_fonts/Cabin_Condensed-Italic.ttf differ diff --git a/assets/google_fonts/Cabin_Condensed-Medium.ttf b/assets/google_fonts/Cabin_Condensed-Medium.ttf new file mode 100644 index 0000000..fd87c6e Binary files /dev/null and b/assets/google_fonts/Cabin_Condensed-Medium.ttf differ diff --git a/assets/google_fonts/Cabin_Condensed-MediumItalic.ttf b/assets/google_fonts/Cabin_Condensed-MediumItalic.ttf new file mode 100644 index 0000000..199f074 Binary files /dev/null and b/assets/google_fonts/Cabin_Condensed-MediumItalic.ttf differ diff --git a/assets/google_fonts/Cabin_Condensed-Regular.ttf b/assets/google_fonts/Cabin_Condensed-Regular.ttf new file mode 100644 index 0000000..825af7e Binary files /dev/null and b/assets/google_fonts/Cabin_Condensed-Regular.ttf differ diff --git a/assets/google_fonts/Cabin_Condensed-SemiBold.ttf b/assets/google_fonts/Cabin_Condensed-SemiBold.ttf new file mode 100644 index 0000000..1332599 Binary files /dev/null and b/assets/google_fonts/Cabin_Condensed-SemiBold.ttf differ diff --git a/assets/google_fonts/Cabin_Condensed-SemiBoldItalic.ttf b/assets/google_fonts/Cabin_Condensed-SemiBoldItalic.ttf new file mode 100644 index 0000000..83f23f1 Binary files /dev/null and b/assets/google_fonts/Cabin_Condensed-SemiBoldItalic.ttf differ diff --git a/assets/google_fonts/Cabin_SemiCondensed-Bold.ttf b/assets/google_fonts/Cabin_SemiCondensed-Bold.ttf new file mode 100644 index 0000000..36c1d81 Binary files /dev/null and b/assets/google_fonts/Cabin_SemiCondensed-Bold.ttf differ diff --git a/assets/google_fonts/Cabin_SemiCondensed-BoldItalic.ttf b/assets/google_fonts/Cabin_SemiCondensed-BoldItalic.ttf new file mode 100644 index 0000000..d546485 Binary files /dev/null and b/assets/google_fonts/Cabin_SemiCondensed-BoldItalic.ttf differ diff --git a/assets/google_fonts/Cabin_SemiCondensed-Italic.ttf b/assets/google_fonts/Cabin_SemiCondensed-Italic.ttf new file mode 100644 index 0000000..500ca9c Binary files /dev/null and b/assets/google_fonts/Cabin_SemiCondensed-Italic.ttf differ diff --git a/assets/google_fonts/Cabin_SemiCondensed-Medium.ttf b/assets/google_fonts/Cabin_SemiCondensed-Medium.ttf new file mode 100644 index 0000000..2ef4608 Binary files /dev/null and b/assets/google_fonts/Cabin_SemiCondensed-Medium.ttf differ diff --git a/assets/google_fonts/Cabin_SemiCondensed-MediumItalic.ttf b/assets/google_fonts/Cabin_SemiCondensed-MediumItalic.ttf new file mode 100644 index 0000000..9205652 Binary files /dev/null and b/assets/google_fonts/Cabin_SemiCondensed-MediumItalic.ttf differ diff --git a/assets/google_fonts/Cabin_SemiCondensed-Regular.ttf b/assets/google_fonts/Cabin_SemiCondensed-Regular.ttf new file mode 100644 index 0000000..0206981 Binary files /dev/null and b/assets/google_fonts/Cabin_SemiCondensed-Regular.ttf differ diff --git a/assets/google_fonts/Cabin_SemiCondensed-SemiBold.ttf b/assets/google_fonts/Cabin_SemiCondensed-SemiBold.ttf new file mode 100644 index 0000000..d529913 Binary files /dev/null and b/assets/google_fonts/Cabin_SemiCondensed-SemiBold.ttf differ diff --git a/assets/google_fonts/Cabin_SemiCondensed-SemiBoldItalic.ttf b/assets/google_fonts/Cabin_SemiCondensed-SemiBoldItalic.ttf new file mode 100644 index 0000000..4371c29 Binary files /dev/null and b/assets/google_fonts/Cabin_SemiCondensed-SemiBoldItalic.ttf differ diff --git a/assets/google_fonts/OFL.txt b/assets/google_fonts/OFL.txt new file mode 100644 index 0000000..ddc1f87 --- /dev/null +++ b/assets/google_fonts/OFL.txt @@ -0,0 +1,94 @@ +Copyright 2018 The Cabin Project Authors (https://github.com/impallari/Cabin.git) +Copyright (c) 2008, Haley Fiege (haley@kingdomofawesome.com), Copyright (c) 2012, Brenda Gallo (gbrenda1987@gmail.com), Copyright (c) 2013, Pablo Impallari (www.impallari.com|impallari@gmail.com) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +https://openfontlicense.org + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/assets/google_fonts/Sniglet-ExtraBold.ttf b/assets/google_fonts/Sniglet-ExtraBold.ttf new file mode 100644 index 0000000..4c9a9e9 Binary files /dev/null and b/assets/google_fonts/Sniglet-ExtraBold.ttf differ diff --git a/assets/google_fonts/Sniglet-Regular.ttf b/assets/google_fonts/Sniglet-Regular.ttf new file mode 100644 index 0000000..6ea6036 Binary files /dev/null and b/assets/google_fonts/Sniglet-Regular.ttf differ diff --git a/lib/go_router_builder.dart b/lib/go_router_builder.dart index 017acfd..1595158 100644 --- a/lib/go_router_builder.dart +++ b/lib/go_router_builder.dart @@ -26,6 +26,8 @@ part 'go_router_builder.g.dart'; path: 'settings', routes: [ TypedGoRoute(path: 'locale'), + TypedGoRoute(path: 'more'), + TypedGoRoute(path: 'licenses'), ], ), ], @@ -57,6 +59,20 @@ class LocaleRoute extends GoRouteData with AuthenticationGuard { const LocaleContainer(); } +@immutable +class SettingsMoreRoute extends GoRouteData with AuthenticationGuard { + @override + Widget build(BuildContext context, GoRouterState state) => + const SettingsMoreScreen(); +} + +@immutable +class LicensesRoute extends GoRouteData with AuthenticationGuard { + @override + Widget build(BuildContext context, GoRouterState state) => + const LicensePage(); +} + @immutable class ProfileRoute extends GoRouteData with AuthenticationGuard { @override diff --git a/lib/go_router_builder.g.dart b/lib/go_router_builder.g.dart index 14332d5..f877811 100644 --- a/lib/go_router_builder.g.dart +++ b/lib/go_router_builder.g.dart @@ -60,6 +60,14 @@ RouteBase get $homeScreenRoute => GoRouteData.$route( path: 'locale', factory: $LocaleRouteExtension._fromState, ), + GoRouteData.$route( + path: 'more', + factory: $SettingsMoreRouteExtension._fromState, + ), + GoRouteData.$route( + path: 'licenses', + factory: $LicensesRouteExtension._fromState, + ), ], ), ], @@ -284,3 +292,38 @@ extension $LocaleRouteExtension on LocaleRoute { void replace(BuildContext context) => context.replace(location); } + +extension $SettingsMoreRouteExtension on SettingsMoreRoute { + static SettingsMoreRoute _fromState(GoRouterState state) => + SettingsMoreRoute(); + + String get location => GoRouteData.$location( + '/settings/more', + ); + + void go(BuildContext context) => context.go(location); + + Future push(BuildContext context) => context.push(location); + + void pushReplacement(BuildContext context) => + context.pushReplacement(location); + + void replace(BuildContext context) => context.replace(location); +} + +extension $LicensesRouteExtension on LicensesRoute { + static LicensesRoute _fromState(GoRouterState state) => LicensesRoute(); + + String get location => GoRouteData.$location( + '/settings/licenses', + ); + + void go(BuildContext context) => context.go(location); + + Future push(BuildContext context) => context.push(location); + + void pushReplacement(BuildContext context) => + context.pushReplacement(location); + + void replace(BuildContext context) => context.replace(location); +} diff --git a/lib/l10n/app_de.arb b/lib/l10n/app_de.arb index a74d794..fe3f171 100644 --- a/lib/l10n/app_de.arb +++ b/lib/l10n/app_de.arb @@ -80,6 +80,7 @@ "save": "Speichern", "selectContacts": "Wähl Kontakte aus", "settings": "Einstellungen", + "settingsMoreInfo": "Mehr Informationen", "signOut": "Abmelden", "signOutConfirmation": "Bist du sicher, dass du dich abmelden möchtest?", "systemLanguage": "Systemsprache", diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb index 9cc29dd..da0db07 100644 --- a/lib/l10n/app_en.arb +++ b/lib/l10n/app_en.arb @@ -110,6 +110,7 @@ "save": "Save", "selectContacts": "Select contacts", "settings": "Settings", + "settingsMoreInfo": "More info", "signOut": "Sign out", "signOutConfirmation": "Are you sure you want to sign out?", "systemLanguage": "System language", diff --git a/lib/l10n/app_es.arb b/lib/l10n/app_es.arb index 489b266..3b33049 100644 --- a/lib/l10n/app_es.arb +++ b/lib/l10n/app_es.arb @@ -80,6 +80,7 @@ "save": "Guarda", "selectContacts": "Elige contactos", "settings": "Configuraciones", + "settingsMoreInfo": "Más información", "signOut": "Cierra sesión", "signOutConfirmation": "¿Seguro que quieres cerrar sesión?", "systemLanguage": "Idioma del sistema", diff --git a/lib/l10n/app_fr.arb b/lib/l10n/app_fr.arb index 05054f2..ad82b7a 100644 --- a/lib/l10n/app_fr.arb +++ b/lib/l10n/app_fr.arb @@ -80,6 +80,7 @@ "save": "Sauvegarde", "selectContacts": "Choisis des contacts", "settings": "Paramètres", + "settingsMoreInfo": "Plus d'infos", "signOut": "Déconnecte-toi", "signOutConfirmation": "Tu es sûr de vouloir te déconnecter?", "systemLanguage": "Langue du système", diff --git a/lib/l10n/app_it.arb b/lib/l10n/app_it.arb index 2ee1992..6c536bb 100644 --- a/lib/l10n/app_it.arb +++ b/lib/l10n/app_it.arb @@ -80,6 +80,7 @@ "save": "Salva", "selectContacts": "Seleziona i contatti", "settings": "Impostazioni", + "settingsMoreInfo": "Altre informazioni", "signOut": "Esci", "signOutConfirmation": "Sei sicuro di voler uscire?", "systemLanguage": "Lingua del sistema", diff --git a/lib/main.dart b/lib/main.dart index da22746..ccfdf79 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -4,6 +4,7 @@ import 'package:app_links/app_links.dart'; import 'package:flutter/foundation.dart'; import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; +import 'package:google_fonts/google_fonts.dart'; import 'package:parousia/actions/actions.dart'; import 'package:parousia/app.dart'; import 'package:parousia/epics/epics.dart'; @@ -23,6 +24,18 @@ import 'router.dart'; Future main() async { WidgetsFlutterBinding.ensureInitialized(); + // Disable runtime fetching of Google Fonts to avoid network requests + // They must be bundled with assets + // https://pub.dev/packages/google_fonts#bundling-fonts-when-releasing + GoogleFonts.config.allowRuntimeFetching = false; + + // Add the Google Fonts license to the LicenseRegistry + // https://pub.dev/packages/google_fonts#licensing-fonts + LicenseRegistry.addLicense(() async* { + final license = await rootBundle.loadString('assets/google_fonts/OFL.txt'); + yield LicenseEntryWithLineBreaks(['google_fonts'], license); + }); + final configService = ConfigService(); await configService.initialize(); diff --git a/lib/presentation/screens/screens.dart b/lib/presentation/screens/screens.dart index 6c5c37c..07c3178 100644 --- a/lib/presentation/screens/screens.dart +++ b/lib/presentation/screens/screens.dart @@ -10,3 +10,4 @@ export 'profile.dart'; export 'schedule_create.dart'; export 'select_contacts.dart'; export 'settings.dart'; +export 'settings_more.dart'; diff --git a/lib/presentation/screens/settings.dart b/lib/presentation/screens/settings.dart index c25eb82..9a82df0 100644 --- a/lib/presentation/screens/settings.dart +++ b/lib/presentation/screens/settings.dart @@ -5,7 +5,6 @@ import 'package:parousia/presentation/presentation.dart'; /// A screen that allows the user to configure app settings. class SettingsScreen extends StatelessWidget { - /// Creates a [SettingsScreen]. const SettingsScreen({super.key}); @override @@ -23,7 +22,11 @@ class SettingsScreen extends StatelessWidget { onTap: () => LocaleRoute().push(context), ), const ThemeSwitcherContainer(), - const DeleteProfileTile(), + ListTile( + title: Text(l10n.settingsMoreInfo), + leading: const Icon(Icons.info_outline), + onTap: () => SettingsMoreRoute().push(context), + ), const SignOutTile(), ], ), diff --git a/lib/presentation/screens/settings_more.dart b/lib/presentation/screens/settings_more.dart new file mode 100644 index 0000000..6ce4cea --- /dev/null +++ b/lib/presentation/screens/settings_more.dart @@ -0,0 +1,29 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_gen/gen_l10n/app_localizations.dart'; +import 'package:parousia/go_router_builder.dart'; +import 'package:parousia/presentation/presentation.dart'; + +/// Screen for less common settings. +class SettingsMoreScreen extends StatelessWidget { + const SettingsMoreScreen({super.key}); + + @override + Widget build(BuildContext context) { + final l10n = AppLocalizations.of(context)!; + return Scaffold( + appBar: AppBar( + title: Text(l10n.settingsMoreInfo), + ), + body: ListView( + children: [ + ListTile( + title: Text('Licenses'), + leading: const Icon(Icons.copyright), + onTap: () => LicensesRoute().push(context), + ), + const DeleteProfileTile(), + ], + ), + ); + } +} diff --git a/lib/presentation/widgets/delete_profile_tile.dart b/lib/presentation/widgets/delete_profile_tile.dart index 506faa1..946fdc0 100644 --- a/lib/presentation/widgets/delete_profile_tile.dart +++ b/lib/presentation/widgets/delete_profile_tile.dart @@ -12,10 +12,17 @@ class DeleteProfileTile extends StatelessWidget { @override Widget build(BuildContext context) { final l10n = AppLocalizations.of(context)!; + final theme = Theme.of(context); return ListTile( title: Text(l10n.deleteProfile), leading: const Icon(Icons.delete), + // Show in red to indicate danger. + iconColor: theme.colorScheme.error, + splashColor: theme.colorScheme.error.withOpacity(0.2), + hoverColor: theme.colorScheme.error.withOpacity(0.1), + focusColor: theme.colorScheme.error.withOpacity(0.1), + textColor: theme.colorScheme.error, onTap: () => _confirmDelete(context), ); } diff --git a/pubspec.yaml b/pubspec.yaml index b098dda..909edb6 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -155,6 +155,7 @@ flutter: assets: - assets/images/ - assets/env/ + - assets/google_fonts/ - supabase/config/ # An image asset can refer to one or more resolution-specific "variants", see