Skip to content

Commit

Permalink
Merge pull request #199 from LezdCS/develop
Browse files Browse the repository at this point in the history
v2.3.2
  • Loading branch information
LezdCS authored Jun 5, 2024
2 parents 7964f96 + 03fca72 commit cb5a643
Show file tree
Hide file tree
Showing 13 changed files with 64 additions and 29 deletions.
Binary file added lib/assets/irl_link_dark_trans_logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed lib/assets/logo.png
Binary file not shown.
18 changes: 18 additions & 0 deletions lib/src/core/resources/themes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,15 @@ class Themes {
),
),
),
chipTheme: const ChipThemeData(
deleteIconColor: Colors.white,
labelStyle: TextStyle(
color: Colors.white,
),
side: BorderSide(
color: Colors.white,
)
),
switchTheme: SwitchThemeData(
thumbColor: WidgetStateProperty.resolveWith(
(Set<WidgetState> states) {
Expand Down Expand Up @@ -172,6 +181,15 @@ class Themes {
),
),
),
chipTheme: const ChipThemeData(
deleteIconColor: Colors.black,
labelStyle: TextStyle(
color: Colors.black,
),
side: BorderSide(
color: Colors.black,
)
),
switchTheme: SwitchThemeData(
thumbColor: WidgetStateProperty.resolveWith(
(Set<WidgetState> states) {
Expand Down
10 changes: 10 additions & 0 deletions lib/src/domain/entities/settings/chat_settings.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,16 @@ class ChatGroup extends Equatable {
channels,
];
}

ChatGroup copyWith({
String? id,
List<Channel>? channels,
}) {
return ChatGroup(
id: id ?? this.id,
channels: channels ?? this.channels,
);
}
}

class Channel extends Equatable {
Expand Down
14 changes: 8 additions & 6 deletions lib/src/presentation/controllers/login_view_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import 'package:get/get.dart';
import 'package:irllink/routes/app_routes.dart';
import 'package:irllink/src/core/params/twitch_auth_params.dart';
import 'package:flutter/services.dart';
import 'package:irllink/src/core/resources/data_state.dart';
import 'package:irllink/src/domain/entities/twitch/twitch_credentials.dart';
import 'package:irllink/src/presentation/events/login_events.dart';

class LoginViewController extends GetxController {
Expand All @@ -28,14 +30,14 @@ class LoginViewController extends GetxController {
await Future.doWhile(() =>
Future.delayed(const Duration(seconds: 2)).then((_) => hasNoNetwork()));

await loginEvents.getTwitchFromLocal().then((value) {
if (value.error == null) {
Get.offAllNamed(Routes.home, arguments: [value.data]);
}
}).catchError((e) {});

DataState<TwitchCredentials> twitchCredsResult =
await loginEvents.getTwitchFromLocal();
isLoading.value = false;

if (twitchCredsResult.error == null) {
Get.offAllNamed(Routes.home, arguments: [twitchCredsResult.data]);
}

super.onReady();
}

Expand Down
7 changes: 4 additions & 3 deletions lib/src/presentation/controllers/obs_tab_view_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'dart:convert';

import 'package:flutter/foundation.dart';
import 'package:get/get.dart';
import 'package:irllink/src/domain/entities/settings.dart';
import 'package:irllink/src/presentation/events/home_events.dart';
import 'package:obs_websocket/obs_websocket.dart';
import 'package:irllink/src/core/utils/globals.dart' as globals;
Expand Down Expand Up @@ -245,12 +246,12 @@ class ObsTabViewController extends GetxController {
}

Future applySettings() async {
Settings settings = homeViewController.settings.value;
if (obsWebSocket != null) {
obsWebSocket!.close();
}
if (homeViewController.settings.value.isObsConnected!) {
connectWs(homeViewController.settings.value.obsWebsocketUrl!,
homeViewController.settings.value.obsWebsocketPassword!);
if (settings.isObsConnected!) {
connectWs(settings.obsWebsocketUrl!, settings.obsWebsocketPassword!);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,10 @@ class SettingsViewController extends GetxController {
homeViewController.settings.value.obsWebsocketUrl!;
obsWebsocketPasswordFieldController.text =
homeViewController.settings.value.obsWebsocketPassword!;

seJwtInputController.text =
homeViewController.settings.value.streamElementsSettings!.jwt!;
seOverlayTokenInputController.text = homeViewController
.settings.value.streamElementsSettings!.overlayToken!;
getUsernames();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import 'dart:async';
import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:irllink/src/core/resources/data_state.dart';
import 'package:irllink/src/domain/entities/settings.dart';
import 'package:irllink/src/domain/entities/stream_elements/se_activity.dart';
import 'package:irllink/src/domain/entities/stream_elements/se_me.dart';
import 'package:irllink/src/domain/entities/stream_elements/se_overlay.dart';
Expand Down Expand Up @@ -68,9 +69,9 @@ class StreamelementsViewController extends GetxController

Future<void> applySettings() async {
if (homeViewController.seCredentials.value == null) return;
jwt = homeViewController.settings.value.streamElementsSettings?.jwt;
overlayToken =
homeViewController.settings.value.streamElementsSettings?.overlayToken;
Settings settings = homeViewController.settings.value;
jwt = settings.streamElementsSettings?.jwt;
overlayToken = settings.streamElementsSettings?.overlayToken;
if (homeViewController.seMe.value != null) {
handleGetMe(homeViewController.seMe.value!);
}
Expand Down
5 changes: 4 additions & 1 deletion lib/src/presentation/views/home_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ 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 @@ -237,7 +238,9 @@ class HomeView extends GetView<HomeViewController> {
height: height * 0.06,
child: Row(
children: [
Expanded(
controller.selectedChatGroup?.channels.firstWhereOrNull((c) => c.platform == Platform.twitch) == null ?
Container()
: Expanded(
flex: 5,
child: Stack(
alignment: AlignmentDirectional.center,
Expand Down
10 changes: 3 additions & 7 deletions lib/src/presentation/views/login_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -81,13 +81,9 @@ class LoginView extends GetView<LoginViewController> {
return Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
const Text(
"IRL LINK",
style: TextStyle(
fontSize: 34,
fontFamily: "Roboto",
fontWeight: FontWeight.bold,
),
const Image(
image: AssetImage("lib/assets/irl_link_dark_trans_logo.png"),
width: 200,
),
content,
Container(),
Expand Down
12 changes: 7 additions & 5 deletions lib/src/presentation/widgets/settings/chats_joined.dart
Original file line number Diff line number Diff line change
Expand Up @@ -261,21 +261,24 @@ class ChatsJoined extends GetView<SettingsViewController> {
channel: channelTextController.text.trim(),
enabled: true,
);
chatGroup.channels.add(newChan);

List<Channel> channels = [...chatGroup.channels, newChan];
chatGroup = chatGroup.copyWith(
channels: channels
);
List<ChatGroup>? groups = [];
groups.addAll(controller.homeViewController.settings.value
.chatSettings?.chatGroups ??
[]);
int indexToReplace = groups.indexWhere((g) => g.id == chatGroup.id);
groups.removeAt(indexToReplace);
groups.insert(indexToReplace, chatGroup);
controller.homeViewController.settings.value =
controller.homeViewController.settings.value.copyWith(
chatSettings: controller
.homeViewController.settings.value.chatSettings
?.copyWith(chatGroups: groups),
);

controller.saveSettings();
controller.homeViewController.settings.refresh();
channelTextController.text = '';
Get.back();
},
Expand Down Expand Up @@ -324,7 +327,6 @@ class ChatsJoined extends GetView<SettingsViewController> {
?.copyWith(chatGroups: groups),
);
controller.saveSettings();
controller.homeViewController.settings.refresh();
},
child: Container(
padding:
Expand Down
3 changes: 1 addition & 2 deletions lib/src/presentation/widgets/settings/tts.dart
Original file line number Diff line number Diff line change
Expand Up @@ -610,8 +610,7 @@ class Tts extends StatelessWidget {
}) {
Get.defaultDialog(
title: title,
titleStyle: const TextStyle(color: Colors.white),
backgroundColor: const Color(0xFF0e0e10),
titleStyle: Theme.of(Get.context!).textTheme.bodyLarge!,
buttonColor: const Color(0xFF9147ff),
cancelTextColor: const Color(0xFF9147ff),
textCancel: "Back",
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.3.1+55
version: 2.3.2+56

environment:
sdk: '>=2.19.0-0 <4.0.0'
Expand Down

0 comments on commit cb5a643

Please sign in to comment.