Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.4.4 #217

Merged
merged 9 commits into from
Jul 21, 2024
Merged

2.4.4 #217

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading