Added google play and github buttons

This commit is contained in:
Juan Gilsanz Polo 2022-10-04 16:09:50 +02:00
parent 427b87ba55
commit 0a80bcbb90
10 changed files with 89 additions and 3 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View file

@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24" viewBox="0 0 24 24"><path d="M12,2A10,10 0 0,0 2,12C2,16.42 4.87,20.17 8.84,21.5C9.34,21.58 9.5,21.27 9.5,21C9.5,20.77 9.5,20.14 9.5,19.31C6.73,19.91 6.14,17.97 6.14,17.97C5.68,16.81 5.03,16.5 5.03,16.5C4.12,15.88 5.1,15.9 5.1,15.9C6.1,15.97 6.63,16.93 6.63,16.93C7.5,18.45 8.97,18 9.54,17.76C9.63,17.11 9.89,16.67 10.17,16.42C7.95,16.17 5.62,15.31 5.62,11.5C5.62,10.39 6,9.5 6.65,8.79C6.55,8.54 6.2,7.5 6.75,6.15C6.75,6.15 7.59,5.88 9.5,7.17C10.29,6.95 11.15,6.84 12,6.84C12.85,6.84 13.71,6.95 14.5,7.17C16.41,5.88 17.25,6.15 17.25,6.15C17.8,7.5 17.45,8.54 17.35,8.79C18,9.5 18.38,10.39 18.38,11.5C18.38,15.32 16.04,16.16 13.81,16.41C14.17,16.72 14.5,17.33 14.5,18.26C14.5,19.6 14.5,20.68 14.5,21C14.5,21.27 14.66,21.59 15.17,21.5C19.14,20.16 22,16.42 22,12A10,10 0 0,0 12,2Z" /></svg>

After

Width:  |  Height:  |  Size: 1 KiB

View file

@ -0,0 +1 @@
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="24" height="24" viewBox="0 0 24 24"><path d="M3,20.5V3.5C3,2.91 3.34,2.39 3.84,2.15L13.69,12L3.84,21.85C3.34,21.6 3,21.09 3,20.5M16.81,15.12L6.05,21.34L14.54,12.85L16.81,15.12M20.16,10.81C20.5,11.08 20.75,11.5 20.75,12C20.75,12.5 20.53,12.9 20.18,13.18L17.89,14.5L15.39,12L17.89,9.5L20.16,10.81M6.05,2.66L16.81,8.88L14.54,11.15L6.05,2.66Z" /></svg>

After

Width:  |  Height:  |  Size: 588 B

View file

@ -0,0 +1,3 @@
class Strings {
static const String createdBy = "JGeek00";
}

4
lib/constants/urls.dart Normal file
View file

@ -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";
}

View file

@ -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"
}

View file

@ -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"
}

View file

@ -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,
),
],
),
)
],
);
}

View file

@ -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:

View file

@ -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