From 944ec502b6922a9d3b418ca0c2a2eaf5f0036026 Mon Sep 17 00:00:00 2001 From: LezdCS Date: Tue, 4 Jun 2024 23:45:24 +0900 Subject: [PATCH 1/6] Themes update --- lib/src/core/resources/themes.dart | 34 +++++++++++++++++-- lib/src/presentation/views/home_view.dart | 14 ++------ .../twitch/moderation_bottom_sheet.dart | 1 - .../widgets/emote_picker_view.dart | 1 - .../widgets/settings/chats_joined.dart | 12 ------- .../settings/manage_list_browser_tabs.dart | 26 ++------------ .../widgets/settings/obs_settings.dart | 7 ---- .../widgets/tabs/streamelements_tab_view.dart | 4 --- 8 files changed, 36 insertions(+), 63 deletions(-) diff --git a/lib/src/core/resources/themes.dart b/lib/src/core/resources/themes.dart index f72b0b7b..e287f653 100644 --- a/lib/src/core/resources/themes.dart +++ b/lib/src/core/resources/themes.dart @@ -13,13 +13,23 @@ class Themes { ), textTheme: const TextTheme( bodyLarge: TextStyle(color: Colors.white), - bodyMedium: TextStyle(color: Color.fromARGB(255, 75, 75, 75)), + bodyMedium: TextStyle(color: Colors.white), ), primaryIconTheme: const IconThemeData(color: Colors.white), inputDecorationTheme: InputDecorationTheme( border: OutlineInputBorder( borderSide: BorderSide(color: Colors.grey[600]!), ), + hintStyle: const TextStyle( + color: Color.fromARGB(255, 75, 75, 75), + fontSize: 16, + ), + helperStyle: const TextStyle( + color: Colors.white, + ), + labelStyle: const TextStyle( + color: Colors.white, + ), enabledBorder: OutlineInputBorder( borderSide: BorderSide(color: Colors.grey[600]!), ), @@ -27,6 +37,11 @@ class Themes { borderSide: BorderSide(color: Colors.deepPurpleAccent[200]!), ), ), + tabBarTheme: TabBarTheme( + labelColor: Colors.deepPurpleAccent[200], + unselectedLabelColor: Colors.white, + dividerColor: Colors.transparent, + ), switchTheme: SwitchThemeData( thumbColor: WidgetStateProperty.resolveWith( (Set states) { @@ -74,13 +89,28 @@ class Themes { ), textTheme: const TextTheme( bodyLarge: TextStyle(color: Colors.black), - bodyMedium: TextStyle(color: Color.fromARGB(255, 75, 75, 75)), + bodyMedium: TextStyle(color: Colors.black), ), primaryIconTheme: const IconThemeData(color: Colors.black), inputDecorationTheme: const InputDecorationTheme( border: OutlineInputBorder( borderSide: BorderSide(color: Colors.black), ), + helperStyle: TextStyle( + color: Colors.black, + ), + hintStyle: TextStyle( + color: Color.fromARGB(255, 75, 75, 75), + fontSize: 16, + ), + labelStyle: TextStyle( + color: Colors.black, + ), + ), + tabBarTheme: TabBarTheme( + labelColor: Colors.deepPurpleAccent[200], + unselectedLabelColor: Colors.black, + dividerColor: Colors.transparent, ), switchTheme: SwitchThemeData( thumbColor: WidgetStateProperty.resolveWith( diff --git a/lib/src/presentation/views/home_view.dart b/lib/src/presentation/views/home_view.dart index a6b9c680..6292a574 100644 --- a/lib/src/presentation/views/home_view.dart +++ b/lib/src/presentation/views/home_view.dart @@ -71,8 +71,7 @@ class HomeView extends GetView { child: SplitView( controller: controller.splitViewController, gripColor: context.theme.colorScheme.secondary, - gripColorActive: - context.theme.colorScheme.secondary, + gripColorActive: context.theme.colorScheme.secondary, gripSize: 8, viewMode: context.isPortrait ? SplitViewMode.Vertical @@ -204,13 +203,10 @@ class HomeView extends GetView { () => TabBar( controller: controller.tabController, isScrollable: true, - labelColor: Theme.of(context).colorScheme.tertiary, - unselectedLabelColor: Theme.of(context).textTheme.bodyLarge!.color, indicatorColor: Theme.of(context).colorScheme.tertiary, labelPadding: const EdgeInsets.symmetric(horizontal: 30), indicatorSize: TabBarIndicatorSize.tab, indicatorWeight: 2, - dividerColor: Colors.transparent, onTap: (index) { controller.tabIndex.value = index; }, @@ -292,12 +288,6 @@ class HomeView extends GetView { maxLines: 1, decoration: InputDecoration( border: InputBorder.none, - hintStyle: TextStyle( - color: Theme.of(context) - .textTheme - .bodyLarge! - .backgroundColor, - fontSize: 16), hintText: controller.settings.value.generalSettings! .displayViewerCount ? '${Get.find().twitchStreamInfos.value.viewerCount} viewers' @@ -451,7 +441,7 @@ class HomeView extends GetView { child: InkWell( onTap: () async { controller.displayDashboard.value = - !controller.displayDashboard.value; + !controller.displayDashboard.value; }, child: Icon( Icons.dashboard_rounded, diff --git a/lib/src/presentation/widgets/chats/chat_message/twitch/moderation_bottom_sheet.dart b/lib/src/presentation/widgets/chats/chat_message/twitch/moderation_bottom_sheet.dart index 304c861f..39532730 100644 --- a/lib/src/presentation/widgets/chats/chat_message/twitch/moderation_bottom_sheet.dart +++ b/lib/src/presentation/widgets/chats/chat_message/twitch/moderation_bottom_sheet.dart @@ -245,7 +245,6 @@ class ModerationBottomSheet extends StatelessWidget { decoration: const InputDecoration( enabledBorder: InputBorder.none, focusedBorder: InputBorder.none, - hintStyle: TextStyle(color: Colors.grey, fontSize: 16), hintText: 'Custom duration (s)', isDense: true, contentPadding: EdgeInsets.only(left: 5), diff --git a/lib/src/presentation/widgets/emote_picker_view.dart b/lib/src/presentation/widgets/emote_picker_view.dart index 4130a34d..275e3d7a 100644 --- a/lib/src/presentation/widgets/emote_picker_view.dart +++ b/lib/src/presentation/widgets/emote_picker_view.dart @@ -47,7 +47,6 @@ class EmotePickerView extends GetView { size: 20, ), border: InputBorder.none, - hintStyle: TextStyle(color: Colors.grey, fontSize: 16), hintText: 'Emote name', isDense: true, contentPadding: EdgeInsets.only(left: 5), diff --git a/lib/src/presentation/widgets/settings/chats_joined.dart b/lib/src/presentation/widgets/settings/chats_joined.dart index f8adae7d..501f7d22 100644 --- a/lib/src/presentation/widgets/settings/chats_joined.dart +++ b/lib/src/presentation/widgets/settings/chats_joined.dart @@ -402,21 +402,9 @@ class ChatsJoined extends GetView { }, decoration: InputDecoration( helperText: _getHelperText(selectedPlatform.value), - helperStyle: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, - ), isDense: true, contentPadding: const EdgeInsets.symmetric(horizontal: 8, vertical: 12), - enabledBorder: - Theme.of(context).inputDecorationTheme.border, - hintStyle: TextStyle( - color: Theme.of(context).textTheme.bodyMedium!.color, - fontSize: 16, - ), - labelStyle: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, - ), hintText: _getHintText(selectedPlatform.value), labelText: _getHintText(selectedPlatform.value), ), diff --git a/lib/src/presentation/widgets/settings/manage_list_browser_tabs.dart b/lib/src/presentation/widgets/settings/manage_list_browser_tabs.dart index f21350e6..a3bf8dab 100644 --- a/lib/src/presentation/widgets/settings/manage_list_browser_tabs.dart +++ b/lib/src/presentation/widgets/settings/manage_list_browser_tabs.dart @@ -280,10 +280,6 @@ Widget _addDialog(context, SettingsViewController controller) { isDense: true, contentPadding: const EdgeInsets.symmetric(horizontal: 8, vertical: 12), - enabledBorder: Theme.of(context).inputDecorationTheme.border, - hintStyle: TextStyle( - color: Theme.of(context).textTheme.bodyMedium!.color, - fontSize: 16), labelStyle: TextStyle( color: Theme.of(context).textTheme.bodyLarge!.color, ), @@ -315,10 +311,6 @@ Widget _addDialog(context, SettingsViewController controller) { isDense: true, contentPadding: const EdgeInsets.symmetric(horizontal: 8, vertical: 12), - enabledBorder: Theme.of(context).inputDecorationTheme.border, - hintStyle: TextStyle( - color: Theme.of(context).textTheme.bodyMedium!.color, - fontSize: 16), labelStyle: TextStyle( color: Theme.of(context).textTheme.bodyLarge!.color, ), @@ -400,15 +392,8 @@ Widget _editDialog(context, SettingsViewController controller, elem) { isDense: true, contentPadding: const EdgeInsets.symmetric(horizontal: 8, vertical: 12), - enabledBorder: Theme.of(context).inputDecorationTheme.border, - hintStyle: TextStyle( - color: Theme.of(context).textTheme.bodyMedium!.color, - fontSize: 16), hintText: 'Tab title', labelText: 'Title', - labelStyle: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, - ), ), ), ), @@ -429,19 +414,12 @@ Widget _editDialog(context, SettingsViewController controller, elem) { } return null; }, - decoration: InputDecoration( + decoration: const InputDecoration( isDense: true, contentPadding: - const EdgeInsets.symmetric(horizontal: 8, vertical: 12), - enabledBorder: Theme.of(context).inputDecorationTheme.border, - hintStyle: TextStyle( - color: Theme.of(context).textTheme.bodyMedium!.color, - fontSize: 16), + EdgeInsets.symmetric(horizontal: 8, vertical: 12), hintText: 'Tab url', labelText: 'URL', - labelStyle: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, - ), ), ), ), diff --git a/lib/src/presentation/widgets/settings/obs_settings.dart b/lib/src/presentation/widgets/settings/obs_settings.dart index 338bd64f..756d7ce2 100644 --- a/lib/src/presentation/widgets/settings/obs_settings.dart +++ b/lib/src/presentation/widgets/settings/obs_settings.dart @@ -44,8 +44,6 @@ class ObsSettings extends StatelessWidget { isDense: true, contentPadding: const EdgeInsets.symmetric( horizontal: 8, vertical: 7), - enabledBorder: - Theme.of(context).inputDecorationTheme.border, hintText: 'url', labelText: 'Websocket Url', labelStyle: TextStyle( @@ -87,13 +85,8 @@ class ObsSettings extends StatelessWidget { isDense: true, contentPadding: const EdgeInsets.symmetric( horizontal: 8, vertical: 7), - enabledBorder: - Theme.of(context).inputDecorationTheme.border, hintText: 'password', labelText: 'Websocket Password', - labelStyle: TextStyle( - color: Theme.of(context).colorScheme.tertiary, - ), suffixIcon: IconButton( icon: Icon(controller.obsWebsocketPasswordShow.value ? Icons.visibility diff --git a/lib/src/presentation/widgets/tabs/streamelements_tab_view.dart b/lib/src/presentation/widgets/tabs/streamelements_tab_view.dart index 128aae48..965535a9 100644 --- a/lib/src/presentation/widgets/tabs/streamelements_tab_view.dart +++ b/lib/src/presentation/widgets/tabs/streamelements_tab_view.dart @@ -20,14 +20,10 @@ class StreamelementsTabView extends GetView { child: TabBar( controller: controller.tabController, isScrollable: true, - labelColor: Theme.of(context).colorScheme.tertiary, - unselectedLabelColor: - context.theme.textTheme.bodyLarge!.color, indicator: const BoxDecoration( border: null, ), tabAlignment: TabAlignment.center, - dividerColor: Colors.transparent, tabs: const [ Text("Activities"), Text("Song Requests"), From 7e39ac8ba269d33143708643beba5b888ec0fc57 Mon Sep 17 00:00:00 2001 From: LezdCS Date: Wed, 5 Jun 2024 00:00:01 +0900 Subject: [PATCH 2/6] remove useless themes lines --- lib/src/core/resources/themes.dart | 18 ++++--- lib/src/presentation/views/settings_view.dart | 47 ++++++------------- lib/src/presentation/widgets/poll.dart | 11 ++--- lib/src/presentation/widgets/prediction.dart | 6 +-- .../widgets/settings/chat_events.dart | 24 ++++------ .../widgets/settings/chats_joined.dart | 9 ++-- .../settings/dashboard_settings_view.dart | 11 +---- .../dialogs/in_app_purchase_dialog.dart | 34 +++++++------- .../settings/manage_list_browser_tabs.dart | 47 +++++-------------- .../settings/manage_list_hidden_users.dart | 10 +--- .../widgets/settings/stream_elements.dart | 24 +++------- .../presentation/widgets/settings/tts.dart | 38 +++++---------- 12 files changed, 90 insertions(+), 189 deletions(-) diff --git a/lib/src/core/resources/themes.dart b/lib/src/core/resources/themes.dart index e287f653..361f3d35 100644 --- a/lib/src/core/resources/themes.dart +++ b/lib/src/core/resources/themes.dart @@ -92,20 +92,26 @@ class Themes { bodyMedium: TextStyle(color: Colors.black), ), primaryIconTheme: const IconThemeData(color: Colors.black), - inputDecorationTheme: const InputDecorationTheme( - border: OutlineInputBorder( + inputDecorationTheme: InputDecorationTheme( + border: const OutlineInputBorder( borderSide: BorderSide(color: Colors.black), ), - helperStyle: TextStyle( - color: Colors.black, + helperStyle: const TextStyle( + color: Color.fromARGB(255, 28, 25, 25), ), - hintStyle: TextStyle( + hintStyle: const TextStyle( color: Color.fromARGB(255, 75, 75, 75), fontSize: 16, ), - labelStyle: TextStyle( + labelStyle: const TextStyle( color: Colors.black, ), + enabledBorder: OutlineInputBorder( + borderSide: BorderSide(color: Colors.grey[600]!), + ), + focusedBorder: OutlineInputBorder( + borderSide: BorderSide(color: Colors.deepPurpleAccent[200]!), + ), ), tabBarTheme: TabBarTheme( labelColor: Colors.deepPurpleAccent[200], diff --git a/lib/src/presentation/views/settings_view.dart b/lib/src/presentation/views/settings_view.dart index d23b30f3..a82c9706 100644 --- a/lib/src/presentation/views/settings_view.dart +++ b/lib/src/presentation/views/settings_view.dart @@ -36,9 +36,8 @@ class SettingsView extends GetView { () => Scaffold( appBar: AppBar( leading: IconButton( - icon: Icon( + icon: const Icon( Icons.arrow_back, - color: Theme.of(context).textTheme.bodyLarge!.color, ), onPressed: () => Get.back(), ), @@ -71,11 +70,8 @@ class SettingsView extends GetView { ), ], backgroundColor: Theme.of(context).colorScheme.secondary, - title: Text( + title: const Text( "Settings", - style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, - ), ), centerTitle: false, ), @@ -162,10 +158,9 @@ class SettingsView extends GetView { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text( + const Text( "FFZ, BTTV & 7TV emotes", style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, fontSize: 18, ), ), @@ -186,17 +181,13 @@ class SettingsView extends GetView { children: [ Text( "text_size".tr, - style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, - fontSize: 18), + style: const TextStyle(fontSize: 18), ), Text( controller.homeViewController.settings.value.textSize! .ceil() .toString(), - style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, - fontSize: 18)), + style: const TextStyle(fontSize: 18)), Slider( onChanged: (value) { controller.homeViewController.settings.value = @@ -219,9 +210,7 @@ class SettingsView extends GetView { children: [ Text( "show_timestamp".tr, - style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, - fontSize: 18), + style: const TextStyle(fontSize: 18), ), Switch( onChanged: (value) { @@ -238,11 +227,9 @@ class SettingsView extends GetView { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text( + const Text( "Hide deleted messages", - style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, - fontSize: 18), + style: TextStyle(fontSize: 18), ), Switch( onChanged: (value) { @@ -346,8 +333,7 @@ class SettingsView extends GetView { children: [ Text( "dark_mode".tr, - style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, + style: const TextStyle( fontSize: 18, ), ), @@ -376,8 +362,7 @@ class SettingsView extends GetView { Expanded( child: Text( "prevent_speaker".tr, - style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, + style: const TextStyle( fontSize: 18, ), ), @@ -401,11 +386,10 @@ class SettingsView extends GetView { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Expanded( + const Expanded( child: Text( "Display viewer count", style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, fontSize: 18, ), ), @@ -431,8 +415,7 @@ class SettingsView extends GetView { children: [ Text( "language".tr, - style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, + style: const TextStyle( fontSize: 18, ), ), @@ -509,10 +492,9 @@ class SettingsView extends GetView { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text( + const Text( "OBS", style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, fontSize: 18, ), ), @@ -682,8 +664,7 @@ class SettingsView extends GetView { padding: const EdgeInsets.only(left: 10), child: Text( title, - style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, + style: const TextStyle( fontSize: 18, ), ), diff --git a/lib/src/presentation/widgets/poll.dart b/lib/src/presentation/widgets/poll.dart index 48cc0414..16813298 100644 --- a/lib/src/presentation/widgets/poll.dart +++ b/lib/src/presentation/widgets/poll.dart @@ -11,15 +11,12 @@ Widget poll( TwitchPoll poll, ) { if (poll.status == PollStatus.empty) { - return Row( + return const Row( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( "No poll running", - style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, - ), ), ], ); @@ -28,10 +25,9 @@ Widget poll( return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( + const Text( "Poll", style: TextStyle( - color: Theme.of(Get.context!).textTheme.bodyLarge!.color, fontSize: 16, fontWeight: FontWeight.bold, ), @@ -56,8 +52,7 @@ Widget poll( children: [ Text( choice.title, - style: TextStyle( - color: Theme.of(Get.context!).textTheme.bodyLarge!.color, + style: const TextStyle( fontSize: 14, fontWeight: FontWeight.bold, ), diff --git a/lib/src/presentation/widgets/prediction.dart b/lib/src/presentation/widgets/prediction.dart index 45923d93..db6b5410 100644 --- a/lib/src/presentation/widgets/prediction.dart +++ b/lib/src/presentation/widgets/prediction.dart @@ -12,14 +12,13 @@ Widget prediction( TwitchPrediction prediction, ) { if (prediction.status == PredictionStatus.empty) { - return Row( + return const Row( crossAxisAlignment: CrossAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( "No prediction running", style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, ), ), ], @@ -28,10 +27,9 @@ Widget prediction( return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( + const Text( "Prediction", style: TextStyle( - color: Theme.of(Get.context!).textTheme.bodyLarge!.color, fontSize: 16, fontWeight: FontWeight.bold, ), diff --git a/lib/src/presentation/widgets/settings/chat_events.dart b/lib/src/presentation/widgets/settings/chat_events.dart index 8ed786b0..9b7db0d8 100644 --- a/lib/src/presentation/widgets/settings/chat_events.dart +++ b/lib/src/presentation/widgets/settings/chat_events.dart @@ -26,11 +26,9 @@ class ChatEvents extends StatelessWidget { ), actions: const [], backgroundColor: Theme.of(context).colorScheme.secondary, - title: Text( + title: const Text( "Chat events", - style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, - ), + style: TextStyle(), ), centerTitle: false, ), @@ -63,10 +61,9 @@ class ChatEvents extends StatelessWidget { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text( + const Text( "First time chatter", style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, fontSize: 18, ), ), @@ -115,10 +112,9 @@ class ChatEvents extends StatelessWidget { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text( + const Text( "Subscriptions", style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, fontSize: 18, ), ), @@ -167,10 +163,9 @@ class ChatEvents extends StatelessWidget { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text( + const Text( "Bits donations", style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, fontSize: 18, ), ), @@ -219,10 +214,9 @@ class ChatEvents extends StatelessWidget { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text( + const Text( "Announcements", style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, fontSize: 18, ), ), @@ -271,10 +265,9 @@ class ChatEvents extends StatelessWidget { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text( + const Text( "Incoming raids", style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, fontSize: 18, ), ), @@ -323,10 +316,9 @@ class ChatEvents extends StatelessWidget { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text( + const Text( "Channelpoint redemptions", style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, fontSize: 18, ), ), diff --git a/lib/src/presentation/widgets/settings/chats_joined.dart b/lib/src/presentation/widgets/settings/chats_joined.dart index 501f7d22..98ba1611 100644 --- a/lib/src/presentation/widgets/settings/chats_joined.dart +++ b/lib/src/presentation/widgets/settings/chats_joined.dart @@ -25,11 +25,9 @@ class ChatsJoined extends GetView { ), actions: const [], backgroundColor: Theme.of(context).colorScheme.secondary, - title: Text( + title: const Text( "Chats joined", - style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, - ), + style: TextStyle(), ), centerTitle: false, ), @@ -54,8 +52,7 @@ class ChatsJoined extends GetView { controller.homeViewController.twitchData?.twitchUser .login ?? '', - style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, + style: const TextStyle( fontSize: 20, ), ), diff --git a/lib/src/presentation/widgets/settings/dashboard_settings_view.dart b/lib/src/presentation/widgets/settings/dashboard_settings_view.dart index 93579195..04825f63 100644 --- a/lib/src/presentation/widgets/settings/dashboard_settings_view.dart +++ b/lib/src/presentation/widgets/settings/dashboard_settings_view.dart @@ -46,11 +46,8 @@ class DashboardSettingsView extends GetView { ), ], backgroundColor: Theme.of(context).colorScheme.secondary, - title: Text( + title: const Text( "Dashboard events", - style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, - ), ), centerTitle: false, ), @@ -201,9 +198,6 @@ Widget _addDialog(context, DashboardController dashboardController) { const EdgeInsets.symmetric(horizontal: 8, vertical: 7), hintText: 'Event title', labelText: 'Event title', - labelStyle: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, - ), ), validator: (value) { if (value == null || value.isEmpty) { @@ -295,9 +289,6 @@ Widget _addDialog(context, DashboardController dashboardController) { const EdgeInsets.symmetric(horizontal: 8, vertical: 7), hintText: 'Your message', labelText: 'Your message', - labelStyle: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, - ), ), validator: (value) { if (value == null || value.isEmpty) { diff --git a/lib/src/presentation/widgets/settings/dialogs/in_app_purchase_dialog.dart b/lib/src/presentation/widgets/settings/dialogs/in_app_purchase_dialog.dart index bddbeec5..36d4f447 100644 --- a/lib/src/presentation/widgets/settings/dialogs/in_app_purchase_dialog.dart +++ b/lib/src/presentation/widgets/settings/dialogs/in_app_purchase_dialog.dart @@ -82,43 +82,41 @@ Widget inAppPurchaseDialog( ) ], ), - Wrap( + const Wrap( crossAxisAlignment: WrapCrossAlignment.center, children: [ - const Icon( + Icon( Icons.check_circle_outline_rounded, size: 18, color: Colors.green, ), - const SizedBox( + SizedBox( width: 4, ), Text( 'Media request control (no audio)', style: TextStyle( - color: - Theme.of(context).textTheme.bodyLarge!.color, - fontSize: 13), + fontSize: 13, + ), ) ], ), - Wrap( + const Wrap( crossAxisAlignment: WrapCrossAlignment.center, children: [ - const Icon( + Icon( Icons.check_circle_outline_rounded, size: 18, color: Colors.green, ), - const SizedBox( + SizedBox( width: 4, ), Text( 'Overlays (audio on Android only)', style: TextStyle( - color: - Theme.of(context).textTheme.bodyLarge!.color, - fontSize: 13), + fontSize: 13, + ), ) ], ), @@ -144,11 +142,11 @@ Widget inAppPurchaseDialog( backgroundColor: Theme.of(context).colorScheme.tertiaryContainer, ), - child: Text( + child: const Text( "Cancel", style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, - fontSize: 13), + fontSize: 13, + ), textAlign: TextAlign.center, ), ), @@ -163,9 +161,9 @@ Widget inAppPurchaseDialog( ), child: Text( "Subscribe for $price", - style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, - fontSize: 13), + style: const TextStyle( + fontSize: 13, + ), textAlign: TextAlign.center, ), ), diff --git a/lib/src/presentation/widgets/settings/manage_list_browser_tabs.dart b/lib/src/presentation/widgets/settings/manage_list_browser_tabs.dart index a3bf8dab..788e932d 100644 --- a/lib/src/presentation/widgets/settings/manage_list_browser_tabs.dart +++ b/lib/src/presentation/widgets/settings/manage_list_browser_tabs.dart @@ -42,11 +42,8 @@ class ManageListBrowserTabs extends GetView { ] : const [], backgroundColor: Theme.of(context).colorScheme.secondary, - title: Text( + title: const Text( "Manage browser tabs", - style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, - ), ), centerTitle: false, ), @@ -62,11 +59,8 @@ class ManageListBrowserTabs extends GetView { .homeViewController.settings.value.browserTabs!.isEmpty ? Container( padding: const EdgeInsets.only(top: 20), - child: Text( + child: const Text( "Nothing in the list!", - style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, - ), ), ) : ReorderableListView.builder( @@ -221,10 +215,6 @@ class ManageListBrowserTabs extends GetView { title: "add".tr, textCancel: "cancel".tr, textConfirm: "add".tr, - titleStyle: TextStyle( - color: - Theme.of(context).textTheme.bodyLarge!.color, - ), backgroundColor: Theme.of(context).colorScheme.surface, buttonColor: const Color(0xFF9147ff), @@ -266,9 +256,6 @@ Widget _addDialog(context, SettingsViewController controller) { child: TextFormField( controller: controller.addBrowserTitleController, textInputAction: TextInputAction.send, - style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, - ), maxLines: 1, validator: (value) { if (value == null || value.isEmpty) { @@ -276,13 +263,10 @@ Widget _addDialog(context, SettingsViewController controller) { } return null; }, - decoration: InputDecoration( + decoration: const InputDecoration( isDense: true, contentPadding: - const EdgeInsets.symmetric(horizontal: 8, vertical: 12), - labelStyle: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, - ), + EdgeInsets.symmetric(horizontal: 8, vertical: 12), hintText: 'Tab title', labelText: 'Title', ), @@ -307,13 +291,10 @@ Widget _addDialog(context, SettingsViewController controller) { } return null; }, - decoration: InputDecoration( + decoration: const InputDecoration( isDense: true, contentPadding: - const EdgeInsets.symmetric(horizontal: 8, vertical: 12), - labelStyle: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, - ), + EdgeInsets.symmetric(horizontal: 8, vertical: 12), hintText: 'Tab url', labelText: 'URL', ), @@ -322,10 +303,9 @@ Widget _addDialog(context, SettingsViewController controller) { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text( + const Text( "Enabled", style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, fontSize: 18, ), ), @@ -344,10 +324,9 @@ Widget _addDialog(context, SettingsViewController controller) { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text( + const Text( "Is an audio source", style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, fontSize: 18, ), ), @@ -388,10 +367,10 @@ Widget _editDialog(context, SettingsViewController controller, elem) { } return null; }, - decoration: InputDecoration( + decoration: const InputDecoration( isDense: true, contentPadding: - const EdgeInsets.symmetric(horizontal: 8, vertical: 12), + EdgeInsets.symmetric(horizontal: 8, vertical: 12), hintText: 'Tab title', labelText: 'Title', ), @@ -426,10 +405,9 @@ Widget _editDialog(context, SettingsViewController controller, elem) { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text( + const Text( "Enabled", style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, fontSize: 18, ), ), @@ -448,10 +426,9 @@ Widget _editDialog(context, SettingsViewController controller, elem) { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text( + const Text( "Is an audio source", style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, fontSize: 18, ), ), diff --git a/lib/src/presentation/widgets/settings/manage_list_hidden_users.dart b/lib/src/presentation/widgets/settings/manage_list_hidden_users.dart index d5651788..23e12870 100644 --- a/lib/src/presentation/widgets/settings/manage_list_hidden_users.dart +++ b/lib/src/presentation/widgets/settings/manage_list_hidden_users.dart @@ -26,11 +26,8 @@ class ManageListHiddenUsers extends GetView { ), actions: const [], backgroundColor: Theme.of(context).colorScheme.secondary, - title: Text( + title: const Text( "Manage hidden users", - style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, - ), ), centerTitle: false, ), @@ -46,11 +43,8 @@ class ManageListHiddenUsers extends GetView { .hiddenUsersIds!.isEmpty ? Container( padding: const EdgeInsets.only(top: 20), - child: Text( + child: const Text( "Nothing in the list!", - style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, - ), ), ) : controller.usernamesHiddenUsers.length != diff --git a/lib/src/presentation/widgets/settings/stream_elements.dart b/lib/src/presentation/widgets/settings/stream_elements.dart index 8b2d2f4b..e5edb707 100644 --- a/lib/src/presentation/widgets/settings/stream_elements.dart +++ b/lib/src/presentation/widgets/settings/stream_elements.dart @@ -21,10 +21,9 @@ class StreamElements extends GetView { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text( + const Text( 'StreamElements', style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, fontSize: 18, ), ), @@ -35,16 +34,15 @@ class StreamElements extends GetView { color: Theme.of(context).colorScheme.tertiary, borderRadius: BorderRadius.circular(20), ), - child: Wrap( + child: const Wrap( children: [ Text( "Premium feature", style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, fontSize: 12, ), ), - const Icon( + Icon( CupertinoIcons.sparkles, size: 12, color: Colors.yellow, @@ -206,12 +204,8 @@ class StreamElements extends GetView { ), ], ), - Text( + const Text( 'Same as above for the overlay token', - style: TextStyle( - color: - Theme.of(context).textTheme.bodyLarge!.color, - ), ), const SizedBox( height: 8, @@ -301,11 +295,8 @@ class StreamElements extends GetView { textAlign: TextAlign.center, text: TextSpan( children: [ - TextSpan( + const TextSpan( text: 'To get your Access Token ', - style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, - ), ), WidgetSpan( child: InkWell( @@ -323,11 +314,8 @@ class StreamElements extends GetView { ), ), ), - TextSpan( + const TextSpan( text: '. Then press "Show Secret" and copy your JWT Token!', - style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, - ), ), ], ), diff --git a/lib/src/presentation/widgets/settings/tts.dart b/lib/src/presentation/widgets/settings/tts.dart index d906776b..ff1b6783 100644 --- a/lib/src/presentation/widgets/settings/tts.dart +++ b/lib/src/presentation/widgets/settings/tts.dart @@ -26,9 +26,6 @@ class Tts extends StatelessWidget { backgroundColor: Theme.of(context).colorScheme.secondary, title: Text( "text_to_speech".tr, - style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, - ), ), centerTitle: false, ), @@ -44,8 +41,7 @@ class Tts extends StatelessWidget { children: [ Text( "enable_tts".tr, - style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, + style: const TextStyle( fontSize: 18, ), ), @@ -70,8 +66,7 @@ class Tts extends StatelessWidget { children: [ Text( "language".tr, - style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, + style: const TextStyle( fontSize: 18, ), ), @@ -110,9 +105,7 @@ class Tts extends StatelessWidget { children: [ Text( "voice".tr, - style: TextStyle( - color: - Theme.of(context).textTheme.bodyLarge!.color, + style: const TextStyle( fontSize: 18, ), ), @@ -154,10 +147,9 @@ class Tts extends StatelessWidget { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text( + const Text( "Volume", style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, fontSize: 18, ), ), @@ -184,8 +176,7 @@ class Tts extends StatelessWidget { children: [ Text( "speech_rate".tr, - style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, + style: const TextStyle( fontSize: 18, ), ), @@ -212,8 +203,7 @@ class Tts extends StatelessWidget { children: [ Text( "pitch".tr, - style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, + style: const TextStyle( fontSize: 18, ), ), @@ -239,10 +229,9 @@ class Tts extends StatelessWidget { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text( + const Text( "Mute viewer name", style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, fontSize: 18, ), ), @@ -266,10 +255,9 @@ class Tts extends StatelessWidget { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text( + const Text( "Only read VIP messages", style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, fontSize: 18, ), ), @@ -293,10 +281,9 @@ class Tts extends StatelessWidget { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text( + const Text( "Only read Moderators messages", style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, fontSize: 18, ), ), @@ -320,10 +307,9 @@ class Tts extends StatelessWidget { Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Text( + const Text( "Only read Subscriber messages", style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, fontSize: 18, ), ), @@ -591,9 +577,7 @@ class Tts extends StatelessWidget { children: [ Text( "ignored_users".tr, - style: TextStyle( - color: - Theme.of(context).textTheme.bodyLarge!.color, + style: const TextStyle( fontSize: 18, ), ), From 42510e670c1b28d06e01f09e53b8b03066208fa5 Mon Sep 17 00:00:00 2001 From: LezdCS Date: Wed, 5 Jun 2024 11:12:23 +0900 Subject: [PATCH 3/6] Themes improvment --- lib/src/core/resources/themes.dart | 38 +++++++++++++++++-- lib/src/presentation/views/home_view.dart | 9 ++--- lib/src/presentation/views/settings_view.dart | 19 ++-------- lib/src/presentation/widgets/dashboard.dart | 1 - lib/src/presentation/widgets/poll.dart | 2 - lib/src/presentation/widgets/prediction.dart | 2 - .../widgets/settings/chat_events.dart | 30 +++------------ .../dialogs/in_app_purchase_dialog.dart | 2 - .../widgets/settings/obs_settings.dart | 2 - .../stream_elements/se_activities_list.dart | 30 +++------------ .../stream_elements/se_song_requests.dart | 36 +++++------------- .../widgets/tabs/obs_tab_view.dart | 10 +---- .../widgets/tabs/twitch_tab_view.dart | 37 +++--------------- 13 files changed, 68 insertions(+), 150 deletions(-) diff --git a/lib/src/core/resources/themes.dart b/lib/src/core/resources/themes.dart index 361f3d35..0b36a684 100644 --- a/lib/src/core/resources/themes.dart +++ b/lib/src/core/resources/themes.dart @@ -27,8 +27,8 @@ class Themes { helperStyle: const TextStyle( color: Colors.white, ), - labelStyle: const TextStyle( - color: Colors.white, + labelStyle: TextStyle( + color: Colors.deepPurpleAccent[200], ), enabledBorder: OutlineInputBorder( borderSide: BorderSide(color: Colors.grey[600]!), @@ -42,6 +42,21 @@ class Themes { unselectedLabelColor: Colors.white, dividerColor: Colors.transparent, ), + dividerTheme: const DividerThemeData( + thickness: 2, + indent: 0, + endIndent: 0, + color: Color(0xFF18181b), + ), + textButtonTheme: const TextButtonThemeData( + style: ButtonStyle( + textStyle: WidgetStatePropertyAll( + TextStyle( + fontSize: 12, + ), + ), + ), + ), switchTheme: SwitchThemeData( thumbColor: WidgetStateProperty.resolveWith( (Set states) { @@ -103,8 +118,8 @@ class Themes { color: Color.fromARGB(255, 75, 75, 75), fontSize: 16, ), - labelStyle: const TextStyle( - color: Colors.black, + labelStyle: TextStyle( + color: Colors.deepPurpleAccent[200], ), enabledBorder: OutlineInputBorder( borderSide: BorderSide(color: Colors.grey[600]!), @@ -118,6 +133,21 @@ class Themes { unselectedLabelColor: Colors.black, dividerColor: Colors.transparent, ), + dividerTheme: const DividerThemeData( + thickness: 2, + indent: 0, + endIndent: 0, + color: Color(0xFFefeff1), + ), + textButtonTheme: const TextButtonThemeData( + style: ButtonStyle( + textStyle: WidgetStatePropertyAll( + TextStyle( + fontSize: 12, + ), + ), + ), + ), switchTheme: SwitchThemeData( thumbColor: WidgetStateProperty.resolveWith( (Set states) { diff --git a/lib/src/presentation/views/home_view.dart b/lib/src/presentation/views/home_view.dart index 6292a574..c3fba3da 100644 --- a/lib/src/presentation/views/home_view.dart +++ b/lib/src/presentation/views/home_view.dart @@ -284,7 +284,6 @@ class HomeView extends GetView { controller.isPickingEmote.value = false; }, textInputAction: TextInputAction.send, - style: Theme.of(context).textTheme.bodyLarge, maxLines: 1, decoration: InputDecoration( border: InputBorder.none, @@ -536,10 +535,10 @@ class HomeView extends GetView { (int index) => Tab( height: 30, child: Text( - controller.channels[index].chatGroup.channels - .map((e) => e.channel) - .join(", "), - style: Theme.of(context).textTheme.bodyLarge), + controller.channels[index].chatGroup.channels + .map((e) => e.channel) + .join(", "), + ), ), ), ); diff --git a/lib/src/presentation/views/settings_view.dart b/lib/src/presentation/views/settings_view.dart index a82c9706..5b98217d 100644 --- a/lib/src/presentation/views/settings_view.dart +++ b/lib/src/presentation/views/settings_view.dart @@ -54,7 +54,6 @@ class SettingsView extends GetView { } }, style: TextButton.styleFrom( - textStyle: const TextStyle(fontSize: 12), backgroundColor: controller.homeViewController.twitchData != null ? Colors.red @@ -84,12 +83,8 @@ class SettingsView extends GetView { const EdgeInsets.only(top: 8, left: 10, right: 10, bottom: 8), children: [ Subscription(controller: controller), - Divider( + const Divider( height: 20, - thickness: 2, - indent: 0, - endIndent: 0, - color: Theme.of(context).colorScheme.secondary, ), chatSettings(context, width), Divider( @@ -100,20 +95,12 @@ class SettingsView extends GetView { color: Theme.of(context).colorScheme.secondary, ), connectionsSettings(context, width), - Divider( + const Divider( height: 20, - thickness: 2, - indent: 0, - endIndent: 0, - color: Theme.of(context).colorScheme.secondary, ), generalSettings(context, width), - Divider( + const Divider( height: 20, - thickness: 2, - indent: 0, - endIndent: 0, - color: Theme.of(context).colorScheme.secondary, ), contactSettings(context, width), Container( diff --git a/lib/src/presentation/widgets/dashboard.dart b/lib/src/presentation/widgets/dashboard.dart index fe9004e1..e5be8163 100644 --- a/lib/src/presentation/widgets/dashboard.dart +++ b/lib/src/presentation/widgets/dashboard.dart @@ -128,7 +128,6 @@ class Dashboard extends GetView { alignment: Alignment.center, child: TextButton( style: TextButton.styleFrom( - textStyle: const TextStyle(fontSize: 12), backgroundColor: event.color, ), onPressed: () { diff --git a/lib/src/presentation/widgets/poll.dart b/lib/src/presentation/widgets/poll.dart index 16813298..977d576a 100644 --- a/lib/src/presentation/widgets/poll.dart +++ b/lib/src/presentation/widgets/poll.dart @@ -89,7 +89,6 @@ Widget poll( children: [ TextButton( style: TextButton.styleFrom( - textStyle: const TextStyle(fontSize: 12), backgroundColor: Theme.of(context).colorScheme.tertiaryContainer, ), @@ -105,7 +104,6 @@ Widget poll( ), TextButton( style: TextButton.styleFrom( - textStyle: const TextStyle(fontSize: 12), backgroundColor: Colors.green, ), onPressed: () { diff --git a/lib/src/presentation/widgets/prediction.dart b/lib/src/presentation/widgets/prediction.dart index db6b5410..c8950181 100644 --- a/lib/src/presentation/widgets/prediction.dart +++ b/lib/src/presentation/widgets/prediction.dart @@ -118,7 +118,6 @@ Widget prediction( children: [ TextButton( style: TextButton.styleFrom( - textStyle: const TextStyle(fontSize: 12), backgroundColor: Theme.of(context).colorScheme.tertiaryContainer, ), @@ -134,7 +133,6 @@ Widget prediction( ), TextButton( style: TextButton.styleFrom( - textStyle: const TextStyle(fontSize: 12), backgroundColor: Colors.green, ), onPressed: () { diff --git a/lib/src/presentation/widgets/settings/chat_events.dart b/lib/src/presentation/widgets/settings/chat_events.dart index 9b7db0d8..f4dd0069 100644 --- a/lib/src/presentation/widgets/settings/chat_events.dart +++ b/lib/src/presentation/widgets/settings/chat_events.dart @@ -87,12 +87,8 @@ class ChatEvents extends StatelessWidget { ), ], ), - Divider( + const Divider( height: 20, - thickness: 2, - indent: 0, - endIndent: 0, - color: Theme.of(context).colorScheme.secondary, ), Column( children: [ @@ -138,12 +134,8 @@ class ChatEvents extends StatelessWidget { ), ], ), - Divider( + const Divider( height: 20, - thickness: 2, - indent: 0, - endIndent: 0, - color: Theme.of(context).colorScheme.secondary, ), Column( children: [ @@ -189,12 +181,8 @@ class ChatEvents extends StatelessWidget { ), ], ), - Divider( + const Divider( height: 20, - thickness: 2, - indent: 0, - endIndent: 0, - color: Theme.of(context).colorScheme.secondary, ), Column( children: [ @@ -240,12 +228,8 @@ class ChatEvents extends StatelessWidget { ), ], ), - Divider( + const Divider( height: 20, - thickness: 2, - indent: 0, - endIndent: 0, - color: Theme.of(context).colorScheme.secondary, ), Column( children: [ @@ -291,12 +275,8 @@ class ChatEvents extends StatelessWidget { ), ], ), - Divider( + const Divider( height: 20, - thickness: 2, - indent: 0, - endIndent: 0, - color: Theme.of(context).colorScheme.secondary, ), Column( children: [ diff --git a/lib/src/presentation/widgets/settings/dialogs/in_app_purchase_dialog.dart b/lib/src/presentation/widgets/settings/dialogs/in_app_purchase_dialog.dart index 36d4f447..7069a8bd 100644 --- a/lib/src/presentation/widgets/settings/dialogs/in_app_purchase_dialog.dart +++ b/lib/src/presentation/widgets/settings/dialogs/in_app_purchase_dialog.dart @@ -138,7 +138,6 @@ Widget inAppPurchaseDialog( Get.back(); }, style: TextButton.styleFrom( - textStyle: const TextStyle(fontSize: 12), backgroundColor: Theme.of(context).colorScheme.tertiaryContainer, ), @@ -156,7 +155,6 @@ Widget inAppPurchaseDialog( controller.storeController.purchase(); }, style: TextButton.styleFrom( - textStyle: const TextStyle(fontSize: 12), backgroundColor: Colors.deepPurpleAccent, ), child: Text( diff --git a/lib/src/presentation/widgets/settings/obs_settings.dart b/lib/src/presentation/widgets/settings/obs_settings.dart index 756d7ce2..7af4338d 100644 --- a/lib/src/presentation/widgets/settings/obs_settings.dart +++ b/lib/src/presentation/widgets/settings/obs_settings.dart @@ -108,7 +108,6 @@ class ObsSettings extends StatelessWidget { Expanded( child: TextButton( style: TextButton.styleFrom( - textStyle: const TextStyle(fontSize: 12), backgroundColor: Theme.of(context).colorScheme.tertiary, fixedSize: const Size(50, 20), ), @@ -145,7 +144,6 @@ class ObsSettings extends StatelessWidget { Expanded( child: TextButton( style: TextButton.styleFrom( - textStyle: const TextStyle(fontSize: 12), backgroundColor: Theme.of(context).colorScheme.tertiaryContainer, fixedSize: const Size(50, 20), diff --git a/lib/src/presentation/widgets/stream_elements/se_activities_list.dart b/lib/src/presentation/widgets/stream_elements/se_activities_list.dart index 87479e1b..1b6077a3 100644 --- a/lib/src/presentation/widgets/stream_elements/se_activities_list.dart +++ b/lib/src/presentation/widgets/stream_elements/se_activities_list.dart @@ -80,11 +80,8 @@ class SeActivitiesList extends GetView { () => CheckboxListTile( activeColor: Colors.deepPurple[600], controlAffinity: ListTileControlAffinity.leading, - title: Text( + title: const Text( "Followers", - style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, - ), ), value: controller.homeViewController.settings.value .streamElementsSettings!.showFollowerActivity, @@ -107,11 +104,8 @@ class SeActivitiesList extends GetView { () => CheckboxListTile( activeColor: Colors.deepPurple[600], controlAffinity: ListTileControlAffinity.leading, - title: Text( + title: const Text( "Subscriptions", - style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, - ), ), value: controller.homeViewController.settings.value .streamElementsSettings!.showSubscriberActivity, @@ -134,11 +128,8 @@ class SeActivitiesList extends GetView { () => CheckboxListTile( activeColor: Colors.deepPurple[600], controlAffinity: ListTileControlAffinity.leading, - title: Text( + title: const Text( "Bits", - style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, - ), ), value: controller.homeViewController.settings.value .streamElementsSettings!.showCheerActivity, @@ -161,11 +152,8 @@ class SeActivitiesList extends GetView { () => CheckboxListTile( activeColor: Colors.deepPurple[600], controlAffinity: ListTileControlAffinity.leading, - title: Text( + title: const Text( "Donations", - style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, - ), ), value: controller.homeViewController.settings.value .streamElementsSettings!.showDonationActivity, @@ -188,11 +176,8 @@ class SeActivitiesList extends GetView { () => CheckboxListTile( activeColor: Colors.deepPurple[600], controlAffinity: ListTileControlAffinity.leading, - title: Text( + title: const Text( "Raids", - style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, - ), ), value: controller.homeViewController.settings.value .streamElementsSettings!.showRaidActivity, @@ -215,11 +200,8 @@ class SeActivitiesList extends GetView { () => CheckboxListTile( activeColor: Colors.deepPurple[600], controlAffinity: ListTileControlAffinity.leading, - title: Text( + title: const Text( "Hosts", - style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, - ), ), value: controller.homeViewController.settings.value .streamElementsSettings!.showHostActivity, diff --git a/lib/src/presentation/widgets/stream_elements/se_song_requests.dart b/lib/src/presentation/widgets/stream_elements/se_song_requests.dart index 1ead2f71..65d39f13 100644 --- a/lib/src/presentation/widgets/stream_elements/se_song_requests.dart +++ b/lib/src/presentation/widgets/stream_elements/se_song_requests.dart @@ -56,10 +56,9 @@ class SeSongRequests extends GetView { const Padding( padding: EdgeInsets.only(top: 10), ), - Text( + const Text( 'Now Playing', style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, fontWeight: FontWeight.bold, ), ), @@ -72,18 +71,14 @@ class SeSongRequests extends GetView { RichText( overflow: TextOverflow.ellipsis, text: TextSpan(children: [ - TextSpan( + const TextSpan( text: "Queue ", style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, fontWeight: FontWeight.bold, ), ), TextSpan( text: "(${controller.songRequestQueue.length} videos)", - style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, - ), ), ]), ), @@ -127,22 +122,17 @@ class SeSongRequests extends GetView { children: [ TextSpan( text: song.channel, - style: TextStyle( + style: const TextStyle( fontWeight: FontWeight.bold, - color: Theme.of(context).textTheme.bodyLarge!.color, ), ), - TextSpan( + const TextSpan( text: " - ", - style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, - ), + style: TextStyle(), ), TextSpan( text: song.title, - style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, - ), + style: const TextStyle(), ) ], ), @@ -150,24 +140,18 @@ class SeSongRequests extends GetView { RichText( overflow: TextOverflow.ellipsis, text: TextSpan(children: [ - TextSpan( + const TextSpan( text: "Duration: ", - style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, - ), + style: TextStyle(), ), TextSpan( text: song.duration.toString(), - style: TextStyle( + style: const TextStyle( fontWeight: FontWeight.bold, - color: Theme.of(context).textTheme.bodyLarge!.color, ), ), - TextSpan( + const TextSpan( text: "s", - style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, - ), ), ]), ), diff --git a/lib/src/presentation/widgets/tabs/obs_tab_view.dart b/lib/src/presentation/widgets/tabs/obs_tab_view.dart index ead00d56..3396e205 100644 --- a/lib/src/presentation/widgets/tabs/obs_tab_view.dart +++ b/lib/src/presentation/widgets/tabs/obs_tab_view.dart @@ -162,10 +162,6 @@ class ObsTabView extends GetView { // ), Divider( height: 40, - thickness: 4, - indent: 0, - endIndent: 0, - color: Theme.of(context).colorScheme.secondary, ), Wrap(children: [ Text( @@ -179,12 +175,8 @@ class ObsTabView extends GetView { child: getScenes(), ), ]), - Divider( + const Divider( height: 40, - thickness: 4, - indent: 0, - endIndent: 0, - color: Theme.of(context).colorScheme.secondary, ), Wrap(children: [ Text( diff --git a/lib/src/presentation/widgets/tabs/twitch_tab_view.dart b/lib/src/presentation/widgets/tabs/twitch_tab_view.dart index b330f7a6..7f01655a 100644 --- a/lib/src/presentation/widgets/tabs/twitch_tab_view.dart +++ b/lib/src/presentation/widgets/tabs/twitch_tab_view.dart @@ -64,12 +64,6 @@ class TwitchTabView extends GetView { controller.twitchStreamInfos.value.isOnline! ? "live".tr : "offline".tr, - style: TextStyle( - color: Theme.of(Get.context!) - .textTheme - .bodyLarge! - .color, - ), ), ], ), @@ -126,16 +120,12 @@ class TwitchTabView extends GetView { horizontal: 8, vertical: 7), hintText: 'Your stream\'s title', labelText: 'stream_title'.tr, - labelStyle: TextStyle( - color: Theme.of(context).colorScheme.tertiary, - ), ), ), ), ), TextButton( style: TextButton.styleFrom( - textStyle: const TextStyle(fontSize: 11), backgroundColor: Colors.deepPurpleAccent, fixedSize: const Size(50, 20), ), @@ -152,17 +142,12 @@ class TwitchTabView extends GetView { ), ], ), - Divider( + const Divider( height: 40, - thickness: 4, - indent: 0, - endIndent: 0, - color: Theme.of(context).colorScheme.secondary, ), Text( "shortcuts".tr, - style: TextStyle( - color: Theme.of(Get.context!).textTheme.bodyLarge!.color, + style: const TextStyle( fontSize: 16, fontWeight: FontWeight.bold, ), @@ -214,12 +199,8 @@ class TwitchTabView extends GetView { ), ], ), - Divider( + const Divider( height: 40, - thickness: 4, - indent: 0, - endIndent: 0, - color: Theme.of(context).colorScheme.secondary, ), _shortcutButton( onTap: () { @@ -274,12 +255,8 @@ class TwitchTabView extends GetView { context: context, isOn: false, ), - Divider( + const Divider( height: 40, - thickness: 4, - indent: 0, - endIndent: 0, - color: Theme.of(context).colorScheme.secondary, ), Get.find().twitchEventSub != null ? prediction( @@ -288,12 +265,8 @@ class TwitchTabView extends GetView { controller.twitchEventSub!.currentPrediction.value, ) : Container(), - Divider( + const Divider( height: 40, - thickness: 4, - indent: 0, - endIndent: 0, - color: Theme.of(context).colorScheme.secondary, ), controller.twitchEventSub != null ? poll( From 81035aab7cf2261c20daad9ff084e84cc14c5be7 Mon Sep 17 00:00:00 2001 From: LezdCS Date: Wed, 5 Jun 2024 11:42:38 +0900 Subject: [PATCH 4/6] Theme improvment and fixes --- lib/src/core/resources/themes.dart | 18 +++++++++++++++ lib/src/presentation/views/login_view.dart | 1 - .../chat_message/shared/author_name.dart | 4 ++-- .../chats/chat_message/shared/word.dart | 4 ++-- .../settings/dashboard_settings_view.dart | 3 --- .../dialogs/in_app_purchase_dialog.dart | 14 +++++------ .../settings/manage_list_browser_tabs.dart | 23 ------------------- .../settings/manage_list_hidden_users.dart | 12 +++------- .../widgets/settings/obs_settings.dart | 6 ----- .../widgets/settings/stream_elements.dart | 16 ++----------- .../widgets/settings/subscription.dart | 4 +--- .../presentation/widgets/settings/tts.dart | 17 ++------------ .../stream_elements/se_activities_list.dart | 8 +++---- .../stream_elements/se_song_requests.dart | 12 +++++----- .../widgets/tabs/twitch_tab_view.dart | 7 ------ 15 files changed, 46 insertions(+), 103 deletions(-) diff --git a/lib/src/core/resources/themes.dart b/lib/src/core/resources/themes.dart index 0b36a684..f17f4cea 100644 --- a/lib/src/core/resources/themes.dart +++ b/lib/src/core/resources/themes.dart @@ -42,6 +42,15 @@ class Themes { unselectedLabelColor: Colors.white, dividerColor: Colors.transparent, ), + appBarTheme: const AppBarTheme( + titleTextStyle: TextStyle( + color: Colors.white, + fontSize: 18, + ), + iconTheme: IconThemeData( + color: Colors.white, + ), + ), dividerTheme: const DividerThemeData( thickness: 2, indent: 0, @@ -133,6 +142,15 @@ class Themes { unselectedLabelColor: Colors.black, dividerColor: Colors.transparent, ), + appBarTheme: const AppBarTheme( + titleTextStyle: TextStyle( + color: Colors.black, + fontSize: 18, + ), + iconTheme: IconThemeData( + color: Colors.black, + ), + ), dividerTheme: const DividerThemeData( thickness: 2, indent: 0, diff --git a/lib/src/presentation/views/login_view.dart b/lib/src/presentation/views/login_view.dart index b611def2..c10b7084 100644 --- a/lib/src/presentation/views/login_view.dart +++ b/lib/src/presentation/views/login_view.dart @@ -70,7 +70,6 @@ class LoginView extends GetView { child: Obx( () => Text( controller.loadingMessage.value, - style: Theme.of(context).textTheme.bodyLarge, ), ), ), diff --git a/lib/src/presentation/widgets/chats/chat_message/shared/author_name.dart b/lib/src/presentation/widgets/chats/chat_message/shared/author_name.dart index db7603aa..39c591a2 100644 --- a/lib/src/presentation/widgets/chats/chat_message/shared/author_name.dart +++ b/lib/src/presentation/widgets/chats/chat_message/shared/author_name.dart @@ -21,8 +21,8 @@ class AuthorName extends StatelessWidget { @override Widget build(BuildContext context) { - return RichText( - text: TextSpan( + return Text.rich( + TextSpan( text: username != displayName.toLowerCase() ? username : displayName, style: TextStyle( color: Color(int.parse(color.replaceAll('#', '0xff'))), diff --git a/lib/src/presentation/widgets/chats/chat_message/shared/word.dart b/lib/src/presentation/widgets/chats/chat_message/shared/word.dart index b7c910cb..c79a05a1 100644 --- a/lib/src/presentation/widgets/chats/chat_message/shared/word.dart +++ b/lib/src/presentation/widgets/chats/chat_message/shared/word.dart @@ -31,8 +31,8 @@ class Word extends StatelessWidget { fontStyle: isAction ? FontStyle.italic : FontStyle.normal, ), ) - : RichText( - text: TextSpan( + : Text.rich( + TextSpan( text: "$word ", style: TextStyle( color: Colors.lightBlue, diff --git a/lib/src/presentation/widgets/settings/dashboard_settings_view.dart b/lib/src/presentation/widgets/settings/dashboard_settings_view.dart index 04825f63..deaec37a 100644 --- a/lib/src/presentation/widgets/settings/dashboard_settings_view.dart +++ b/lib/src/presentation/widgets/settings/dashboard_settings_view.dart @@ -151,9 +151,6 @@ class DashboardSettingsView extends GetView { title: "New event".tr, cancel: null, confirm: Container(), - titleStyle: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, - ), backgroundColor: Theme.of(context).colorScheme.surface, buttonColor: const Color(0xFF9147ff), cancelTextColor: const Color(0xFF9147ff), diff --git a/lib/src/presentation/widgets/settings/dialogs/in_app_purchase_dialog.dart b/lib/src/presentation/widgets/settings/dialogs/in_app_purchase_dialog.dart index 7069a8bd..9c5b4d63 100644 --- a/lib/src/presentation/widgets/settings/dialogs/in_app_purchase_dialog.dart +++ b/lib/src/presentation/widgets/settings/dialogs/in_app_purchase_dialog.dart @@ -54,10 +54,10 @@ Widget inAppPurchaseDialog( Radius.circular(8), ), ), - child: Column( + child: const Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - const Text( + Text( 'StreamElements', style: TextStyle(fontSize: 14, fontWeight: FontWeight.bold), @@ -65,24 +65,22 @@ Widget inAppPurchaseDialog( Wrap( crossAxisAlignment: WrapCrossAlignment.center, children: [ - const Icon( + Icon( Icons.check_circle_outline_rounded, size: 18, color: Colors.green, ), - const SizedBox( + SizedBox( width: 4, ), Text( 'Events list view', style: TextStyle( - color: - Theme.of(context).textTheme.bodyLarge!.color, fontSize: 13), ) ], ), - const Wrap( + Wrap( crossAxisAlignment: WrapCrossAlignment.center, children: [ Icon( @@ -101,7 +99,7 @@ Widget inAppPurchaseDialog( ) ], ), - const Wrap( + Wrap( crossAxisAlignment: WrapCrossAlignment.center, children: [ Icon( diff --git a/lib/src/presentation/widgets/settings/manage_list_browser_tabs.dart b/lib/src/presentation/widgets/settings/manage_list_browser_tabs.dart index 788e932d..ef5f8793 100644 --- a/lib/src/presentation/widgets/settings/manage_list_browser_tabs.dart +++ b/lib/src/presentation/widgets/settings/manage_list_browser_tabs.dart @@ -94,12 +94,6 @@ class ManageListBrowserTabs extends GetView { child: ListTile( title: Text( elem['title'], - style: TextStyle( - color: Theme.of(context) - .textTheme - .bodyLarge! - .color, - ), ), trailing: !controller.browserTabsSelected .contains(elem) @@ -118,12 +112,6 @@ class ManageListBrowserTabs extends GetView { title: 'Edit', textCancel: "cancel".tr, textConfirm: "confirm".tr, - titleStyle: TextStyle( - color: Theme.of(context) - .textTheme - .bodyLarge! - .color, - ), backgroundColor: Theme.of(context) .colorScheme .surface, @@ -149,12 +137,6 @@ class ManageListBrowserTabs extends GetView { title: 'Delete', textCancel: "cancel".tr, textConfirm: "confirm".tr, - titleStyle: TextStyle( - color: Theme.of(context) - .textTheme - .bodyLarge! - .color, - ), backgroundColor: Theme.of(context) .colorScheme .surface, @@ -280,9 +262,6 @@ Widget _addDialog(context, SettingsViewController controller) { child: TextFormField( controller: controller.addBrowserUrlController, textInputAction: TextInputAction.send, - style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, - ), maxLines: 1, textCapitalization: TextCapitalization.none, validator: (value) { @@ -359,7 +338,6 @@ Widget _editDialog(context, SettingsViewController controller, elem) { child: TextFormField( controller: controller.addBrowserTitleController, textInputAction: TextInputAction.send, - style: Theme.of(context).textTheme.bodyLarge, maxLines: 1, validator: (value) { if (value == null || value.isEmpty) { @@ -384,7 +362,6 @@ Widget _editDialog(context, SettingsViewController controller, elem) { child: TextFormField( controller: controller.addBrowserUrlController, textInputAction: TextInputAction.send, - style: Theme.of(context).textTheme.bodyLarge, maxLines: 1, textCapitalization: TextCapitalization.none, validator: (value) { diff --git a/lib/src/presentation/widgets/settings/manage_list_hidden_users.dart b/lib/src/presentation/widgets/settings/manage_list_hidden_users.dart index 23e12870..9c33f8a6 100644 --- a/lib/src/presentation/widgets/settings/manage_list_hidden_users.dart +++ b/lib/src/presentation/widgets/settings/manage_list_hidden_users.dart @@ -52,20 +52,14 @@ class ManageListHiddenUsers extends GetView { .hiddenUsersIds!.length ? Container( padding: const EdgeInsets.only(top: 20), - child: Column( + child: const Column( children: [ - const CircularProgressIndicator(), - const SizedBox( + CircularProgressIndicator(), + SizedBox( height: 10, ), Text( "Loading...", - style: TextStyle( - color: Theme.of(context) - .textTheme - .bodyLarge! - .color, - ), ), ], ), diff --git a/lib/src/presentation/widgets/settings/obs_settings.dart b/lib/src/presentation/widgets/settings/obs_settings.dart index 7af4338d..db6e87cc 100644 --- a/lib/src/presentation/widgets/settings/obs_settings.dart +++ b/lib/src/presentation/widgets/settings/obs_settings.dart @@ -37,9 +37,6 @@ class ObsSettings extends StatelessWidget { .copyWith(obsWebsocketUrl: value); controller.saveSettings(); }, - style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, - ), decoration: InputDecoration( isDense: true, contentPadding: const EdgeInsets.symmetric( @@ -78,9 +75,6 @@ class ObsSettings extends StatelessWidget { .copyWith(obsWebsocketPassword: value); controller.saveSettings(); }, - style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, - ), decoration: InputDecoration( isDense: true, contentPadding: const EdgeInsets.symmetric( diff --git a/lib/src/presentation/widgets/settings/stream_elements.dart b/lib/src/presentation/widgets/settings/stream_elements.dart index e5edb707..fd228f66 100644 --- a/lib/src/presentation/widgets/settings/stream_elements.dart +++ b/lib/src/presentation/widgets/settings/stream_elements.dart @@ -97,12 +97,6 @@ class StreamElements extends GetView { ); controller.saveSettings(); }, - style: TextStyle( - color: Theme.of(context) - .textTheme - .bodyLarge! - .color, - ), decoration: InputDecoration( isDense: true, contentPadding: const EdgeInsets.symmetric( @@ -165,12 +159,6 @@ class StreamElements extends GetView { ); controller.saveSettings(); }, - style: TextStyle( - color: Theme.of(context) - .textTheme - .bodyLarge! - .color, - ), decoration: InputDecoration( isDense: true, contentPadding: const EdgeInsets.symmetric( @@ -291,9 +279,9 @@ class StreamElements extends GetView { } Widget _jwtExplanation(BuildContext context) { - return RichText( + return Text.rich( textAlign: TextAlign.center, - text: TextSpan( + TextSpan( children: [ const TextSpan( text: 'To get your Access Token ', diff --git a/lib/src/presentation/widgets/settings/subscription.dart b/lib/src/presentation/widgets/settings/subscription.dart index 474b1ac9..0b8ff486 100644 --- a/lib/src/presentation/widgets/settings/subscription.dart +++ b/lib/src/presentation/widgets/settings/subscription.dart @@ -66,9 +66,7 @@ class Subscription extends StatelessWidget { ), child: Text( "Only $price", - style: TextStyle( - color: Theme.of(context).textTheme.bodyLarge!.color, - fontSize: 13), + style: const TextStyle(fontSize: 13), textAlign: TextAlign.center, ), ), diff --git a/lib/src/presentation/widgets/settings/tts.dart b/lib/src/presentation/widgets/settings/tts.dart index ff1b6783..30696134 100644 --- a/lib/src/presentation/widgets/settings/tts.dart +++ b/lib/src/presentation/widgets/settings/tts.dart @@ -395,11 +395,7 @@ class Tts extends StatelessWidget { children: [ Text( "prefixs_ignored".tr, - style: TextStyle( - color: Theme.of(context) - .textTheme - .bodyLarge! - .color, + style: const TextStyle( fontSize: 18, ), ), @@ -487,11 +483,7 @@ class Tts extends StatelessWidget { children: [ Text( "prefixs_allowed".tr, - style: TextStyle( - color: Theme.of(context) - .textTheme - .bodyLarge! - .color, + style: const TextStyle( fontSize: 18, ), ), @@ -689,11 +681,6 @@ class Tts extends StatelessWidget { }, child: Text( "add".tr, - style: TextStyle( - color: Theme.of(Get.context!) - .textTheme - .bodyLarge! - .color), ), ), ), diff --git a/lib/src/presentation/widgets/stream_elements/se_activities_list.dart b/lib/src/presentation/widgets/stream_elements/se_activities_list.dart index 1b6077a3..ae8d8106 100644 --- a/lib/src/presentation/widgets/stream_elements/se_activities_list.dart +++ b/lib/src/presentation/widgets/stream_elements/se_activities_list.dart @@ -242,9 +242,9 @@ Widget _activityCollapsed( activity.getIcon(), const SizedBox(width: 4), Expanded( - child: RichText( + child: Text.rich( overflow: TextOverflow.ellipsis, - text: TextSpan( + TextSpan( children: [ TextSpan( text: activity.textFromEnum(), @@ -301,8 +301,8 @@ Widget _activityExpanded( activity.getIcon(), const SizedBox(width: 4), Expanded( - child: RichText( - text: TextSpan(children: [ + child: Text.rich( + TextSpan(children: [ TextSpan( text: activity.textFromEnum(), style: TextStyle( diff --git a/lib/src/presentation/widgets/stream_elements/se_song_requests.dart b/lib/src/presentation/widgets/stream_elements/se_song_requests.dart index 65d39f13..39785205 100644 --- a/lib/src/presentation/widgets/stream_elements/se_song_requests.dart +++ b/lib/src/presentation/widgets/stream_elements/se_song_requests.dart @@ -68,9 +68,9 @@ class SeSongRequests extends GetView { const Padding( padding: EdgeInsets.only(bottom: 15), ), - RichText( + Text.rich( overflow: TextOverflow.ellipsis, - text: TextSpan(children: [ + TextSpan(children: [ const TextSpan( text: "Queue ", style: TextStyle( @@ -116,9 +116,9 @@ class SeSongRequests extends GetView { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - RichText( + Text.rich( overflow: TextOverflow.ellipsis, - text: TextSpan( + TextSpan( children: [ TextSpan( text: song.channel, @@ -137,9 +137,9 @@ class SeSongRequests extends GetView { ], ), ), - RichText( + Text.rich( overflow: TextOverflow.ellipsis, - text: TextSpan(children: [ + TextSpan(children: [ const TextSpan( text: "Duration: ", style: TextStyle(), diff --git a/lib/src/presentation/widgets/tabs/twitch_tab_view.dart b/lib/src/presentation/widgets/tabs/twitch_tab_view.dart index 7f01655a..e6f77cc4 100644 --- a/lib/src/presentation/widgets/tabs/twitch_tab_view.dart +++ b/lib/src/presentation/widgets/tabs/twitch_tab_view.dart @@ -93,12 +93,6 @@ class TwitchTabView extends GetView { ), Text( "viewers".tr, - style: TextStyle( - color: Theme.of(Get.context!) - .textTheme - .bodyLarge! - .color, - ), ), ], ), @@ -114,7 +108,6 @@ class TwitchTabView extends GetView { child: TextFormField( controller: controller.titleFormController, focusNode: controller.focus, - style: Theme.of(Get.context!).textTheme.bodyLarge, decoration: InputDecoration( contentPadding: const EdgeInsets.symmetric( horizontal: 8, vertical: 7), From 90d39ab757d1f3ee5c33ad28548181fa9f0ec910 Mon Sep 17 00:00:00 2001 From: LezdCS Date: Wed, 5 Jun 2024 12:10:56 +0900 Subject: [PATCH 5/6] Fix SE inputs --- lib/src/core/resources/themes.dart | 6 ++++++ .../widgets/settings/obs_settings.dart | 8 -------- .../widgets/settings/stream_elements.dart | 16 +++++++++------- .../widgets/tabs/twitch_tab_view.dart | 6 ++++-- 4 files changed, 19 insertions(+), 17 deletions(-) diff --git a/lib/src/core/resources/themes.dart b/lib/src/core/resources/themes.dart index f17f4cea..682b9365 100644 --- a/lib/src/core/resources/themes.dart +++ b/lib/src/core/resources/themes.dart @@ -64,6 +64,9 @@ class Themes { fontSize: 12, ), ), + foregroundColor: WidgetStatePropertyAll( + Colors.white + ), ), ), switchTheme: SwitchThemeData( @@ -164,6 +167,9 @@ class Themes { fontSize: 12, ), ), + foregroundColor: WidgetStatePropertyAll( + Colors.white + ), ), ), switchTheme: SwitchThemeData( diff --git a/lib/src/presentation/widgets/settings/obs_settings.dart b/lib/src/presentation/widgets/settings/obs_settings.dart index db6e87cc..09da049f 100644 --- a/lib/src/presentation/widgets/settings/obs_settings.dart +++ b/lib/src/presentation/widgets/settings/obs_settings.dart @@ -108,7 +108,6 @@ class ObsSettings extends StatelessWidget { onPressed: () { MobileScannerController cameraController = MobileScannerController(); - Get.dialog( _qrPasswordScanner( cameraController, @@ -116,7 +115,6 @@ class ObsSettings extends StatelessWidget { context, ), ); - FocusManager.instance.primaryFocus?.unfocus(); }, child: Row( @@ -124,9 +122,6 @@ class ObsSettings extends StatelessWidget { children: [ Text( 'scan_qr'.tr, - style: const TextStyle( - color: Colors.white, - ), ), const SizedBox(width: 5), const Icon(Icons.qr_code, color: Colors.white), @@ -159,9 +154,6 @@ class ObsSettings extends StatelessWidget { children: [ Text( 'history'.tr, - style: const TextStyle( - color: Colors.white, - ), ), const SizedBox(width: 10), const Icon(Icons.history, color: Colors.white), diff --git a/lib/src/presentation/widgets/settings/stream_elements.dart b/lib/src/presentation/widgets/settings/stream_elements.dart index fd228f66..e09cbc06 100644 --- a/lib/src/presentation/widgets/settings/stream_elements.dart +++ b/lib/src/presentation/widgets/settings/stream_elements.dart @@ -113,16 +113,16 @@ class StreamElements extends GetView { ), suffixIcon: IconButton( icon: Icon( - controller.obsWebsocketUrlShow.value + controller.seJwtShow.value ? Icons.visibility : Icons.visibility_off), color: Theme.of(context) .primaryIconTheme .color, onPressed: () { - controller.obsWebsocketUrlShow.value = + controller.seJwtShow.value = !controller - .obsWebsocketUrlShow.value; + .seJwtShow.value; }, ), ), @@ -175,16 +175,16 @@ class StreamElements extends GetView { ), suffixIcon: IconButton( icon: Icon( - controller.obsWebsocketUrlShow.value + controller.seOverlayTokenShow.value ? Icons.visibility : Icons.visibility_off), color: Theme.of(context) .primaryIconTheme .color, onPressed: () { - controller.obsWebsocketUrlShow.value = + controller.seOverlayTokenShow.value = !controller - .obsWebsocketUrlShow.value; + .seOverlayTokenShow.value; }, ), ), @@ -226,7 +226,9 @@ class StreamElements extends GetView { ), Text( 'Logout', - style: TextStyle(fontSize: 16), + style: TextStyle( + fontSize: 16, + ), ), ], ), diff --git a/lib/src/presentation/widgets/tabs/twitch_tab_view.dart b/lib/src/presentation/widgets/tabs/twitch_tab_view.dart index e6f77cc4..c3a10490 100644 --- a/lib/src/presentation/widgets/tabs/twitch_tab_view.dart +++ b/lib/src/presentation/widgets/tabs/twitch_tab_view.dart @@ -110,7 +110,9 @@ class TwitchTabView extends GetView { focusNode: controller.focus, decoration: InputDecoration( contentPadding: const EdgeInsets.symmetric( - horizontal: 8, vertical: 7), + horizontal: 8, + vertical: 7, + ), hintText: 'Your stream\'s title', labelText: 'stream_title'.tr, ), @@ -120,7 +122,7 @@ class TwitchTabView extends GetView { TextButton( style: TextButton.styleFrom( backgroundColor: Colors.deepPurpleAccent, - fixedSize: const Size(50, 20), + fixedSize: const Size(80, 20), ), onPressed: () { controller.setStreamTitle(); From 9b824642af787876717af96f51e5362a5d5946e4 Mon Sep 17 00:00:00 2001 From: LezdCS Date: Wed, 5 Jun 2024 12:15:07 +0900 Subject: [PATCH 6/6] Add more details in some texts --- .../widgets/settings/chats_joined.dart | 27 +++++++++++++++---- .../settings/manage_list_hidden_users.dart | 3 ++- 2 files changed, 24 insertions(+), 6 deletions(-) diff --git a/lib/src/presentation/widgets/settings/chats_joined.dart b/lib/src/presentation/widgets/settings/chats_joined.dart index 98ba1611..4683d296 100644 --- a/lib/src/presentation/widgets/settings/chats_joined.dart +++ b/lib/src/presentation/widgets/settings/chats_joined.dart @@ -40,17 +40,34 @@ class ChatsJoined extends GetView { Container( color: Theme.of(context).colorScheme.secondary, padding: const EdgeInsets.only( - left: 20, right: 20, bottom: 10, top: 10), - margin: const EdgeInsets.only(bottom: 5, top: 5), + left: 20, + right: 20, + bottom: 10, + top: 10, + ), + margin: const EdgeInsets.only( + bottom: 5, + top: 5, + ), child: InkWell( onTap: () {}, child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.spaceBetween, + crossAxisAlignment: CrossAxisAlignment.center, children: [ + const Image( + width: 18, + height: 18, + image: AssetImage( + "lib/assets/twitch/twitch_logo.png", + ), + filterQuality: FilterQuality.high, + ), + const SizedBox( + width: 8, + ), Text( controller.homeViewController.twitchData?.twitchUser - .login ?? + .displayName ?? '', style: const TextStyle( fontSize: 20, diff --git a/lib/src/presentation/widgets/settings/manage_list_hidden_users.dart b/lib/src/presentation/widgets/settings/manage_list_hidden_users.dart index 9c33f8a6..c2ddcc7d 100644 --- a/lib/src/presentation/widgets/settings/manage_list_hidden_users.dart +++ b/lib/src/presentation/widgets/settings/manage_list_hidden_users.dart @@ -44,7 +44,8 @@ class ManageListHiddenUsers extends GetView { ? Container( padding: const EdgeInsets.only(top: 20), child: const Text( - "Nothing in the list!", + "Nothing in the list! To add users, select them in a chat and press 'Hide user'", + textAlign: TextAlign.center, ), ) : controller.usernamesHiddenUsers.length !=