From 390b4cca1e3d240ca73f6ff4efb8b5b51f352b8b Mon Sep 17 00:00:00 2001 From: Tommy Chow Date: Wed, 29 Jun 2022 19:30:24 -0400 Subject: [PATCH] Add new input theme/style (#90) --- lib/main.dart | 20 +++++++++++++++++++ lib/screens/channel/chat/chat.dart | 6 +++++- .../channel/chat/widgets/chat_bottom_bar.dart | 7 ++----- lib/screens/home/search/search.dart | 11 ++++------ 4 files changed, 31 insertions(+), 13 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 084a1491..56fa846e 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -78,6 +78,23 @@ final navigatorKey = GlobalKey(); const gray = Color.fromRGBO(22, 22, 22, 1.0); const purple = Color(0xff9146ff); +const inputTheme = InputDecorationTheme( + filled: true, + contentPadding: EdgeInsets.all(10.0), + border: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(30.0)), + borderSide: BorderSide(style: BorderStyle.none), + ), + enabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(30.0)), + borderSide: BorderSide(style: BorderStyle.none), + ), + disabledBorder: OutlineInputBorder( + borderRadius: BorderRadius.all(Radius.circular(30.0)), + borderSide: BorderSide(style: BorderStyle.none), + ), +); + final lightTheme = ThemeData( canvasColor: Colors.white, splashFactory: Platform.isIOS ? NoSplash.splashFactory : null, @@ -102,6 +119,7 @@ final lightTheme = ThemeData( labelColor: Colors.black, unselectedLabelColor: Colors.grey, ), + inputDecorationTheme: inputTheme, ); final darkTheme = ThemeData( @@ -126,6 +144,7 @@ final darkTheme = ThemeData( ), dialogBackgroundColor: gray, toggleableActiveColor: purple, + inputDecorationTheme: inputTheme, ); final oledTheme = ThemeData( @@ -148,6 +167,7 @@ final oledTheme = ThemeData( ), dialogBackgroundColor: Colors.black, toggleableActiveColor: purple, + inputDecorationTheme: inputTheme, ); class MyApp extends StatelessWidget { diff --git a/lib/screens/channel/chat/chat.dart b/lib/screens/channel/chat/chat.dart index a5260fb9..586d74eb 100644 --- a/lib/screens/channel/chat/chat.dart +++ b/lib/screens/channel/chat/chat.dart @@ -114,7 +114,11 @@ class Chat extends StatelessWidget { ), ), ), - if (chatStore.settings.showBottomBar) ChatBottomBar(chatStore: chatStore), + if (chatStore.settings.showBottomBar) + Padding( + padding: const EdgeInsets.symmetric(vertical: 5.0), + child: ChatBottomBar(chatStore: chatStore), + ), AnimatedContainer( curve: Curves.ease, duration: const Duration(milliseconds: 200), diff --git a/lib/screens/channel/chat/widgets/chat_bottom_bar.dart b/lib/screens/channel/chat/widgets/chat_bottom_bar.dart index 483bca41..6b951c9f 100644 --- a/lib/screens/channel/chat/widgets/chat_bottom_bar.dart +++ b/lib/screens/channel/chat/widgets/chat_bottom_bar.dart @@ -122,6 +122,7 @@ class ChatBottomBar extends StatelessWidget { maxLines: 5, enabled: chatStore.auth.isLoggedIn ? true : false, decoration: InputDecoration( + contentPadding: const EdgeInsets.fromLTRB(20.0, 10.0, 0.0, 10.0), suffixIcon: IconButton( color: chatStore.assetsStore.showEmoteMenu ? Theme.of(context).colorScheme.secondary : null, tooltip: 'Emote menu', @@ -132,11 +133,7 @@ class ChatBottomBar extends StatelessWidget { }, ), hintMaxLines: 1, - contentPadding: const EdgeInsets.all(10.0), - border: const OutlineInputBorder( - borderRadius: BorderRadius.all(Radius.circular(15.0)), - ), - labelText: chatStore.auth.isLoggedIn ? 'Send a message' : 'Log in to chat', + hintText: chatStore.auth.isLoggedIn ? 'Send a message' : 'Log in to chat', ), controller: chatStore.textController, onSubmitted: chatStore.sendMessage, diff --git a/lib/screens/home/search/search.dart b/lib/screens/home/search/search.dart index 0b2117ce..32c57b87 100644 --- a/lib/screens/home/search/search.dart +++ b/lib/screens/home/search/search.dart @@ -44,13 +44,11 @@ class _SearchState extends State { controller: _textEditingController, autocorrect: false, decoration: InputDecoration( - isDense: true, - labelText: 'Find a channel or category', - contentPadding: const EdgeInsets.all(10.0), - border: const OutlineInputBorder( - borderRadius: BorderRadius.all(Radius.circular(15.0)), - ), + contentPadding: const EdgeInsets.all(0.0), + hintText: 'Find a channel or category', + prefixIcon: const Icon(Icons.search), suffixIcon: IconButton( + icon: const Icon(Icons.clear), tooltip: 'Clear search', onPressed: () { FocusScope.of(context).unfocus(); @@ -58,7 +56,6 @@ class _SearchState extends State { _textEditingController.clear(); }); }, - icon: const Icon(Icons.clear), ), ), onSubmitted: _searchStore.handleQuery,