From 760ab519198e28cb8e50eef301f092f151bf998e Mon Sep 17 00:00:00 2001 From: 21pages Date: Sun, 4 Sep 2022 16:26:08 +0800 Subject: [PATCH] dark theme adjustment Signed-off-by: 21pages --- flutter/lib/desktop/widgets/popup_menu.dart | 25 +++++++++++---------- flutter/lib/mobile/pages/chat_page.dart | 11 +++++++-- 2 files changed, 22 insertions(+), 14 deletions(-) diff --git a/flutter/lib/desktop/widgets/popup_menu.dart b/flutter/lib/desktop/widgets/popup_menu.dart index 45e52cf81..ea678673a 100644 --- a/flutter/lib/desktop/widgets/popup_menu.dart +++ b/flutter/lib/desktop/widgets/popup_menu.dart @@ -1,6 +1,7 @@ import 'dart:core'; import 'package:flutter/material.dart'; +import 'package:flutter_hbb/common.dart'; import 'package:get/get.dart'; import './material_mod_popup_menu.dart' as mod_menu; @@ -174,8 +175,8 @@ class MenuEntryRadios extends MenuEntryBase { children: [ Text( opt.text, - style: const TextStyle( - color: Colors.black, + style: TextStyle( + color: MyTheme.color(context).text, fontSize: MenuConfig.fontSize, fontWeight: FontWeight.normal), ), @@ -256,8 +257,8 @@ class MenuEntrySubRadios extends MenuEntryBase { children: [ Text( opt.text, - style: const TextStyle( - color: Colors.black, + style: TextStyle( + color: MyTheme.color(context).text, fontSize: MenuConfig.fontSize, fontWeight: FontWeight.normal), ), @@ -300,8 +301,8 @@ class MenuEntrySubRadios extends MenuEntryBase { const SizedBox(width: MenuConfig.midPadding), Text( text, - style: const TextStyle( - color: Colors.black, + style: TextStyle( + color: MyTheme.color(context).text, fontSize: MenuConfig.fontSize, fontWeight: FontWeight.normal), ), @@ -346,8 +347,8 @@ abstract class MenuEntrySwitchBase extends MenuEntryBase { // const SizedBox(width: MenuConfig.midPadding), Text( text, - style: const TextStyle( - color: Colors.black, + style: TextStyle( + color: MyTheme.color(context).text, fontSize: MenuConfig.fontSize, fontWeight: FontWeight.normal), ), @@ -450,8 +451,8 @@ class MenuEntrySubMenu extends MenuEntryBase { const SizedBox(width: MenuConfig.midPadding), Text( text, - style: const TextStyle( - color: Colors.black, + style: TextStyle( + color: MyTheme.color(context).text, fontSize: MenuConfig.fontSize, fontWeight: FontWeight.normal), ), @@ -491,8 +492,8 @@ class MenuEntryButton extends MenuEntryBase { alignment: AlignmentDirectional.centerStart, constraints: BoxConstraints(minHeight: conf.height), child: childBuilder( - const TextStyle( - color: Colors.black, + TextStyle( + color: MyTheme.color(context).text, fontSize: MenuConfig.fontSize, fontWeight: FontWeight.normal), )), diff --git a/flutter/lib/mobile/pages/chat_page.dart b/flutter/lib/mobile/pages/chat_page.dart index b265f6995..2151f17be 100644 --- a/flutter/lib/mobile/pages/chat_page.dart +++ b/flutter/lib/mobile/pages/chat_page.dart @@ -45,7 +45,7 @@ class ChatPage extends StatelessWidget implements PageShape { return ChangeNotifierProvider.value( value: chatModel, child: Container( - color: MyTheme.grayBg, + color: MyTheme.color(context).grayBg, child: Consumer(builder: (context, chatModel, child) { final currentUser = chatModel.currentUser; return Stack( @@ -59,7 +59,14 @@ class ChatPage extends StatelessWidget implements PageShape { messages: chatModel .messages[chatModel.currentID]?.chatMessages ?? [], - inputOptions: const InputOptions(sendOnEnter: true), + inputOptions: InputOptions( + sendOnEnter: true, + inputDecoration: defaultInputDecoration( + fillColor: MyTheme.color(context).bg), + sendButtonBuilder: defaultSendButton( + color: MyTheme.color(context).text!), + inputTextStyle: + TextStyle(color: MyTheme.color(context).text)), messageOptions: MessageOptions( showOtherUsersAvatar: false, showTime: true,