From c7649dee0a5c102519054c5ee9c03921d2d0ea4d Mon Sep 17 00:00:00 2001 From: LezdCS Date: Sun, 21 Jul 2024 19:12:04 +0900 Subject: [PATCH 1/9] change refresh data indicator --- .../controllers/obs_tab_view_controller.dart | 17 +- .../widgets/tabs/obs_tab_view.dart | 159 +++--------------- .../widgets/tabs/twitch_tab_view.dart | 43 +++-- 3 files changed, 62 insertions(+), 157 deletions(-) diff --git a/lib/src/presentation/controllers/obs_tab_view_controller.dart b/lib/src/presentation/controllers/obs_tab_view_controller.dart index a063826b..9f339b99 100644 --- a/lib/src/presentation/controllers/obs_tab_view_controller.dart +++ b/lib/src/presentation/controllers/obs_tab_view_controller.dart @@ -30,13 +30,13 @@ class ObsTabViewController extends GetxController { RxBool isStreaming = false.obs; RxBool isRecording = false.obs; - RxMap obsData = {}.obs; + Rxn statsResponse = Rxn(); late HomeViewController homeViewController; - + late Timer statsTimer; + @override void onInit() { - obsData[{}] = DateTime.now(); homeViewController = Get.find(); super.onInit(); @@ -141,8 +141,13 @@ class ObsTabViewController extends GetxController { await obsWebSocket!.record.getRecordStatus(); isRecording.value = recordStatus.outputActive; - // final StatsResponse statsResponse = - // await obsWebSocket!.general.getStats(); + statsResponse.value = await obsWebSocket!.general.getStats(); + statsTimer = Timer.periodic( + const Duration(seconds: 10), + (Timer t) async { + statsResponse.value = await obsWebSocket!.general.getStats(); + }, + ); } catch (e) { alertMessage.value = "Failed to connect to OBS"; isConnected.value = false; @@ -151,7 +156,7 @@ class ObsTabViewController extends GetxController { void connectionLost() { globals.talker?.error("Connection lost with OBS."); - + statsTimer.cancel(); isConnected.value = false; alertMessage.value = "Connection with OBS lost..."; } diff --git a/lib/src/presentation/widgets/tabs/obs_tab_view.dart b/lib/src/presentation/widgets/tabs/obs_tab_view.dart index 9cc42bde..d4bfde59 100644 --- a/lib/src/presentation/widgets/tabs/obs_tab_view.dart +++ b/lib/src/presentation/widgets/tabs/obs_tab_view.dart @@ -137,29 +137,6 @@ class ObsTabView extends GetView { ], ), ), - // SizedBox(height: 10), - // Row( - // children: [ - // Container( - // constraints: BoxConstraints( - // minWidth: 80.0, - // ), - // alignment: Alignment.center, - // decoration: BoxDecoration( - // color: - // Theme.of(context).colorScheme.tertiaryContainer, - // borderRadius: BorderRadius.all( - // Radius.circular(8), - // ), - // ), - // padding: EdgeInsets.all(8), - // child: Text( - // "Show advanced stats", - // textAlign: TextAlign.center, - // ), - // ), - // ], - // ), const Divider( height: 40, ), @@ -189,20 +166,26 @@ class ObsTabView extends GetView { child: getSources(context), ), ]), - // Divider( - // height: 40, - // thickness: 4, - // indent: 0, - // endIndent: 0, - // color: Theme.of(context).colorScheme.secondary, - // ), - // Wrap(children: [ - // Text( - // "CPU Usage", - // style: TextStyle(color: Colors.white), - // ), - // _cpuGraph(width), - // ]), + Divider( + height: 40, + thickness: 4, + indent: 0, + endIndent: 0, + color: Theme.of(context).colorScheme.secondary, + ), + Column( + children: [ + Text( + 'CPU usage: ${controller.statsResponse.value?.cpuUsage.toStringAsFixed(2)}', + ), + Text( + 'Memory usage: ${controller.statsResponse.value?.memoryUsage.toStringAsFixed(2)}', + ), + Text( + 'Avaibalable disk space: ${controller.statsResponse.value?.availableDiskSpace.toStringAsFixed(2)}', + ), + ], + ), ], ), ) @@ -366,105 +349,3 @@ class ObsTabView extends GetView { ); } } -// -// Widget leftTitleWidgetsCpu(double value, TitleMeta meta) { -// const style = TextStyle( -// color: Color(0xff75729e), -// fontWeight: FontWeight.normal, -// fontSize: 12, -// ); -// -// return Container( -// padding: const EdgeInsets.only(right: 6), -// child: Text(value.round().toString() + "%", -// style: style, textAlign: TextAlign.right), -// ); -// } -// -// Widget bottomTitleWidgetsHours(double value, TitleMeta meta) { -// const style = TextStyle( -// color: Color(0xff75729e), -// fontWeight: FontWeight.normal, -// fontSize: 12, -// ); -// -// return Container( -// padding: const EdgeInsets.only(top: 6), -// child: Text("4:30", style: style, textAlign: TextAlign.center), -// ); -// } -// -// Widget _cpuGraph(double width) { -// -// List spots = [ -// FlSpot(1, 1), -// FlSpot(3, 20), -// FlSpot(5, 30), -// FlSpot(7, 30), -// FlSpot(10, 40), -// FlSpot(12, 29), -// FlSpot(13, 60), -// ]; -// -// return Container( -// margin: EdgeInsets.only(top: 10), -// width: width, -// height: 200, -// child: LineChart( -// //TODO : https://github.com/imaNNeoFighT/fl_chart/blob/master/example/lib/line_chart/samples/line_chart_sample1.dart -// LineChartData( -// lineTouchData: LineTouchData( -// handleBuiltInTouches: true, -// touchTooltipData: LineTouchTooltipData( -// tooltipBgColor: Colors.blueGrey.withOpacity(0.8), -// ), -// ), -// gridData: FlGridData(show: false), -// titlesData: FlTitlesData( -// leftTitles: AxisTitles( -// sideTitles: SideTitles( -// getTitlesWidget: leftTitleWidgetsCpu, -// showTitles: true, -// interval: 20, -// reservedSize: 40, -// ), -// ), -// bottomTitles: AxisTitles( -// sideTitles: SideTitles( -// getTitlesWidget: bottomTitleWidgetsHours, -// showTitles: true, -// interval: 9, -// reservedSize: 40, -// ), -// ), -// topTitles: AxisTitles(), -// rightTitles: AxisTitles(), -// ), -// borderData: FlBorderData( -// show: true, -// border: Border( -// bottom: BorderSide(color: Color(0xff4e4965), width: 1), -// left: BorderSide(color: Color(0xff4e4965), width: 1), -// right: BorderSide(color: Colors.transparent), -// top: BorderSide(color: Colors.transparent), -// ), -// ), -// lineBarsData: [ -// LineChartBarData( -// isCurved: false, -// color: Colors.purple, -// barWidth: 2, -// isStrokeCapRound: true, -// dotData: FlDotData(show: false), -// belowBarData: BarAreaData(show: false), -// spots: spots, -// ), -// ], -// minX: 0, -// maxX: 60, -// maxY: 100, -// minY: 0, -// ), -// ), -// ); -// } diff --git a/lib/src/presentation/widgets/tabs/twitch_tab_view.dart b/lib/src/presentation/widgets/tabs/twitch_tab_view.dart index c3a10490..f7ed2a72 100644 --- a/lib/src/presentation/widgets/tabs/twitch_tab_view.dart +++ b/lib/src/presentation/widgets/tabs/twitch_tab_view.dart @@ -35,18 +35,37 @@ class TwitchTabView extends GetView { isProgress: false, ), ), - Padding( - padding: const EdgeInsets.only(bottom: 8.0), - child: LinearPercentIndicator( - animation: true, - animateFromLastPercent: true, - barRadius: const Radius.circular(8), - padding: const EdgeInsets.symmetric(horizontal: 0.0), - lineHeight: 3.0, - percent: controller.myDuration.value.inSeconds / 15, - backgroundColor: Theme.of(context).colorScheme.secondary, - progressColor: Theme.of(context).colorScheme.tertiary, - ), + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + SizedBox( + width: 14, + height: 14, + child: CircularProgressIndicator( + value: controller.myDuration.value.inSeconds / 15, + backgroundColor: + Theme.of(context).colorScheme.secondary, + valueColor: AlwaysStoppedAnimation( + Theme.of(context).colorScheme.tertiary), + strokeWidth: 2, + strokeCap: StrokeCap.round, + semanticsLabel: + 'Progress indicator for twitch data refresh', + semanticsValue: + (controller.myDuration.value.inSeconds / 15) + .toString(), + ), + ), + const SizedBox( + width: 10, + ), + const Text( + 'Refresh data', + style: TextStyle( + fontSize: 8, + ), + ), + ], ), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, From 9e0cd29811c52d8cd6cf45982a9ea06d90f93a31 Mon Sep 17 00:00:00 2001 From: LezdCS Date: Sun, 21 Jul 2024 20:59:46 +0900 Subject: [PATCH 2/9] add 'Welcome to --- chatroom' --- lib/src/presentation/views/home_view.dart | 209 +++++++++--------- .../presentation/widgets/chats/chat_view.dart | 133 ++++++----- 2 files changed, 177 insertions(+), 165 deletions(-) diff --git a/lib/src/presentation/views/home_view.dart b/lib/src/presentation/views/home_view.dart index cfe9f18d..668aef7a 100644 --- a/lib/src/presentation/views/home_view.dart +++ b/lib/src/presentation/views/home_view.dart @@ -3,7 +3,6 @@ import 'package:flutter/services.dart'; import 'package:flutter_svg/svg.dart'; import 'package:get/get.dart'; import 'package:irllink/routes/app_routes.dart'; -import 'package:irllink/src/domain/entities/chat/chat_message.dart'; import 'package:irllink/src/domain/entities/settings/chat_settings.dart'; import 'package:irllink/src/domain/entities/twitch/twitch_poll.dart'; import 'package:irllink/src/domain/entities/twitch/twitch_prediction.dart'; @@ -242,120 +241,116 @@ class HomeView extends GetView { height: height * 0.06, child: Row( children: [ - controller.selectedChatGroup.value?.channels - .firstWhereOrNull((c) => c.platform == Platform.twitch) == - null - ? Container() - : Expanded( - flex: 5, - child: Stack( - alignment: AlignmentDirectional.center, + Expanded( + flex: 5, + child: Stack( + alignment: AlignmentDirectional.center, + children: [ + SvgPicture.asset( + './lib/assets/chatinput.svg', + semanticsLabel: 'chat input', + fit: BoxFit.fitWidth, + ), + Container( + padding: const EdgeInsets.only(left: 5, right: 5), + child: Row( children: [ - SvgPicture.asset( - './lib/assets/chatinput.svg', - semanticsLabel: 'chat input', - fit: BoxFit.fitWidth, + InkWell( + onTap: () => controller.getEmotes(), + child: const Image( + image: AssetImage("lib/assets/twitchSmileEmoji.png"), + width: 30, + ), ), - Container( - padding: const EdgeInsets.only(left: 5, right: 5), - child: Row( - children: [ - InkWell( - onTap: () => controller.getEmotes(), - child: const Image( - image: AssetImage( - "lib/assets/twitchSmileEmoji.png"), - width: 30, - ), - ), - Expanded( - child: TextField( - controller: controller.chatInputController, - onSubmitted: (String value) { - if (controller.selectedChatGroup.value == - null) return; - ChatViewController chatViewController = - Get.find( - tag: controller - .selectedChatGroup.value?.id); - List twitchChats = []; - twitchChats.addAll( - chatViewController.twitchChats.toList()); - if (twitchChats.length == 1) { - controller.sendChatMessage( - value, twitchChats.first.channel); - controller.chatInputController.text = ''; - FocusScope.of(context).unfocus(); - } else { - selectChatToSend(context, controller, - twitchChats, value); - } - }, - onTap: () { - controller.selectedMessage.value = null; - controller.isPickingEmote.value = false; - }, - textInputAction: TextInputAction.send, - maxLines: 1, - decoration: InputDecoration( - border: InputBorder.none, - hintText: controller.settings.value - .generalSettings!.displayViewerCount - ? '${Get.find().twitchStreamInfos.value.viewerCount} viewers' - : 'send_message'.tr, - hintStyle: TextStyle( - color: Theme.of(context) - .textTheme - .bodyLarge! - .color!, - ), - isDense: true, - enabledBorder: InputBorder.none, - focusedBorder: InputBorder.none, - contentPadding: - const EdgeInsets.only(left: 5), - ), - ), - ), - InkWell( - onTap: () { - if (controller.selectedChatGroup.value == - null) { - return; - } - ChatViewController chatViewController = - Get.find( - tag: controller - .selectedChatGroup.value?.id); - List twitchChats = []; - twitchChats.addAll( - chatViewController.twitchChats.toList()); - if (twitchChats.length == 1) { - controller.sendChatMessage( - controller.chatInputController.text, - twitchChats.first.channel); - controller.chatInputController.text = ''; - FocusScope.of(context).unfocus(); - } else { - selectChatToSend( - context, - controller, - twitchChats, - controller.chatInputController.text); - } - }, - child: Icon( - Icons.send, - color: Theme.of(context).primaryIconTheme.color, - size: 21, - ), + Expanded( + child: TextField( + controller: controller.chatInputController, + onSubmitted: (String value) { + if (controller.selectedChatGroup.value == null) { + return; + } + ChatViewController chatViewController = + Get.find( + tag: + controller.selectedChatGroup.value?.id); + List twitchChats = []; + twitchChats.addAll( + chatViewController.twitchChats.toList()); + if (twitchChats.length == 1) { + controller.sendChatMessage( + value, twitchChats.first.channel); + controller.chatInputController.text = ''; + FocusScope.of(context).unfocus(); + } else { + selectChatToSend( + context, + controller, + twitchChats, + value, + ); + } + }, + onTap: () { + controller.selectedMessage.value = null; + controller.isPickingEmote.value = false; + }, + textInputAction: TextInputAction.send, + maxLines: 1, + decoration: InputDecoration( + border: InputBorder.none, + hintText: controller.settings.value.generalSettings! + .displayViewerCount + ? '${Get.find().twitchStreamInfos.value.viewerCount} viewers' + : 'send_message'.tr, + hintStyle: TextStyle( + color: + Theme.of(context).textTheme.bodyLarge!.color!, ), - ], + isDense: true, + enabledBorder: InputBorder.none, + focusedBorder: InputBorder.none, + contentPadding: const EdgeInsets.only(left: 5), + ), + ), + ), + InkWell( + onTap: () { + if (controller.selectedChatGroup.value == null) { + return; + } + ChatViewController chatViewController = + Get.find( + tag: controller.selectedChatGroup.value?.id); + List twitchChats = []; + twitchChats + .addAll(chatViewController.twitchChats.toList()); + if (twitchChats.length == 1) { + controller.sendChatMessage( + controller.chatInputController.text, + twitchChats.first.channel); + controller.chatInputController.text = ''; + FocusScope.of(context).unfocus(); + } else { + selectChatToSend( + context, + controller, + twitchChats, + controller.chatInputController.text, + ); + } + }, + child: Icon( + Icons.send, + color: Theme.of(context).primaryIconTheme.color, + size: 21, ), ), ], ), ), + ], + ), + ), Get.find().twitchEventSub != null ? Obx( () => Visibility( diff --git a/lib/src/presentation/widgets/chats/chat_view.dart b/lib/src/presentation/widgets/chats/chat_view.dart index 9d81fea5..41a00995 100644 --- a/lib/src/presentation/widgets/chats/chat_view.dart +++ b/lib/src/presentation/widgets/chats/chat_view.dart @@ -74,66 +74,83 @@ class ChatView extends StatelessWidget { decoration: BoxDecoration( color: Theme.of(context).colorScheme.surface, ), - child: ListView.builder( - controller: controller?.scrollController, - itemCount: controller?.chatMessages.length, - itemBuilder: (BuildContext context, int index) { - ChatMessage message = controller!.chatMessages[index]; - return Container( - padding: const EdgeInsets.only(top: 1, bottom: 1), - child: InkWell( - onTap: () { - if (FocusScope.of(context).isFirstFocus) { - FocusScope.of(context).unfocus(); - } - controller!.homeViewController.selectedMessage.value = - null; + child: (controller?.chatMessages.length ?? 0) > 0 + ? ListView.builder( + controller: controller?.scrollController, + itemCount: controller?.chatMessages.length, + itemBuilder: (BuildContext context, int index) { + ChatMessage message = controller!.chatMessages[index]; + return Container( + padding: const EdgeInsets.only(top: 1, bottom: 1), + child: InkWell( + onTap: () { + if (FocusScope.of(context).isFirstFocus) { + FocusScope.of(context).unfocus(); + } + controller!.homeViewController.selectedMessage + .value = null; + }, + onLongPress: () { + controller!.homeViewController.selectedMessage + .value ??= message; + }, + child: message.eventType != null + ? EventContainer( + message: message, + selectedMessage: controller + .homeViewController.selectedMessage.value, + displayTimestamp: controller + .homeViewController + .settings + .value + .displayTimestamp!, + textSize: controller.homeViewController + .settings.value.textSize!, + hideDeletedMessages: controller + .homeViewController + .settings + .value + .chatSettings! + .hideDeletedMessages, + cheerEmotes: controller.cheerEmotes, + thirdPartEmotes: controller.thirdPartEmotes, + showPlatformBadge: multiplePlatform, + ) + : MessageContainer( + selectedMessage: controller + .homeViewController.selectedMessage.value, + message: message, + displayTimestamp: controller + .homeViewController + .settings + .value + .displayTimestamp!, + textSize: controller.homeViewController + .settings.value.textSize!, + hideDeletedMessages: controller + .homeViewController + .settings + .value + .chatSettings! + .hideDeletedMessages, + cheerEmotes: controller.cheerEmotes, + thirdPartEmotes: controller.thirdPartEmotes, + showPlatformBadge: multiplePlatform, + ), + ), + ); }, - onLongPress: () { - controller!.homeViewController.selectedMessage.value ??= - message; - }, - child: message.eventType != null - ? EventContainer( - message: message, - selectedMessage: controller - .homeViewController.selectedMessage.value, - displayTimestamp: controller.homeViewController - .settings.value.displayTimestamp!, - textSize: controller - .homeViewController.settings.value.textSize!, - hideDeletedMessages: controller - .homeViewController - .settings - .value - .chatSettings! - .hideDeletedMessages, - cheerEmotes: controller.cheerEmotes, - thirdPartEmotes: controller.thirdPartEmotes, - showPlatformBadge: multiplePlatform, - ) - : MessageContainer( - selectedMessage: controller - .homeViewController.selectedMessage.value, - message: message, - displayTimestamp: controller.homeViewController - .settings.value.displayTimestamp!, - textSize: controller - .homeViewController.settings.value.textSize!, - hideDeletedMessages: controller - .homeViewController - .settings - .value - .chatSettings! - .hideDeletedMessages, - cheerEmotes: controller.cheerEmotes, - thirdPartEmotes: controller.thirdPartEmotes, - showPlatformBadge: multiplePlatform, - ), + ) + : Padding( + padding: const EdgeInsets.only(left: 8.0), + child: Text( + "Welcome to ${controller?.chatGroup.channels.first.channel} chatroom!", + style: const TextStyle( + color: Colors.grey, + fontSize: 13, + ), + ), ), - ); - }, - ), ), ), Positioned( From 19dfbb10f31df975d36f6747113348ed03ca9a41 Mon Sep 17 00:00:00 2001 From: LezdCS Date: Sun, 21 Jul 2024 21:15:10 +0900 Subject: [PATCH 3/9] themes --- lib/src/core/resources/themes.dart | 6 ++++++ lib/src/presentation/widgets/tabs/twitch_tab_view.dart | 1 - 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/src/core/resources/themes.dart b/lib/src/core/resources/themes.dart index 5477da1f..289f4dc8 100644 --- a/lib/src/core/resources/themes.dart +++ b/lib/src/core/resources/themes.dart @@ -128,6 +128,9 @@ class Themes { // thumbShape: const RoundSliderThumbShape(enabledThumbRadius: 8), // overlayShape: const RoundSliderOverlayShape(overlayRadius: 16), ), + listTileTheme: const ListTileThemeData( + textColor: Colors.white, + ), ); final ThemeData lightTheme = ThemeData.light().copyWith( @@ -257,5 +260,8 @@ class Themes { // thumbShape: const RoundSliderThumbShape(enabledThumbRadius: 8), // overlayShape: const RoundSliderOverlayShape(overlayRadius: 16), ), + listTileTheme: const ListTileThemeData( + textColor: Colors.black, + ), ); } diff --git a/lib/src/presentation/widgets/tabs/twitch_tab_view.dart b/lib/src/presentation/widgets/tabs/twitch_tab_view.dart index f7ed2a72..b277db65 100644 --- a/lib/src/presentation/widgets/tabs/twitch_tab_view.dart +++ b/lib/src/presentation/widgets/tabs/twitch_tab_view.dart @@ -5,7 +5,6 @@ import 'package:irllink/src/presentation/widgets/alert_message_view.dart'; import 'package:irllink/src/presentation/widgets/poll.dart'; import 'package:irllink/src/presentation/widgets/prediction.dart'; import 'package:irllink/src/presentation/widgets/tabs/dialogs/slow_mode_dialog.dart'; -import 'package:percent_indicator/linear_percent_indicator.dart'; import 'package:qr_flutter/qr_flutter.dart'; class TwitchTabView extends GetView { From 358f3fa41cc0925f96db41b7119d4dd987fa9fcd Mon Sep 17 00:00:00 2001 From: LezdCS Date: Sun, 21 Jul 2024 22:54:20 +0900 Subject: [PATCH 4/9] design add button browser tabs --- .../settings/manage_list_browser_tabs.dart | 65 +++++++++---------- 1 file changed, 30 insertions(+), 35 deletions(-) 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 f04d364b..0185f49c 100644 --- a/lib/src/presentation/widgets/settings/manage_list_browser_tabs.dart +++ b/lib/src/presentation/widgets/settings/manage_list_browser_tabs.dart @@ -50,7 +50,6 @@ class ManageListBrowserTabs extends GetView { color: Theme.of(context).colorScheme.surface, ), child: Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Container( child: controller @@ -169,28 +168,19 @@ class ManageListBrowserTabs extends GetView { }, ), ), - Container( - padding: const EdgeInsets.only(bottom: 20), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - Container( - width: 120, - padding: const EdgeInsets.only( - top: 10, - bottom: 10, - left: 5, - right: 5, - ), - decoration: const BoxDecoration( - color: Colors.green, - borderRadius: BorderRadius.all( - Radius.circular(2), - ), - ), - child: InkWell( - onTap: () { - Get.defaultDialog( + _addGroupButton(context, controller), + ], + ), + ), + ), + ); + } +} + +Widget _addGroupButton(BuildContext context, SettingsViewController controller) { + return InkWell( + onTap: () { + Get.defaultDialog( content: _addDialog(context, controller), title: "add".tr, textCancel: "cancel".tr, @@ -205,23 +195,28 @@ class ManageListBrowserTabs extends GetView { controller.addBrowserTab(); }, ); - }, - child: Text( - "add".tr, - textAlign: TextAlign.center, - ), - ), - ), - ], - ), - ), - ], + }, + child: Container( + padding: + const EdgeInsets.only(left: 20, right: 20, bottom: 10, top: 10), + margin: const EdgeInsets.only(left: 12, right: 12), + decoration: BoxDecoration( + border: Border.all( + color: Theme.of(context).colorScheme.secondary, + width: 2, ), + borderRadius: BorderRadius.circular(8), + ), + child: const Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text('New browser tab'), + Icon(Icons.add), + ], ), ), ); } -} Widget _addDialog(context, SettingsViewController controller) { controller.addBrowserUrlController.text = ''; From f85a9a819f5a811e8cc4ed1db3df7916c7177182 Mon Sep 17 00:00:00 2001 From: LezdCS Date: Sun, 21 Jul 2024 23:04:23 +0900 Subject: [PATCH 5/9] new event button rework --- .../settings/dashboard_settings_view.dart | 47 ++++++++++++------- 1 file changed, 30 insertions(+), 17 deletions(-) diff --git a/lib/src/presentation/widgets/settings/dashboard_settings_view.dart b/lib/src/presentation/widgets/settings/dashboard_settings_view.dart index 68662fba..17d0dedf 100644 --- a/lib/src/presentation/widgets/settings/dashboard_settings_view.dart +++ b/lib/src/presentation/widgets/settings/dashboard_settings_view.dart @@ -55,7 +55,6 @@ class DashboardSettingsView extends GetView { color: Theme.of(context).colorScheme.surface, ), child: Column( - mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ ListView.builder( shrinkWrap: true, @@ -134,17 +133,19 @@ class DashboardSettingsView extends GetView { ); }, ), - TextButton( - style: ButtonStyle( - backgroundColor: WidgetStateProperty.all( - Theme.of(context).colorScheme.secondary, - ), - foregroundColor: WidgetStateProperty.all( - Theme.of(context).textTheme.bodyLarge!.color, - ), - ), - onPressed: () { - Get.defaultDialog( + _addGroupButton(context, dashboardController, controller), + ], + ), + ), + ), + ); + } +} + +Widget _addGroupButton(BuildContext context, DashboardController dashboardController, SettingsViewController controller) { + return InkWell( + onTap: () { + Get.defaultDialog( content: _addDialog(context, dashboardController), title: "New event".tr, cancel: null, @@ -158,16 +159,28 @@ class DashboardSettingsView extends GetView { controller.addBrowserTab(); }, ); - }, - child: const Text('New event'), - ) - ], + }, + child: Container( + padding: + const EdgeInsets.only(left: 20, right: 20, bottom: 10, top: 10), + margin: const EdgeInsets.only(left: 12, right: 12), + decoration: BoxDecoration( + border: Border.all( + color: Theme.of(context).colorScheme.secondary, + width: 2, ), + borderRadius: BorderRadius.circular(8), + ), + child: const Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text('New event'), + Icon(Icons.add), + ], ), ), ); } -} Widget _addDialog(context, DashboardController dashboardController) { String title = ''; From 7a93bd70b65b1f07df1ba3edeb6ced7afd53878b Mon Sep 17 00:00:00 2001 From: LezdCS Date: Sun, 21 Jul 2024 23:43:58 +0900 Subject: [PATCH 6/9] fix realtime --- lib/src/core/services/realtime_irl.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/core/services/realtime_irl.dart b/lib/src/core/services/realtime_irl.dart index c3646e42..798292a6 100644 --- a/lib/src/core/services/realtime_irl.dart +++ b/lib/src/core/services/realtime_irl.dart @@ -44,10 +44,10 @@ class RealtimeIrl { try { Response response; Dio dio = initDio(); + status.value = RtIrlStatus.stopped; response = await dio.post( "https://rtirl.com/api/stop?key=$key", ); - status.value = RtIrlStatus.stopped; return DataSuccess(response.data); } on DioException catch (e) { return DataFailed( From 6c17559066db8c0e56e1f9b1bc786cee94394e57 Mon Sep 17 00:00:00 2001 From: LezdCS Date: Sun, 21 Jul 2024 23:51:14 +0900 Subject: [PATCH 7/9] add id to browser tab --- .../controllers/settings_view_controller.dart | 5 ++ .../settings/manage_list_browser_tabs.dart | 75 +++++++++---------- 2 files changed, 42 insertions(+), 38 deletions(-) diff --git a/lib/src/presentation/controllers/settings_view_controller.dart b/lib/src/presentation/controllers/settings_view_controller.dart index 234dcc20..81d846ae 100644 --- a/lib/src/presentation/controllers/settings_view_controller.dart +++ b/lib/src/presentation/controllers/settings_view_controller.dart @@ -8,6 +8,7 @@ import 'package:irllink/src/presentation/controllers/store_controller.dart'; import 'package:irllink/src/presentation/controllers/tts_controller.dart'; import 'package:irllink/src/presentation/events/settings_events.dart'; import 'package:irllink/src/presentation/events/streamelements_events.dart'; +import 'package:uuid/uuid.dart'; import '../../domain/entities/twitch/twitch_user.dart'; @@ -173,7 +174,11 @@ class SettingsViewController extends GetxController { String url = addBrowserUrlController.text; bool toggled = addBrowserToggled.value; bool audioSourceToggled = addBrowserAudioSourceToggled.value; + + var uuid = const Uuid(); + Map tab = { + 'id': uuid.v4(), 'title': title, 'url': url, 'toggled': toggled, 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 0185f49c..006036c7 100644 --- a/lib/src/presentation/widgets/settings/manage_list_browser_tabs.dart +++ b/lib/src/presentation/widgets/settings/manage_list_browser_tabs.dart @@ -177,46 +177,45 @@ class ManageListBrowserTabs extends GetView { } } -Widget _addGroupButton(BuildContext context, SettingsViewController controller) { - return InkWell( - onTap: () { - Get.defaultDialog( - content: _addDialog(context, controller), - title: "add".tr, - textCancel: "cancel".tr, - textConfirm: "add".tr, - backgroundColor: - Theme.of(context).colorScheme.surface, - buttonColor: const Color(0xFF9147ff), - cancelTextColor: const Color(0xFF9147ff), - confirmTextColor: Colors.white, - radius: 10, - onConfirm: () { - controller.addBrowserTab(); - }, - ); - }, - child: Container( - padding: - const EdgeInsets.only(left: 20, right: 20, bottom: 10, top: 10), - margin: const EdgeInsets.only(left: 12, right: 12), - decoration: BoxDecoration( - border: Border.all( - color: Theme.of(context).colorScheme.secondary, - width: 2, - ), - borderRadius: BorderRadius.circular(8), - ), - child: const Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text('New browser tab'), - Icon(Icons.add), - ], +Widget _addGroupButton( + BuildContext context, SettingsViewController controller) { + return InkWell( + onTap: () { + Get.defaultDialog( + content: _addDialog(context, controller), + title: "add".tr, + textCancel: "cancel".tr, + textConfirm: "add".tr, + backgroundColor: Theme.of(context).colorScheme.surface, + buttonColor: const Color(0xFF9147ff), + cancelTextColor: const Color(0xFF9147ff), + confirmTextColor: Colors.white, + radius: 10, + onConfirm: () { + controller.addBrowserTab(); + }, + ); + }, + child: Container( + padding: const EdgeInsets.only(left: 20, right: 20, bottom: 10, top: 10), + margin: const EdgeInsets.only(left: 12, right: 12), + decoration: BoxDecoration( + border: Border.all( + color: Theme.of(context).colorScheme.secondary, + width: 2, ), + borderRadius: BorderRadius.circular(8), ), - ); - } + child: const Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text('New browser tab'), + Icon(Icons.add), + ], + ), + ), + ); +} Widget _addDialog(context, SettingsViewController controller) { controller.addBrowserUrlController.text = ''; From 37d30e3a7f4c6acc53ad94a21875481b8ea7ea50 Mon Sep 17 00:00:00 2001 From: LezdCS Date: Sun, 21 Jul 2024 23:54:31 +0900 Subject: [PATCH 8/9] style --- lib/src/presentation/widgets/tabs/twitch_tab_view.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/presentation/widgets/tabs/twitch_tab_view.dart b/lib/src/presentation/widgets/tabs/twitch_tab_view.dart index b277db65..06c73e4b 100644 --- a/lib/src/presentation/widgets/tabs/twitch_tab_view.dart +++ b/lib/src/presentation/widgets/tabs/twitch_tab_view.dart @@ -61,7 +61,7 @@ class TwitchTabView extends GetView { const Text( 'Refresh data', style: TextStyle( - fontSize: 8, + fontSize: 10, ), ), ], From 5de3c1037ca985c66df43f2604cbbc54c296f3cb Mon Sep 17 00:00:00 2001 From: LezdCS Date: Sun, 21 Jul 2024 23:55:03 +0900 Subject: [PATCH 9/9] 2.4.4 --- pubspec.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pubspec.yaml b/pubspec.yaml index 68eab3d4..1da0721f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # Read more about iOS versioning at # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html -version: 2.4.3+61 +version: 2.4.4+62 environment: sdk: '>=2.19.0-0 <4.0.0'