mirror of
https://github.com/JGeek00/adguard-home-manager.git
synced 2025-04-20 22:09:11 +00:00
Added open url custom rules
This commit is contained in:
parent
7ccf4127c2
commit
e4986c0bd9
2 changed files with 21 additions and 1 deletions
|
@ -1,4 +1,5 @@
|
|||
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";
|
||||
static const String customRuleDocs = "https://github.com/AdguardTeam/AdGuardHome/wiki/Hosts-Blocklists";
|
||||
}
|
|
@ -1,8 +1,11 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_gen/gen_l10n/app_localizations.dart';
|
||||
import 'package:flutter_web_browser/flutter_web_browser.dart';
|
||||
|
||||
import 'package:adguard_home_manager/widgets/custom_radio_toggle.dart';
|
||||
|
||||
import 'package:adguard_home_manager/constants/urls.dart';
|
||||
|
||||
class AddCustomRule extends StatefulWidget {
|
||||
final ScrollController scrollController;
|
||||
final void Function(String) onConfirm;
|
||||
|
@ -65,6 +68,22 @@ class _AddCustomRuleState extends State<AddCustomRule> {
|
|||
|
||||
return rule;
|
||||
}
|
||||
|
||||
void openDocsPage() {
|
||||
FlutterWebBrowser.openWebPage(
|
||||
url: Urls.customRuleDocs,
|
||||
customTabsOptions: const CustomTabsOptions(
|
||||
instantAppsEnabled: true,
|
||||
showTitle: true,
|
||||
urlBarHidingEnabled: false,
|
||||
),
|
||||
safariVCOptions: const SafariViewControllerOptions(
|
||||
barCollapsingEnabled: true,
|
||||
dismissButtonStyle: SafariViewControllerDismissButtonStyle.close,
|
||||
modalPresentationCapturesStatusBarAppearance: true,
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
@ -316,7 +335,7 @@ class _AddCustomRuleState extends State<AddCustomRule> {
|
|||
Material(
|
||||
color: Colors.transparent,
|
||||
child: InkWell(
|
||||
onTap: () => {},
|
||||
onTap: openDocsPage,
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 28, vertical: 10),
|
||||
child: Row(
|
||||
|
|
Loading…
Add table
Reference in a new issue