diff --git a/assets/other/get_google_play.png b/assets/other/get_google_play.png new file mode 100644 index 0000000..c77b746 Binary files /dev/null and b/assets/other/get_google_play.png differ diff --git a/assets/resources/github.svg b/assets/resources/github.svg new file mode 100644 index 0000000..25d9004 --- /dev/null +++ b/assets/resources/github.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/assets/resources/google-play.svg b/assets/resources/google-play.svg new file mode 100644 index 0000000..eda3968 --- /dev/null +++ b/assets/resources/google-play.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/lib/constants/strings.dart b/lib/constants/strings.dart new file mode 100644 index 0000000..508ae04 --- /dev/null +++ b/lib/constants/strings.dart @@ -0,0 +1,3 @@ +class Strings { + static const String createdBy = "JGeek00"; +} \ No newline at end of file diff --git a/lib/constants/urls.dart b/lib/constants/urls.dart new file mode 100644 index 0000000..df19dde --- /dev/null +++ b/lib/constants/urls.dart @@ -0,0 +1,4 @@ +class Urls { + static const String playStore = "https://play.google.com/store/apps/details?id=com.jgeek00.adguard_home_manager"; + static const String gitHub = "https://github.com/JGeek00/adguard-home-manager"; +} \ No newline at end of file diff --git a/lib/l10n/app_en.arb b/lib/l10n/app_en.arb index 65ebdb9..063bd5b 100644 --- a/lib/l10n/app_en.arb +++ b/lib/l10n/app_en.arb @@ -167,5 +167,7 @@ "generalSettingsDescription": "Various different settings", "hideZeroValues": "Hide zero values", "hideZeroValuesDescription": "On homescreen, hide blocks with zero value", - "webAdminPanel": "Web admin. panel" + "webAdminPanel": "Web admin. panel", + "visitGooglePlay": "Visit Google Play page", + "gitHub": "App code available on GitHub" } \ No newline at end of file diff --git a/lib/l10n/app_es.arb b/lib/l10n/app_es.arb index c9aa975..d48d952 100644 --- a/lib/l10n/app_es.arb +++ b/lib/l10n/app_es.arb @@ -167,5 +167,7 @@ "generalSettingsDescription": "Varios ajustes generales", "hideZeroValues": "Oculta valores a cero", "hideZeroValuesDescription": "En la pantalla de inicio, oculta bloqueos con valor cero", - "webAdminPanel": "Panel de admin. web" + "webAdminPanel": "Panel de admin. web", + "visitGooglePlay": "Visita la página de Google Play", + "gitHub": "Código de la app disponible en GitHub" } \ No newline at end of file diff --git a/lib/screens/settings/settings.dart b/lib/screens/settings/settings.dart index 13cbd30..1d9a18f 100644 --- a/lib/screens/settings/settings.dart +++ b/lib/screens/settings/settings.dart @@ -1,5 +1,7 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import 'package:flutter_svg/flutter_svg.dart'; +import 'package:flutter_web_browser/flutter_web_browser.dart'; import 'package:flutter_gen/gen_l10n/app_localizations.dart'; import 'package:adguard_home_manager/screens/settings/theme_modal.dart'; @@ -9,6 +11,8 @@ import 'package:adguard_home_manager/screens/servers/servers.dart'; import 'package:adguard_home_manager/screens/settings/advanced_setings.dart'; import 'package:adguard_home_manager/screens/settings/general_settings.dart'; +import 'package:adguard_home_manager/constants/strings.dart'; +import 'package:adguard_home_manager/constants/urls.dart'; import 'package:adguard_home_manager/providers/servers_provider.dart'; import 'package:adguard_home_manager/providers/app_config_provider.dart'; @@ -58,6 +62,22 @@ class Settings extends StatelessWidget { })); } + void openWeb(String url) { + FlutterWebBrowser.openWebPage( + url: url, + customTabsOptions: const CustomTabsOptions( + instantAppsEnabled: true, + showTitle: true, + urlBarHidingEnabled: false, + ), + safariVCOptions: const SafariViewControllerOptions( + barCollapsingEnabled: true, + dismissButtonStyle: SafariViewControllerDismissButtonStyle.close, + modalPresentationCapturesStatusBarAppearance: true, + ) + ); + } + return ListView( children: [ SectionLabel(label: AppLocalizations.of(context)!.appSettings), @@ -108,8 +128,36 @@ class Settings extends StatelessWidget { ), CustomListTile( label: AppLocalizations.of(context)!.createdBy, - description: "JGeek00", + description: Strings.createdBy, ), + Padding( + padding: const EdgeInsets.all(15), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + IconButton( + onPressed: () => openWeb(Urls.playStore), + icon: SvgPicture.asset( + 'assets/resources/google-play.svg', + color: Theme.of(context).textTheme.bodyText2!.color, + width: 30, + height: 30, + ), + tooltip: AppLocalizations.of(context)!.visitGooglePlay, + ), + IconButton( + onPressed: () => openWeb(Urls.gitHub), + icon: SvgPicture.asset( + 'assets/resources/github.svg', + color: Theme.of(context).textTheme.bodyText2!.color, + width: 30, + height: 30, + ), + tooltip: AppLocalizations.of(context)!.gitHub, + ), + ], + ), + ) ], ); } diff --git a/pubspec.lock b/pubspec.lock index bfbce05..2477528 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -221,6 +221,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.2.10+1" + flutter_svg: + dependency: "direct main" + description: + name: flutter_svg + url: "https://pub.dartlang.org" + source: hosted + version: "1.1.5" flutter_test: dependency: "direct dev" description: flutter @@ -371,6 +378,20 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.8.2" + path_drawing: + dependency: transitive + description: + name: path_drawing + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" + path_parsing: + dependency: transitive + description: + name: path_parsing + url: "https://pub.dartlang.org" + source: hosted + version: "1.0.1" petitparser: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index 592c8fd..0bf174d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -46,6 +46,7 @@ dependencies: expandable: ^5.0.1 fl_chart: ^0.55.2 flutter_web_browser: ^0.17.1 + flutter_svg: ^1.1.5 dev_dependencies: flutter_test: @@ -95,6 +96,9 @@ flutter: - assets/icon/icon-android.png - assets/icon/icon-splash.png - assets/icon/icon1024-white-center.png + - assets/other/get_google_play.png + - assets/resources/github.svg + - assets/resources/google-play.svg # An image asset can refer to one or more resolution-specific "variants", see # https://flutter.dev/assets-and-images/#resolution-aware