Skip to content

Commit

Permalink
Merge pull request #217 from LezdCS/develop
Browse files Browse the repository at this point in the history
2.4.4
  • Loading branch information
LezdCS authored Jul 21, 2024
2 parents e6b66b5 + 5de3c10 commit cd58186
Show file tree
Hide file tree
Showing 11 changed files with 323 additions and 389 deletions.
6 changes: 6 additions & 0 deletions lib/src/core/resources/themes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -257,5 +260,8 @@ class Themes {
// thumbShape: const RoundSliderThumbShape(enabledThumbRadius: 8),
// overlayShape: const RoundSliderOverlayShape(overlayRadius: 16),
),
listTileTheme: const ListTileThemeData(
textColor: Colors.black,
),
);
}
2 changes: 1 addition & 1 deletion lib/src/core/services/realtime_irl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
17 changes: 11 additions & 6 deletions lib/src/presentation/controllers/obs_tab_view_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ class ObsTabViewController extends GetxController {
RxBool isStreaming = false.obs;
RxBool isRecording = false.obs;

RxMap<Map, DateTime> obsData = <Map, DateTime>{}.obs;
Rxn<StatsResponse> statsResponse = Rxn<StatsResponse>();

late HomeViewController homeViewController;

late Timer statsTimer;

@override
void onInit() {
obsData[{}] = DateTime.now();
homeViewController = Get.find<HomeViewController>();

super.onInit();
Expand Down Expand Up @@ -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;
Expand All @@ -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...";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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<String, dynamic> tab = {
'id': uuid.v4(),
'title': title,
'url': url,
'toggled': toggled,
Expand Down
209 changes: 102 additions & 107 deletions lib/src/presentation/views/home_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -242,120 +241,116 @@ class HomeView extends GetView<HomeViewController> {
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<ChatViewController>(
tag: controller
.selectedChatGroup.value?.id);
List<TwitchChat> 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<TwitchTabViewController>().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<ChatViewController>(
tag: controller
.selectedChatGroup.value?.id);
List<TwitchChat> 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<ChatViewController>(
tag:
controller.selectedChatGroup.value?.id);
List<TwitchChat> 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<TwitchTabViewController>().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<ChatViewController>(
tag: controller.selectedChatGroup.value?.id);
List<TwitchChat> 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<TwitchTabViewController>().twitchEventSub != null
? Obx(
() => Visibility(
Expand Down
Loading

0 comments on commit cd58186

Please sign in to comment.