diff --git a/lib/network/components/request_block_manager.dart b/lib/network/components/request_block_manager.dart index 0d03c25..f75f611 100644 --- a/lib/network/components/request_block_manager.dart +++ b/lib/network/components/request_block_manager.dart @@ -99,7 +99,7 @@ class RequestBlockItem { //匹配url bool match(String url, BlockType blockType) { - urlReg ??= RegExp(this.url.replaceAll("*", ".*")); + urlReg ??= RegExp('^${this.url.replaceAll("*", ".*")}'); return enabled && type == blockType && urlReg!.hasMatch(url); } diff --git a/lib/ui/desktop/desktop.dart b/lib/ui/desktop/desktop.dart index 6f8611f..ea4a4eb 100644 --- a/lib/ui/desktop/desktop.dart +++ b/lib/ui/desktop/desktop.dart @@ -207,7 +207,7 @@ class _DesktopHomePagePageState extends State implements EventL '5. 支持高亮请求;\n' '6. Android返回键进入小窗口;\n' '7. Android白名单应用列表展示隐藏图标应用;\n' - '8. 修复websocket暗黑主题展示不清楚;\n' + '8. 修复暗黑主题样式;\n' : 'Tips:By default, HTTPS packet capture will not be enabled. Please install the certificate before enabling HTTPS packet capture。\n' 'Click HTTPS Capture packets(Lock icon),Choose to install the root certificate and follow the prompts to proceed。\n\n' '1. History support auto cache time setting;\n' @@ -217,7 +217,7 @@ class _DesktopHomePagePageState extends State implements EventL '5. Support highlighting requests;\n' '6. Android Return key to enter the small window;\n' '7. Android Whitelist application list display hidden icon applications;\n' - '8. Fix websocket dark theme display unclear;\n', + '8. Fix dark theme style;\n', style: const TextStyle(fontSize: 14))); }); } diff --git a/lib/ui/desktop/left/request_editor.dart b/lib/ui/desktop/left/request_editor.dart index 1dc1e8a..c081ab4 100644 --- a/lib/ui/desktop/left/request_editor.dart +++ b/lib/ui/desktop/left/request_editor.dart @@ -588,7 +588,8 @@ class KeyValState extends State with AutomaticKeepAliveClientMixin contentPadding: const EdgeInsets.fromLTRB(5, 13, 5, 13), focusedBorder: widget.readOnly ? null - : OutlineInputBorder(borderSide: BorderSide(color: Theme.of(context).primaryColor, width: 1.5)), + : OutlineInputBorder( + borderSide: BorderSide(color: Theme.of(context).colorScheme.primary, width: 1.5)), border: InputBorder.none, hintText: isKey ? "Key" : "Value"))); } diff --git a/lib/ui/desktop/toolbar/setting/filter.dart b/lib/ui/desktop/toolbar/setting/filter.dart index ff613f8..265a7d5 100644 --- a/lib/ui/desktop/toolbar/setting/filter.dart +++ b/lib/ui/desktop/toolbar/setting/filter.dart @@ -279,9 +279,7 @@ class _DomainListState extends State { child: Container( padding: const EdgeInsets.only(top: 10), height: 380, - decoration: BoxDecoration( - border: Border.all(color: Colors.grey.withOpacity(0.2)), - ), + decoration: BoxDecoration(border: Border.all(color: Colors.grey.withOpacity(0.2))), child: SingleChildScrollView( child: Column(children: [ Row( diff --git a/lib/ui/desktop/toolbar/setting/request_block.dart b/lib/ui/desktop/toolbar/setting/request_block.dart index 3bc27e4..3f19f3f 100644 --- a/lib/ui/desktop/toolbar/setting/request_block.dart +++ b/lib/ui/desktop/toolbar/setting/request_block.dart @@ -215,6 +215,7 @@ class RequestBlockAddDialog extends StatelessWidget { (formKey.currentState as FormState).save(); item.enabled = enabled; + item.urlReg = null; if (index != null) { requestBlockManager.list[index!] = item; } else { diff --git a/lib/ui/desktop/toolbar/setting/request_rewrite.dart b/lib/ui/desktop/toolbar/setting/request_rewrite.dart index 0f4f581..40a3944 100644 --- a/lib/ui/desktop/toolbar/setting/request_rewrite.dart +++ b/lib/ui/desktop/toolbar/setting/request_rewrite.dart @@ -218,10 +218,7 @@ class _RequestRuleListState extends State { padding: const EdgeInsets.only(top: 10), height: 500, // constraints: const BoxConstraints(maxHeight: 500, minHeight: 350), - decoration: BoxDecoration( - border: Border.all(color: Colors.grey.withOpacity(0.2)), - color: Colors.white, - backgroundBlendMode: BlendMode.colorBurn), + decoration: BoxDecoration(border: Border.all(color: Colors.grey.withOpacity(0.2))), child: SingleChildScrollView( child: Column(children: [ Row( @@ -637,6 +634,6 @@ class _RuleAddDialogState extends State { } InputBorder focusedBorder() { - return OutlineInputBorder(borderSide: BorderSide(color: Theme.of(context).primaryColor, width: 2)); + return OutlineInputBorder(borderSide: BorderSide(color: Theme.of(context).colorScheme.primary, width: 2)); } } diff --git a/lib/ui/desktop/toolbar/setting/rewrite/rewrite_replace.dart b/lib/ui/desktop/toolbar/setting/rewrite/rewrite_replace.dart index 4bdfbf4..a4d0f9d 100644 --- a/lib/ui/desktop/toolbar/setting/rewrite/rewrite_replace.dart +++ b/lib/ui/desktop/toolbar/setting/rewrite/rewrite_replace.dart @@ -204,7 +204,7 @@ class _RewriteReplaceState extends State { : Container( padding: const EdgeInsets.all(5), foregroundDecoration: - BoxDecoration(border: Border.all(color: Theme.of(context).primaryColor, width: 1)), + BoxDecoration(border: Border.all(color: Theme.of(context).colorScheme.primary, width: 1)), child: Text(item.bodyFile ?? ''))), const SizedBox(width: 10), FilledButton( @@ -389,7 +389,7 @@ class _RewriteReplaceState extends State { } InputBorder focusedBorder() { - return OutlineInputBorder(borderSide: BorderSide(color: Theme.of(context).primaryColor, width: 2)); + return OutlineInputBorder(borderSide: BorderSide(color: Theme.of(context).colorScheme.primary, width: 2)); } } diff --git a/lib/ui/desktop/toolbar/setting/rewrite/rewrite_update.dart b/lib/ui/desktop/toolbar/setting/rewrite/rewrite_update.dart index c8e3ddb..8632672 100644 --- a/lib/ui/desktop/toolbar/setting/rewrite/rewrite_update.dart +++ b/lib/ui/desktop/toolbar/setting/rewrite/rewrite_update.dart @@ -203,7 +203,7 @@ class _RewriteUpdateAddState extends State { } InputBorder focusedBorder() { - return OutlineInputBorder(borderSide: BorderSide(color: Theme.of(context).primaryColor, width: 2)); + return OutlineInputBorder(borderSide: BorderSide(color: Theme.of(context).colorScheme.primary, width: 2)); } } @@ -231,10 +231,7 @@ class _UpdateListState extends State { padding: const EdgeInsets.only(top: 10), height: 320, width: 550, - decoration: BoxDecoration( - border: Border.all(color: Colors.grey.withOpacity(0.2)), - color: Colors.white, - backgroundBlendMode: BlendMode.colorBurn), + decoration: BoxDecoration(border: Border.all(color: Colors.grey.withOpacity(0.2))), child: SingleChildScrollView( child: Column(children: [ Row( @@ -254,7 +251,7 @@ class _UpdateListState extends State { int selected = -1; List rows(List list) { - var primaryColor = Theme.of(context).primaryColor; + var primaryColor = Theme.of(context).colorScheme.primary; bool isCN = Localizations.localeOf(context) == const Locale.fromSubtags(languageCode: 'zh'); return List.generate(list.length, (index) { diff --git a/lib/ui/desktop/toolbar/setting/script.dart b/lib/ui/desktop/toolbar/setting/script.dart index ef6e1cd..5844a93 100644 --- a/lib/ui/desktop/toolbar/setting/script.dart +++ b/lib/ui/desktop/toolbar/setting/script.dart @@ -137,9 +137,7 @@ class _ScriptWidgetState extends State { padding: const EdgeInsets.only(top: 10), constraints: const BoxConstraints(maxHeight: 500, minHeight: 300), decoration: BoxDecoration( - border: Border.all(color: Colors.grey.withOpacity(0.2)), - color: Colors.white, - backgroundBlendMode: BlendMode.colorBurn), + border: Border.all(color: Colors.grey.withOpacity(0.2))), child: SingleChildScrollView( child: Column(children: [ Row( @@ -317,7 +315,7 @@ class _ScriptEditState extends State { } InputBorder focusedBorder() { - return OutlineInputBorder(borderSide: BorderSide(color: Theme.of(context).primaryColor, width: 2)); + return OutlineInputBorder(borderSide: BorderSide(color: Theme.of(context).colorScheme.primary, width: 2)); } } @@ -343,7 +341,7 @@ class _ScriptListState extends State { } List rows(List list) { - var primaryColor = Theme.of(context).primaryColor; + var primaryColor = Theme.of(context).colorScheme.primary; return List.generate(list.length, (index) { return InkWell( diff --git a/lib/ui/mobile/mobile.dart b/lib/ui/mobile/mobile.dart index 3f8cc99..9533bf2 100644 --- a/lib/ui/mobile/mobile.dart +++ b/lib/ui/mobile/mobile.dart @@ -231,7 +231,7 @@ class MobileHomeState extends State implements EventListener, Li '4. 增加屏蔽请求功能;\n' '5. Android返回键进入小窗口;\n' '6. Android白名单应用列表展示隐藏图标应用;\n' - '7. 修复websocket暗黑主题展示不清楚;\n' + '7. 修复暗黑主题样式;\n' : 'Tips:By default, HTTPS packet capture will not be enabled. Please install the certificate before enabling HTTPS packet capture。\n\n' '1. History support auto cache time setting;\n' '2. History Add Search;\n' @@ -239,7 +239,7 @@ class MobileHomeState extends State implements EventListener, Li '4. Support blocking request;\n' '5. Android Return key to enter the small window;\n' '6. Android Whitelist application list display hidden icon applications;\n' - '7. Fix websocket dark theme display unclear;\n'; + '7. Fix dark theme style;\n'; showAlertDialog(isCN ? '更新内容V1.0.8' : "Update content V1.0.8", content, () { widget.appConfiguration.upgradeNoticeV8 = false; widget.appConfiguration.flushConfig(); diff --git a/lib/ui/mobile/setting/filter.dart b/lib/ui/mobile/setting/filter.dart index 745847b..d0b64ce 100644 --- a/lib/ui/mobile/setting/filter.dart +++ b/lib/ui/mobile/setting/filter.dart @@ -255,10 +255,7 @@ class _DomainListState extends State { height: 50, width: double.infinity, margin: const EdgeInsets.only(top: 10), - decoration: BoxDecoration( - border: Border.all(color: Colors.grey.withOpacity(0.2)), - color: Colors.white, - backgroundBlendMode: BlendMode.colorBurn)), + decoration: BoxDecoration(border: Border.all(color: Colors.grey.withOpacity(0.2)))), Positioned( top: 0, left: 0, diff --git a/lib/ui/mobile/setting/request_block.dart b/lib/ui/mobile/setting/request_block.dart index 240ecbe..c1ee671 100644 --- a/lib/ui/mobile/setting/request_block.dart +++ b/lib/ui/mobile/setting/request_block.dart @@ -215,6 +215,7 @@ class RequestBlockAddDialog extends StatelessWidget { (formKey.currentState as FormState).save(); item.enabled = enabled; + item.urlReg = null; if (index != null) { requestBlockManager.list[index!] = item; } else { diff --git a/lib/ui/mobile/setting/request_rewrite.dart b/lib/ui/mobile/setting/request_rewrite.dart index 28e2735..e89ce01 100644 --- a/lib/ui/mobile/setting/request_rewrite.dart +++ b/lib/ui/mobile/setting/request_rewrite.dart @@ -156,10 +156,7 @@ class _RequestRuleListState extends State { persistentFooterButtons: [multiple ? globalMenu() : const SizedBox()], body: Container( padding: const EdgeInsets.only(top: 10, bottom: 30), - decoration: BoxDecoration( - border: Border.all(color: Colors.grey.withOpacity(0.2)), - color: Colors.white, - backgroundBlendMode: BlendMode.colorBurn), + decoration: BoxDecoration(border: Border.all(color: Colors.grey.withOpacity(0.2))), child: Scrollbar( child: ListView( children: [ @@ -185,10 +182,7 @@ class _RequestRuleListState extends State { height: 50, width: double.infinity, margin: const EdgeInsets.only(top: 10), - decoration: BoxDecoration( - border: Border.all(color: Colors.grey.withOpacity(0.2)), - color: Colors.white, - backgroundBlendMode: BlendMode.colorBurn)), + decoration: BoxDecoration(border: Border.all(color: Colors.grey.withOpacity(0.2)))), Positioned( top: 0, left: 0, diff --git a/lib/ui/mobile/setting/rewrite/rewrite_replace.dart b/lib/ui/mobile/setting/rewrite/rewrite_replace.dart index df86dd3..6200c44 100644 --- a/lib/ui/mobile/setting/rewrite/rewrite_replace.dart +++ b/lib/ui/mobile/setting/rewrite/rewrite_replace.dart @@ -214,7 +214,8 @@ class _RewriteReplaceState extends State { if (item.bodyFile != null) Container( padding: const EdgeInsets.all(8), - foregroundDecoration: BoxDecoration(border: Border.all(color: Theme.of(context).primaryColor, width: 1)), + foregroundDecoration: + BoxDecoration(border: Border.all(color: Theme.of(context).colorScheme.primary, width: 1)), child: Text(item.bodyFile ?? '')) ]); } @@ -378,7 +379,7 @@ class _RewriteReplaceState extends State { } InputBorder focusedBorder() { - return OutlineInputBorder(borderSide: BorderSide(color: Theme.of(context).primaryColor, width: 2)); + return OutlineInputBorder(borderSide: BorderSide(color: Theme.of(context).colorScheme.primary, width: 2)); } } diff --git a/lib/ui/mobile/setting/rewrite/rewrite_update.dart b/lib/ui/mobile/setting/rewrite/rewrite_update.dart index cdaba23..f88c2f9 100644 --- a/lib/ui/mobile/setting/rewrite/rewrite_update.dart +++ b/lib/ui/mobile/setting/rewrite/rewrite_update.dart @@ -203,7 +203,7 @@ class _RewriteUpdateAddState extends State { } InputBorder focusedBorder() { - return OutlineInputBorder(borderSide: BorderSide(color: Theme.of(context).primaryColor, width: 2)); + return OutlineInputBorder(borderSide: BorderSide(color: Theme.of(context).colorScheme.primary, width: 2)); } } @@ -231,10 +231,7 @@ class _UpdateListState extends State { padding: const EdgeInsets.only(top: 10), height: 320, width: 550, - decoration: BoxDecoration( - border: Border.all(color: Colors.grey.withOpacity(0.2)), - color: Colors.white, - backgroundBlendMode: BlendMode.colorBurn), + decoration: BoxDecoration(border: Border.all(color: Colors.grey.withOpacity(0.2))), child: SingleChildScrollView( child: Column(children: [ Row( @@ -254,7 +251,7 @@ class _UpdateListState extends State { int selected = -1; List rows(List list) { - var primaryColor = Theme.of(context).primaryColor; + var primaryColor = Theme.of(context).colorScheme.primary; return List.generate(list.length, (index) { return InkWell( diff --git a/lib/ui/mobile/setting/script.dart b/lib/ui/mobile/setting/script.dart index f9ab63e..d54e925 100644 --- a/lib/ui/mobile/setting/script.dart +++ b/lib/ui/mobile/setting/script.dart @@ -90,10 +90,7 @@ class _MobileScriptState extends State { Container( padding: const EdgeInsets.only(top: 10), constraints: const BoxConstraints(maxHeight: 500, minHeight: 300), - decoration: BoxDecoration( - border: Border.all(color: Colors.grey.withOpacity(0.2)), - color: Colors.white, - backgroundBlendMode: BlendMode.colorBurn), + decoration: BoxDecoration(border: Border.all(color: Colors.grey.withOpacity(0.2))), child: SingleChildScrollView( child: Column(children: [ Row( @@ -264,7 +261,7 @@ class _ScriptEditState extends State { } InputBorder focusedBorder() { - return OutlineInputBorder(borderSide: BorderSide(color: Theme.of(context).primaryColor, width: 2)); + return OutlineInputBorder(borderSide: BorderSide(color: Theme.of(context).colorScheme.primary, width: 2)); } } @@ -289,7 +286,7 @@ class _ScriptListState extends State { } List rows(List list) { - var primaryColor = Theme.of(context).primaryColor; + var primaryColor = Theme.of(context).colorScheme.primary; return List.generate(list.length, (index) { return InkWell( diff --git a/test/tests.dart b/test/tests.dart index 4238319..be10eeb 100644 --- a/test/tests.dart +++ b/test/tests.dart @@ -1,7 +1,6 @@ -import 'dart:io'; void main() async { - // print(RegExp('http://dddd/hello\$').hasMatch("http://dddd/hello/world")); + print(RegExp('^www.baidu.com').hasMatch("https://www.baidu.com/wqeqweqe")); String text = "http://dddd/hello/world?name=dad&val=12a"; print("mame=\$1123".replaceAll(RegExp('\\\$\\d'), "123")); print("app: ddd".split(": ")); @@ -11,9 +10,9 @@ void main() async { print(replaceAll); return replaceAll; })); - print(Platform.version); - print(Platform.localHostname); - print(Platform.operatingSystem); - print(Platform.localeName); - print(Platform.script); + // print(Platform.version); + // print(Platform.localHostname); + // print(Platform.operatingSystem); + // print(Platform.localeName); + // print(Platform.script); }