Skip to content

Commit

Permalink
Fix dark theme style
Browse files Browse the repository at this point in the history
  • Loading branch information
wanghongenpin committed Feb 4, 2024
1 parent a8fd8ca commit 62e46b1
Show file tree
Hide file tree
Showing 17 changed files with 38 additions and 60 deletions.
2 changes: 1 addition & 1 deletion lib/network/components/request_block_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
4 changes: 2 additions & 2 deletions lib/ui/desktop/desktop.dart
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ class _DesktopHomePagePageState extends State<DesktopHomePage> 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'
Expand All @@ -217,7 +217,7 @@ class _DesktopHomePagePageState extends State<DesktopHomePage> 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)));
});
}
Expand Down
3 changes: 2 additions & 1 deletion lib/ui/desktop/left/request_editor.dart
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,8 @@ class KeyValState extends State<KeyValWidget> 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")));
}
Expand Down
4 changes: 1 addition & 3 deletions lib/ui/desktop/toolbar/setting/filter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,7 @@ class _DomainListState extends State<DomainList> {
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(
Expand Down
1 change: 1 addition & 0 deletions lib/ui/desktop/toolbar/setting/request_block.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
7 changes: 2 additions & 5 deletions lib/ui/desktop/toolbar/setting/request_rewrite.dart
Original file line number Diff line number Diff line change
Expand Up @@ -218,10 +218,7 @@ class _RequestRuleListState extends State<RequestRuleList> {
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(
Expand Down Expand Up @@ -637,6 +634,6 @@ class _RuleAddDialogState extends State<RuleAddDialog> {
}

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));
}
}
4 changes: 2 additions & 2 deletions lib/ui/desktop/toolbar/setting/rewrite/rewrite_replace.dart
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ class _RewriteReplaceState extends State<RewriteReplaceDialog> {
: 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(
Expand Down Expand Up @@ -389,7 +389,7 @@ class _RewriteReplaceState extends State<RewriteReplaceDialog> {
}

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));
}
}

Expand Down
9 changes: 3 additions & 6 deletions lib/ui/desktop/toolbar/setting/rewrite/rewrite_update.dart
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ class _RewriteUpdateAddState extends State<RewriteUpdateAddDialog> {
}

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));
}
}

Expand Down Expand Up @@ -231,10 +231,7 @@ class _UpdateListState extends State<UpdateList> {
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(
Expand All @@ -254,7 +251,7 @@ class _UpdateListState extends State<UpdateList> {
int selected = -1;

List<Widget> rows(List<RewriteItem> 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) {
Expand Down
8 changes: 3 additions & 5 deletions lib/ui/desktop/toolbar/setting/script.dart
Original file line number Diff line number Diff line change
Expand Up @@ -137,9 +137,7 @@ class _ScriptWidgetState extends State<ScriptWidget> {
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(
Expand Down Expand Up @@ -317,7 +315,7 @@ class _ScriptEditState extends State<ScriptEdit> {
}

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));
}
}

Expand All @@ -343,7 +341,7 @@ class _ScriptListState extends State<ScriptList> {
}

List<Widget> rows(List<ScriptItem> list) {
var primaryColor = Theme.of(context).primaryColor;
var primaryColor = Theme.of(context).colorScheme.primary;

return List.generate(list.length, (index) {
return InkWell(
Expand Down
4 changes: 2 additions & 2 deletions lib/ui/mobile/mobile.dart
Original file line number Diff line number Diff line change
Expand Up @@ -231,15 +231,15 @@ class MobileHomeState extends State<MobileHomePage> 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'
'3. Add current view export;\n'
'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();
Expand Down
5 changes: 1 addition & 4 deletions lib/ui/mobile/setting/filter.dart
Original file line number Diff line number Diff line change
Expand Up @@ -255,10 +255,7 @@ class _DomainListState extends State<DomainList> {
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,
Expand Down
1 change: 1 addition & 0 deletions lib/ui/mobile/setting/request_block.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
10 changes: 2 additions & 8 deletions lib/ui/mobile/setting/request_rewrite.dart
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,7 @@ class _RequestRuleListState extends State<RequestRuleList> {
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: [
Expand All @@ -185,10 +182,7 @@ class _RequestRuleListState extends State<RequestRuleList> {
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,
Expand Down
5 changes: 3 additions & 2 deletions lib/ui/mobile/setting/rewrite/rewrite_replace.dart
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@ class _RewriteReplaceState extends State<RewriteReplaceWidget> {
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 ?? ''))
]);
}
Expand Down Expand Up @@ -378,7 +379,7 @@ class _RewriteReplaceState extends State<RewriteReplaceWidget> {
}

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));
}
}

Expand Down
9 changes: 3 additions & 6 deletions lib/ui/mobile/setting/rewrite/rewrite_update.dart
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ class _RewriteUpdateAddState extends State<RewriteUpdateAddDialog> {
}

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));
}
}

Expand Down Expand Up @@ -231,10 +231,7 @@ class _UpdateListState extends State<UpdateList> {
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(
Expand All @@ -254,7 +251,7 @@ class _UpdateListState extends State<UpdateList> {
int selected = -1;

List<Widget> rows(List<RewriteItem> list) {
var primaryColor = Theme.of(context).primaryColor;
var primaryColor = Theme.of(context).colorScheme.primary;

return List.generate(list.length, (index) {
return InkWell(
Expand Down
9 changes: 3 additions & 6 deletions lib/ui/mobile/setting/script.dart
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,7 @@ class _MobileScriptState extends State<MobileScript> {
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(
Expand Down Expand Up @@ -264,7 +261,7 @@ class _ScriptEditState extends State<ScriptEdit> {
}

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));
}
}

Expand All @@ -289,7 +286,7 @@ class _ScriptListState extends State<ScriptList> {
}

List<Widget> rows(List<ScriptItem> list) {
var primaryColor = Theme.of(context).primaryColor;
var primaryColor = Theme.of(context).colorScheme.primary;

return List.generate(list.length, (index) {
return InkWell(
Expand Down
13 changes: 6 additions & 7 deletions test/tests.dart
Original file line number Diff line number Diff line change
@@ -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(": "));
Expand All @@ -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);
}

0 comments on commit 62e46b1

Please sign in to comment.