From d2d531516aa2bd5813a8518472f55dc5bf90a017 Mon Sep 17 00:00:00 2001 From: csf Date: Fri, 23 Sep 2022 17:16:25 +0800 Subject: [PATCH] opt mobile dark theme --- flutter/lib/common.dart | 2 +- flutter/lib/common/widgets/peer_tab_page.dart | 8 +++---- flutter/lib/mobile/pages/connection_page.dart | 4 ++-- flutter/lib/mobile/pages/server_page.dart | 21 +++++++++++-------- 4 files changed, 19 insertions(+), 16 deletions(-) diff --git a/flutter/lib/common.dart b/flutter/lib/common.dart index 170ac597b..dcdc191ff 100644 --- a/flutter/lib/common.dart +++ b/flutter/lib/common.dart @@ -160,7 +160,7 @@ class MyTheme { textTheme: const TextTheme( titleLarge: TextStyle(fontSize: 19), bodySmall: TextStyle(fontSize: 12, height: 1.25)), - hintColor: Color(0xFF555555), + cardColor: Color(0xFF252525), primarySwatch: Colors.blue, visualDensity: VisualDensity.adaptivePlatformDensity, tabBarTheme: const TabBarTheme( diff --git a/flutter/lib/common/widgets/peer_tab_page.dart b/flutter/lib/common/widgets/peer_tab_page.dart index 089e6acb5..835849ae4 100644 --- a/flutter/lib/common/widgets/peer_tab_page.dart +++ b/flutter/lib/common/widgets/peer_tab_page.dart @@ -201,9 +201,9 @@ class _PeerSearchBarState extends State { drawer = true; }); }, - icon: const Icon( + icon: Icon( Icons.search_rounded, - color: MyTheme.dark, + color: Theme.of(context).hintColor, )); } @@ -267,9 +267,9 @@ class _PeerSearchBarState extends State { drawer = false; }); }, - icon: const Icon( + icon: Icon( Icons.close, - color: MyTheme.dark, + color: Theme.of(context).hintColor, )), ], ), diff --git a/flutter/lib/mobile/pages/connection_page.dart b/flutter/lib/mobile/pages/connection_page.dart index 6156223b5..af84a8a47 100644 --- a/flutter/lib/mobile/pages/connection_page.dart +++ b/flutter/lib/mobile/pages/connection_page.dart @@ -128,8 +128,8 @@ class _ConnectionPageState extends State { child: Padding( padding: const EdgeInsets.symmetric(vertical: 8, horizontal: 2), child: Ink( - decoration: const BoxDecoration( - color: MyTheme.white, + decoration: BoxDecoration( + color: Theme.of(context).cardColor, borderRadius: BorderRadius.all(Radius.circular(13)), ), child: Row( diff --git a/flutter/lib/mobile/pages/server_page.dart b/flutter/lib/mobile/pages/server_page.dart index 4fdd00ede..bed043b25 100644 --- a/flutter/lib/mobile/pages/server_page.dart +++ b/flutter/lib/mobile/pages/server_page.dart @@ -170,7 +170,7 @@ class ServerInfo extends StatelessWidget { icon: const Icon(Icons.perm_identity), labelText: translate("ID"), labelStyle: const TextStyle( - fontWeight: FontWeight.bold, color: MyTheme.accent50), + fontWeight: FontWeight.bold, color: MyTheme.accent80), ), onSaved: (String? value) {}, ), @@ -185,7 +185,7 @@ class ServerInfo extends StatelessWidget { icon: const Icon(Icons.lock), labelText: translate("Password"), labelStyle: const TextStyle( - fontWeight: FontWeight.bold, color: MyTheme.accent50), + fontWeight: FontWeight.bold, color: MyTheme.accent80), suffix: isPermanent ? null : IconButton( @@ -213,7 +213,7 @@ class ServerInfo extends StatelessWidget { fontFamily: 'WorkSans', fontWeight: FontWeight.bold, fontSize: 18, - color: MyTheme.accent80, + color: MyTheme.accent, ), )) ], @@ -304,7 +304,8 @@ class _PermissionCheckerState extends State { softWrap: true, style: const TextStyle( fontSize: 14.0, - color: MyTheme.accent50))) + fontWeight: FontWeight.w500, + color: MyTheme.accent80))) ], ) : const SizedBox.shrink()) @@ -334,7 +335,9 @@ class PermissionRow extends StatelessWidget { alignment: Alignment.centerLeft, child: Text(name, style: const TextStyle( - fontSize: 16.0, color: MyTheme.accent50)))), + fontSize: 16.0, + fontWeight: FontWeight.bold, + color: MyTheme.accent80)))), Expanded( flex: 2, child: FittedBox( @@ -398,7 +401,7 @@ class ConnectionManager extends StatelessWidget { }, icon: const Icon( Icons.chat, - color: MyTheme.accent80, + color: MyTheme.accent, ))) ], ), @@ -460,8 +463,8 @@ class PaddingCard extends StatelessWidget { titleIcon != null ? Padding( padding: const EdgeInsets.only(right: 10), - child: Icon(titleIcon, - color: MyTheme.accent80, size: 30)) + child: + Icon(titleIcon, color: MyTheme.accent, size: 30)) : const SizedBox.shrink(), Text( title!, @@ -469,7 +472,7 @@ class PaddingCard extends StatelessWidget { fontFamily: 'WorkSans', fontWeight: FontWeight.bold, fontSize: 20, - color: MyTheme.accent80, + color: MyTheme.accent, ), ) ],