feat: translate-manager Beta

This commit is contained in:
xkeyC 2025-12-27 11:47:25 +08:00
parent a673f70862
commit 2be5441cf4
9 changed files with 141 additions and 72 deletions

View File

@ -82,7 +82,7 @@ final class AppGlobalModelProvider
} }
} }
String _$appGlobalModelHash() => r'853586e6ce83942638f0971e08d7b9106a2e7186'; String _$appGlobalModelHash() => r'74128d2194d00a0e3dbb000dcaf6452e0b966d9c';
abstract class _$AppGlobalModel extends $Notifier<AppGlobalState> { abstract class _$AppGlobalModel extends $Notifier<AppGlobalState> {
AppGlobalState build(); AppGlobalState build();

View File

@ -1,9 +1,9 @@
import 'dart:io'; import 'dart:io';
class ConstConf { class ConstConf {
static const String appVersion = "3.0.0 Beta9"; static const String appVersion = "3.0.0 Beta10";
static const int appVersionCode = 79; static const int appVersionCode = 79;
static const String appVersionDate = "2025-12-22"; static const String appVersionDate = "2025-12-27";
static const _gameChannels = ["LIVE", "4.0_PREVIEW", "PTU", "EPTU", "TECH-PREVIEW", "HOTFIX"]; static const _gameChannels = ["LIVE", "4.0_PREVIEW", "PTU", "EPTU", "TECH-PREVIEW", "HOTFIX"];
static const isMSE = String.fromEnvironment("MSE", defaultValue: "false") == "true"; static const isMSE = String.fromEnvironment("MSE", defaultValue: "false") == "true";
static const win32AppId = isMSE static const win32AppId = isMSE

View File

@ -10,10 +10,10 @@ class URLConf {
static const String analyticsApiHome = "https://scbox.org"; static const String analyticsApiHome = "https://scbox.org";
/// PartyRoom Server /// PartyRoom Server
static const String partyRoomServerAddress = "localhost"; // static const String partyRoomServerAddress = "localhost";
static const int partyRoomServerPort = 50051; // static const int partyRoomServerPort = 50051;
// static const String partyRoomServerAddress = "ecdn.partyroom.grpc.scbox.xkeyc.cn"; static const String partyRoomServerAddress = "ecdn.partyroom.grpc.scbox.xkeyc.cn";
// static const int partyRoomServerPort = 443; static const int partyRoomServerPort = 443;
static bool isUrlCheckPass = false; static bool isUrlCheckPass = false;

View File

@ -16,7 +16,8 @@ class SCLoggerHelper {
dPrint("rsiLauncherPath Wine:$rsiLauncherPath"); dPrint("rsiLauncherPath Wine:$rsiLauncherPath");
final jsonLogPath = "$rsiLauncherPath/logs/log.log"; final jsonLogPath = "$rsiLauncherPath/logs/log.log";
return jsonLogPath; return jsonLogPath;
}; }
;
Map<String, String> envVars = Platform.environment; Map<String, String> envVars = Platform.environment;
final appDataPath = envVars["appdata"]; final appDataPath = envVars["appdata"];
if (appDataPath == null) { if (appDataPath == null) {
@ -85,6 +86,8 @@ class SCLoggerHelper {
List<String> scInstallPaths = []; List<String> scInstallPaths = [];
checkAndAddPath(String path, bool checkExists) async { checkAndAddPath(String path, bool checkExists) async {
// Handle JSON-escaped backslashes (\\\\) -> single backslash (\\)
path = path.replaceAll(r'\\', r'\');
// Normalize path separators to current platform format // Normalize path separators to current platform format
path = path.platformPath; path = path.platformPath;
@ -110,8 +113,19 @@ class SCLoggerHelper {
try { try {
for (var v in withVersion) { for (var v in withVersion) {
// Match both Windows (\\) and Unix (/) path separators in log entries, case-insensitive // Platform-specific regex patterns for game install path detection
String pattern = r'([a-zA-Z]:[\\/][^\\/]*[\\/][^\\/]*[\\/]StarCitizen[\\/]' + v + r')'; // Uses restrictive character class to avoid matching across JSON delimiters
String pattern;
if (Platform.isWindows) {
// Windows: Match paths like C:\...\StarCitizen\LIVE
// Path segments can only contain: letters, numbers, space, dot, underscore, hyphen, parentheses
// Handles both single backslash, forward slash, and JSON-escaped double backslash
pattern =
r'([a-zA-Z]:(?:[/\\]|\\\\)(?:[a-zA-Z0-9 ._()-]+(?:[/\\]|\\\\))*StarCitizen(?:[/\\]|\\\\)' + v + r')';
} else {
// Unix (Wine): Match paths like /home/user/.../StarCitizen/LIVE
pattern = r'(/(?:[a-zA-Z0-9 ._()-]+/)*StarCitizen/' + v + r')';
}
RegExp regExp = RegExp(pattern, caseSensitive: false); RegExp regExp = RegExp(pattern, caseSensitive: false);
for (var i = listData.length - 1; i > 0; i--) { for (var i = listData.length - 1; i > 0; i--) {
final line = listData[i]; final line = listData[i];

View File

@ -116,7 +116,9 @@ class AuthPage extends HookConsumerWidget {
); );
} }
final displayDomain = state.domainName ?? state.domain ?? '未知应用'; final name = state.domainName ?? state.domain ?? '未知应用';
final domain = state.domain;
final isTrusted = state.isDomainTrusted;
return SingleChildScrollView( return SingleChildScrollView(
child: Column( child: Column(
@ -131,33 +133,52 @@ class AuthPage extends HookConsumerWidget {
style: TextStyle(fontSize: 20, color: Colors.white.withValues(alpha: 0.95), fontFamily: 'Segoe UI'), style: TextStyle(fontSize: 20, color: Colors.white.withValues(alpha: 0.95), fontFamily: 'Segoe UI'),
children: [ children: [
TextSpan( TextSpan(
text: displayDomain, text: name,
style: const TextStyle(fontWeight: FontWeight.bold), style: const TextStyle(fontWeight: FontWeight.bold),
), ),
const TextSpan(text: ' 申请访问您的账户'), const TextSpan(text: ' 申请访问您的账户'),
], ],
), ),
), ),
const SizedBox(height: 8),
if (!state.isDomainTrusted) if (domain != null)
Padding( Padding(
padding: const EdgeInsets.only(top: 8), padding: const EdgeInsets.only(top: 4),
child: Container( child: Row(
padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4), mainAxisSize: MainAxisSize.min,
children: [
if (state.domainName != null)
Text(domain, style: TextStyle(fontSize: 14, color: Colors.white.withValues(alpha: 0.5))),
if (state.domainName != null) const SizedBox(width: 8),
Container(
padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 2),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.orange.withValues(alpha: 0.1), color: (isTrusted ? Colors.green : Colors.orange).withValues(alpha: 0.1),
borderRadius: BorderRadius.circular(4), borderRadius: BorderRadius.circular(4),
border: Border.all(color: Colors.orange.withValues(alpha: 0.3)), border: Border.all(color: (isTrusted ? Colors.green : Colors.orange).withValues(alpha: 0.3)),
), ),
child: Row( child: Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
Icon(FluentIcons.warning, size: 12, color: Colors.orange), Icon(
const SizedBox(width: 6), isTrusted ? FluentIcons.completed : FluentIcons.warning,
Text('未验证的应用', style: TextStyle(fontSize: 12, color: Colors.orange)), size: 10,
color: isTrusted ? Colors.green : Colors.orange,
),
const SizedBox(width: 4),
Text(
isTrusted ? '已认证' : '未验证',
style: TextStyle(
fontSize: 10,
color: isTrusted ? Colors.green : Colors.orange,
fontWeight: FontWeight.w500,
),
),
], ],
), ),
), ),
],
),
), ),
const SizedBox(height: 24), const SizedBox(height: 24),
@ -196,10 +217,9 @@ class AuthPage extends HookConsumerWidget {
const SizedBox(height: 32), const SizedBox(height: 32),
// 3. Permission Scope
Align( Align(
alignment: Alignment.centerLeft, alignment: Alignment.centerLeft,
child: Text('此操作将允许 $displayDomain', style: const TextStyle(fontSize: 14, fontWeight: FontWeight.w500)), child: Text('此操作将允许 $domain', style: const TextStyle(fontSize: 14, fontWeight: FontWeight.w500)),
), ),
const SizedBox(height: 16), const SizedBox(height: 16),

View File

@ -89,6 +89,7 @@ class UserAvatarWidget extends HookConsumerWidget {
return Consumer( return Consumer(
builder: (context, ref, child) { builder: (context, ref, child) {
final partyRoomState = ref.watch(partyRoomProvider); final partyRoomState = ref.watch(partyRoomProvider);
final uiState = ref.watch(partyRoomUIModelProvider);
final userInfo = partyRoomState.auth.userInfo; final userInfo = partyRoomState.auth.userInfo;
final displayUserName = userInfo?.gameUserId ?? userName; final displayUserName = userInfo?.gameUserId ?? userName;
final displayAvatarUrl = PartyRoomUtils.getAvatarUrl(userInfo?.avatarUrl); final displayAvatarUrl = PartyRoomUtils.getAvatarUrl(userInfo?.avatarUrl);
@ -171,9 +172,11 @@ class UserAvatarWidget extends HookConsumerWidget {
child: Tooltip( child: Tooltip(
message: '每小时仅可刷新一次', message: '每小时仅可刷新一次',
child: FilledButton( child: FilledButton(
onPressed: () async { onPressed: uiState.isRefreshingProfile
? null
: () async {
try { try {
await ref.read(partyRoomProvider.notifier).refreshUserProfile(); await ref.read(partyRoomUIModelProvider.notifier).refreshUserProfile();
if (context.mounted) { if (context.mounted) {
showToast(context, '刷新成功'); showToast(context, '刷新成功');
} }
@ -187,7 +190,17 @@ class UserAvatarWidget extends HookConsumerWidget {
} }
} }
}, },
child: const Text('刷新资料'), child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
if (uiState.isRefreshingProfile)
const Padding(
padding: EdgeInsets.only(right: 8),
child: SizedBox(width: 12, height: 12, child: ProgressRing(strokeWidth: 2)),
),
const Text('刷新资料'),
],
),
), ),
), ),
), ),
@ -199,7 +212,12 @@ class UserAvatarWidget extends HookConsumerWidget {
Navigator.of(dialogContext).pop(); Navigator.of(dialogContext).pop();
await _handleUnregister(context, ref); await _handleUnregister(context, ref);
}, },
style: ButtonStyle(backgroundColor: WidgetStateProperty.all(Colors.red)), style: ButtonStyle(
backgroundColor: WidgetStateProperty.resolveWith((states) {
if (states.isHovered) return Colors.red.withValues(alpha: 0.8);
return Colors.red;
}),
),
child: Text( child: Text(
S.current.user_action_unregister, S.current.user_action_unregister,
style: const TextStyle(color: Colors.white), style: const TextStyle(color: Colors.white),

View File

@ -34,8 +34,9 @@ sealed class PartyRoomUIState with _$PartyRoomUIState {
@Default(false) bool isReconnecting, @Default(false) bool isReconnecting,
@Default(0) int reconnectAttempts, @Default(0) int reconnectAttempts,
@Default(false) bool isMinimized, @Default(false) bool isMinimized,
@Default(true) bool isLoggingIn, @Default(false) bool isLoggingIn,
@Default(true) bool isGuestMode, @Default(true) bool isGuestMode,
@Default(false) bool isRefreshingProfile,
}) = _PartyRoomUIState; }) = _PartyRoomUIState;
} }
@ -108,7 +109,9 @@ class PartyRoomUIModel extends _$PartyRoomUIModel {
if (next.deathEvents?.isNotEmpty ?? false) { if (next.deathEvents?.isNotEmpty ?? false) {
for (final event in next.deathEvents!) { for (final event in next.deathEvents!) {
ref.read(partyRoomProvider.notifier).sendSignal("special_death", params: {"location": event.$1, "area": event.$2}); ref
.read(partyRoomProvider.notifier)
.sendSignal("special_death", params: {"location": event.$1, "area": event.$2});
} }
} }
} }
@ -214,6 +217,17 @@ class PartyRoomUIModel extends _$PartyRoomUIModel {
} }
} }
///
Future<void> refreshUserProfile() async {
if (state.isRefreshingProfile) return;
state = state.copyWith(isRefreshingProfile: true);
try {
await ref.read(partyRoomProvider.notifier).refreshUserProfile();
} finally {
state = state.copyWith(isRefreshingProfile: false);
}
}
/// ///
Future<void> requestPreRegister(String gameUserId) async { Future<void> requestPreRegister(String gameUserId) async {
state = state.copyWith(isLoading: true, errorMessage: null, registerGameUserId: gameUserId); state = state.copyWith(isLoading: true, errorMessage: null, registerGameUserId: gameUserId);

View File

@ -14,7 +14,7 @@ T _$identity<T>(T value) => value;
/// @nodoc /// @nodoc
mixin _$PartyRoomUIState { mixin _$PartyRoomUIState {
bool get isConnecting; bool get showRoomList; List<RoomListItem> get roomListItems; int get currentPage; int get pageSize; int get totalRooms; String? get selectedMainTagId; String? get selectedSubTagId; String get searchOwnerName; bool get isLoading; String? get errorMessage; String get preRegisterCode; String get registerGameUserId; bool get isReconnecting; int get reconnectAttempts; bool get isMinimized; bool get isLoggingIn; bool get isGuestMode; bool get isConnecting; bool get showRoomList; List<RoomListItem> get roomListItems; int get currentPage; int get pageSize; int get totalRooms; String? get selectedMainTagId; String? get selectedSubTagId; String get searchOwnerName; bool get isLoading; String? get errorMessage; String get preRegisterCode; String get registerGameUserId; bool get isReconnecting; int get reconnectAttempts; bool get isMinimized; bool get isLoggingIn; bool get isGuestMode; bool get isRefreshingProfile;
/// Create a copy of PartyRoomUIState /// Create a copy of PartyRoomUIState
/// with the given fields replaced by the non-null parameter values. /// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false) @JsonKey(includeFromJson: false, includeToJson: false)
@ -25,16 +25,16 @@ $PartyRoomUIStateCopyWith<PartyRoomUIState> get copyWith => _$PartyRoomUIStateCo
@override @override
bool operator ==(Object other) { bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is PartyRoomUIState&&(identical(other.isConnecting, isConnecting) || other.isConnecting == isConnecting)&&(identical(other.showRoomList, showRoomList) || other.showRoomList == showRoomList)&&const DeepCollectionEquality().equals(other.roomListItems, roomListItems)&&(identical(other.currentPage, currentPage) || other.currentPage == currentPage)&&(identical(other.pageSize, pageSize) || other.pageSize == pageSize)&&(identical(other.totalRooms, totalRooms) || other.totalRooms == totalRooms)&&(identical(other.selectedMainTagId, selectedMainTagId) || other.selectedMainTagId == selectedMainTagId)&&(identical(other.selectedSubTagId, selectedSubTagId) || other.selectedSubTagId == selectedSubTagId)&&(identical(other.searchOwnerName, searchOwnerName) || other.searchOwnerName == searchOwnerName)&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)&&(identical(other.preRegisterCode, preRegisterCode) || other.preRegisterCode == preRegisterCode)&&(identical(other.registerGameUserId, registerGameUserId) || other.registerGameUserId == registerGameUserId)&&(identical(other.isReconnecting, isReconnecting) || other.isReconnecting == isReconnecting)&&(identical(other.reconnectAttempts, reconnectAttempts) || other.reconnectAttempts == reconnectAttempts)&&(identical(other.isMinimized, isMinimized) || other.isMinimized == isMinimized)&&(identical(other.isLoggingIn, isLoggingIn) || other.isLoggingIn == isLoggingIn)&&(identical(other.isGuestMode, isGuestMode) || other.isGuestMode == isGuestMode)); return identical(this, other) || (other.runtimeType == runtimeType&&other is PartyRoomUIState&&(identical(other.isConnecting, isConnecting) || other.isConnecting == isConnecting)&&(identical(other.showRoomList, showRoomList) || other.showRoomList == showRoomList)&&const DeepCollectionEquality().equals(other.roomListItems, roomListItems)&&(identical(other.currentPage, currentPage) || other.currentPage == currentPage)&&(identical(other.pageSize, pageSize) || other.pageSize == pageSize)&&(identical(other.totalRooms, totalRooms) || other.totalRooms == totalRooms)&&(identical(other.selectedMainTagId, selectedMainTagId) || other.selectedMainTagId == selectedMainTagId)&&(identical(other.selectedSubTagId, selectedSubTagId) || other.selectedSubTagId == selectedSubTagId)&&(identical(other.searchOwnerName, searchOwnerName) || other.searchOwnerName == searchOwnerName)&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)&&(identical(other.preRegisterCode, preRegisterCode) || other.preRegisterCode == preRegisterCode)&&(identical(other.registerGameUserId, registerGameUserId) || other.registerGameUserId == registerGameUserId)&&(identical(other.isReconnecting, isReconnecting) || other.isReconnecting == isReconnecting)&&(identical(other.reconnectAttempts, reconnectAttempts) || other.reconnectAttempts == reconnectAttempts)&&(identical(other.isMinimized, isMinimized) || other.isMinimized == isMinimized)&&(identical(other.isLoggingIn, isLoggingIn) || other.isLoggingIn == isLoggingIn)&&(identical(other.isGuestMode, isGuestMode) || other.isGuestMode == isGuestMode)&&(identical(other.isRefreshingProfile, isRefreshingProfile) || other.isRefreshingProfile == isRefreshingProfile));
} }
@override @override
int get hashCode => Object.hash(runtimeType,isConnecting,showRoomList,const DeepCollectionEquality().hash(roomListItems),currentPage,pageSize,totalRooms,selectedMainTagId,selectedSubTagId,searchOwnerName,isLoading,errorMessage,preRegisterCode,registerGameUserId,isReconnecting,reconnectAttempts,isMinimized,isLoggingIn,isGuestMode); int get hashCode => Object.hashAll([runtimeType,isConnecting,showRoomList,const DeepCollectionEquality().hash(roomListItems),currentPage,pageSize,totalRooms,selectedMainTagId,selectedSubTagId,searchOwnerName,isLoading,errorMessage,preRegisterCode,registerGameUserId,isReconnecting,reconnectAttempts,isMinimized,isLoggingIn,isGuestMode,isRefreshingProfile]);
@override @override
String toString() { String toString() {
return 'PartyRoomUIState(isConnecting: $isConnecting, showRoomList: $showRoomList, roomListItems: $roomListItems, currentPage: $currentPage, pageSize: $pageSize, totalRooms: $totalRooms, selectedMainTagId: $selectedMainTagId, selectedSubTagId: $selectedSubTagId, searchOwnerName: $searchOwnerName, isLoading: $isLoading, errorMessage: $errorMessage, preRegisterCode: $preRegisterCode, registerGameUserId: $registerGameUserId, isReconnecting: $isReconnecting, reconnectAttempts: $reconnectAttempts, isMinimized: $isMinimized, isLoggingIn: $isLoggingIn, isGuestMode: $isGuestMode)'; return 'PartyRoomUIState(isConnecting: $isConnecting, showRoomList: $showRoomList, roomListItems: $roomListItems, currentPage: $currentPage, pageSize: $pageSize, totalRooms: $totalRooms, selectedMainTagId: $selectedMainTagId, selectedSubTagId: $selectedSubTagId, searchOwnerName: $searchOwnerName, isLoading: $isLoading, errorMessage: $errorMessage, preRegisterCode: $preRegisterCode, registerGameUserId: $registerGameUserId, isReconnecting: $isReconnecting, reconnectAttempts: $reconnectAttempts, isMinimized: $isMinimized, isLoggingIn: $isLoggingIn, isGuestMode: $isGuestMode, isRefreshingProfile: $isRefreshingProfile)';
} }
@ -45,7 +45,7 @@ abstract mixin class $PartyRoomUIStateCopyWith<$Res> {
factory $PartyRoomUIStateCopyWith(PartyRoomUIState value, $Res Function(PartyRoomUIState) _then) = _$PartyRoomUIStateCopyWithImpl; factory $PartyRoomUIStateCopyWith(PartyRoomUIState value, $Res Function(PartyRoomUIState) _then) = _$PartyRoomUIStateCopyWithImpl;
@useResult @useResult
$Res call({ $Res call({
bool isConnecting, bool showRoomList, List<RoomListItem> roomListItems, int currentPage, int pageSize, int totalRooms, String? selectedMainTagId, String? selectedSubTagId, String searchOwnerName, bool isLoading, String? errorMessage, String preRegisterCode, String registerGameUserId, bool isReconnecting, int reconnectAttempts, bool isMinimized, bool isLoggingIn, bool isGuestMode bool isConnecting, bool showRoomList, List<RoomListItem> roomListItems, int currentPage, int pageSize, int totalRooms, String? selectedMainTagId, String? selectedSubTagId, String searchOwnerName, bool isLoading, String? errorMessage, String preRegisterCode, String registerGameUserId, bool isReconnecting, int reconnectAttempts, bool isMinimized, bool isLoggingIn, bool isGuestMode, bool isRefreshingProfile
}); });
@ -62,7 +62,7 @@ class _$PartyRoomUIStateCopyWithImpl<$Res>
/// Create a copy of PartyRoomUIState /// Create a copy of PartyRoomUIState
/// with the given fields replaced by the non-null parameter values. /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? isConnecting = null,Object? showRoomList = null,Object? roomListItems = null,Object? currentPage = null,Object? pageSize = null,Object? totalRooms = null,Object? selectedMainTagId = freezed,Object? selectedSubTagId = freezed,Object? searchOwnerName = null,Object? isLoading = null,Object? errorMessage = freezed,Object? preRegisterCode = null,Object? registerGameUserId = null,Object? isReconnecting = null,Object? reconnectAttempts = null,Object? isMinimized = null,Object? isLoggingIn = null,Object? isGuestMode = null,}) { @pragma('vm:prefer-inline') @override $Res call({Object? isConnecting = null,Object? showRoomList = null,Object? roomListItems = null,Object? currentPage = null,Object? pageSize = null,Object? totalRooms = null,Object? selectedMainTagId = freezed,Object? selectedSubTagId = freezed,Object? searchOwnerName = null,Object? isLoading = null,Object? errorMessage = freezed,Object? preRegisterCode = null,Object? registerGameUserId = null,Object? isReconnecting = null,Object? reconnectAttempts = null,Object? isMinimized = null,Object? isLoggingIn = null,Object? isGuestMode = null,Object? isRefreshingProfile = null,}) {
return _then(_self.copyWith( return _then(_self.copyWith(
isConnecting: null == isConnecting ? _self.isConnecting : isConnecting // ignore: cast_nullable_to_non_nullable isConnecting: null == isConnecting ? _self.isConnecting : isConnecting // ignore: cast_nullable_to_non_nullable
as bool,showRoomList: null == showRoomList ? _self.showRoomList : showRoomList // ignore: cast_nullable_to_non_nullable as bool,showRoomList: null == showRoomList ? _self.showRoomList : showRoomList // ignore: cast_nullable_to_non_nullable
@ -82,6 +82,7 @@ as bool,reconnectAttempts: null == reconnectAttempts ? _self.reconnectAttempts :
as int,isMinimized: null == isMinimized ? _self.isMinimized : isMinimized // ignore: cast_nullable_to_non_nullable as int,isMinimized: null == isMinimized ? _self.isMinimized : isMinimized // ignore: cast_nullable_to_non_nullable
as bool,isLoggingIn: null == isLoggingIn ? _self.isLoggingIn : isLoggingIn // ignore: cast_nullable_to_non_nullable as bool,isLoggingIn: null == isLoggingIn ? _self.isLoggingIn : isLoggingIn // ignore: cast_nullable_to_non_nullable
as bool,isGuestMode: null == isGuestMode ? _self.isGuestMode : isGuestMode // ignore: cast_nullable_to_non_nullable as bool,isGuestMode: null == isGuestMode ? _self.isGuestMode : isGuestMode // ignore: cast_nullable_to_non_nullable
as bool,isRefreshingProfile: null == isRefreshingProfile ? _self.isRefreshingProfile : isRefreshingProfile // ignore: cast_nullable_to_non_nullable
as bool, as bool,
)); ));
} }
@ -164,10 +165,10 @@ return $default(_that);case _:
/// } /// }
/// ``` /// ```
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( bool isConnecting, bool showRoomList, List<RoomListItem> roomListItems, int currentPage, int pageSize, int totalRooms, String? selectedMainTagId, String? selectedSubTagId, String searchOwnerName, bool isLoading, String? errorMessage, String preRegisterCode, String registerGameUserId, bool isReconnecting, int reconnectAttempts, bool isMinimized, bool isLoggingIn, bool isGuestMode)? $default,{required TResult orElse(),}) {final _that = this; @optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( bool isConnecting, bool showRoomList, List<RoomListItem> roomListItems, int currentPage, int pageSize, int totalRooms, String? selectedMainTagId, String? selectedSubTagId, String searchOwnerName, bool isLoading, String? errorMessage, String preRegisterCode, String registerGameUserId, bool isReconnecting, int reconnectAttempts, bool isMinimized, bool isLoggingIn, bool isGuestMode, bool isRefreshingProfile)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) { switch (_that) {
case _PartyRoomUIState() when $default != null: case _PartyRoomUIState() when $default != null:
return $default(_that.isConnecting,_that.showRoomList,_that.roomListItems,_that.currentPage,_that.pageSize,_that.totalRooms,_that.selectedMainTagId,_that.selectedSubTagId,_that.searchOwnerName,_that.isLoading,_that.errorMessage,_that.preRegisterCode,_that.registerGameUserId,_that.isReconnecting,_that.reconnectAttempts,_that.isMinimized,_that.isLoggingIn,_that.isGuestMode);case _: return $default(_that.isConnecting,_that.showRoomList,_that.roomListItems,_that.currentPage,_that.pageSize,_that.totalRooms,_that.selectedMainTagId,_that.selectedSubTagId,_that.searchOwnerName,_that.isLoading,_that.errorMessage,_that.preRegisterCode,_that.registerGameUserId,_that.isReconnecting,_that.reconnectAttempts,_that.isMinimized,_that.isLoggingIn,_that.isGuestMode,_that.isRefreshingProfile);case _:
return orElse(); return orElse();
} }
@ -185,10 +186,10 @@ return $default(_that.isConnecting,_that.showRoomList,_that.roomListItems,_that.
/// } /// }
/// ``` /// ```
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( bool isConnecting, bool showRoomList, List<RoomListItem> roomListItems, int currentPage, int pageSize, int totalRooms, String? selectedMainTagId, String? selectedSubTagId, String searchOwnerName, bool isLoading, String? errorMessage, String preRegisterCode, String registerGameUserId, bool isReconnecting, int reconnectAttempts, bool isMinimized, bool isLoggingIn, bool isGuestMode) $default,) {final _that = this; @optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( bool isConnecting, bool showRoomList, List<RoomListItem> roomListItems, int currentPage, int pageSize, int totalRooms, String? selectedMainTagId, String? selectedSubTagId, String searchOwnerName, bool isLoading, String? errorMessage, String preRegisterCode, String registerGameUserId, bool isReconnecting, int reconnectAttempts, bool isMinimized, bool isLoggingIn, bool isGuestMode, bool isRefreshingProfile) $default,) {final _that = this;
switch (_that) { switch (_that) {
case _PartyRoomUIState(): case _PartyRoomUIState():
return $default(_that.isConnecting,_that.showRoomList,_that.roomListItems,_that.currentPage,_that.pageSize,_that.totalRooms,_that.selectedMainTagId,_that.selectedSubTagId,_that.searchOwnerName,_that.isLoading,_that.errorMessage,_that.preRegisterCode,_that.registerGameUserId,_that.isReconnecting,_that.reconnectAttempts,_that.isMinimized,_that.isLoggingIn,_that.isGuestMode);} return $default(_that.isConnecting,_that.showRoomList,_that.roomListItems,_that.currentPage,_that.pageSize,_that.totalRooms,_that.selectedMainTagId,_that.selectedSubTagId,_that.searchOwnerName,_that.isLoading,_that.errorMessage,_that.preRegisterCode,_that.registerGameUserId,_that.isReconnecting,_that.reconnectAttempts,_that.isMinimized,_that.isLoggingIn,_that.isGuestMode,_that.isRefreshingProfile);}
} }
/// A variant of `when` that fallback to returning `null` /// A variant of `when` that fallback to returning `null`
/// ///
@ -202,10 +203,10 @@ return $default(_that.isConnecting,_that.showRoomList,_that.roomListItems,_that.
/// } /// }
/// ``` /// ```
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( bool isConnecting, bool showRoomList, List<RoomListItem> roomListItems, int currentPage, int pageSize, int totalRooms, String? selectedMainTagId, String? selectedSubTagId, String searchOwnerName, bool isLoading, String? errorMessage, String preRegisterCode, String registerGameUserId, bool isReconnecting, int reconnectAttempts, bool isMinimized, bool isLoggingIn, bool isGuestMode)? $default,) {final _that = this; @optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( bool isConnecting, bool showRoomList, List<RoomListItem> roomListItems, int currentPage, int pageSize, int totalRooms, String? selectedMainTagId, String? selectedSubTagId, String searchOwnerName, bool isLoading, String? errorMessage, String preRegisterCode, String registerGameUserId, bool isReconnecting, int reconnectAttempts, bool isMinimized, bool isLoggingIn, bool isGuestMode, bool isRefreshingProfile)? $default,) {final _that = this;
switch (_that) { switch (_that) {
case _PartyRoomUIState() when $default != null: case _PartyRoomUIState() when $default != null:
return $default(_that.isConnecting,_that.showRoomList,_that.roomListItems,_that.currentPage,_that.pageSize,_that.totalRooms,_that.selectedMainTagId,_that.selectedSubTagId,_that.searchOwnerName,_that.isLoading,_that.errorMessage,_that.preRegisterCode,_that.registerGameUserId,_that.isReconnecting,_that.reconnectAttempts,_that.isMinimized,_that.isLoggingIn,_that.isGuestMode);case _: return $default(_that.isConnecting,_that.showRoomList,_that.roomListItems,_that.currentPage,_that.pageSize,_that.totalRooms,_that.selectedMainTagId,_that.selectedSubTagId,_that.searchOwnerName,_that.isLoading,_that.errorMessage,_that.preRegisterCode,_that.registerGameUserId,_that.isReconnecting,_that.reconnectAttempts,_that.isMinimized,_that.isLoggingIn,_that.isGuestMode,_that.isRefreshingProfile);case _:
return null; return null;
} }
@ -217,7 +218,7 @@ return $default(_that.isConnecting,_that.showRoomList,_that.roomListItems,_that.
class _PartyRoomUIState implements PartyRoomUIState { class _PartyRoomUIState implements PartyRoomUIState {
const _PartyRoomUIState({this.isConnecting = false, this.showRoomList = false, final List<RoomListItem> roomListItems = const [], this.currentPage = 1, this.pageSize = 20, this.totalRooms = 0, this.selectedMainTagId, this.selectedSubTagId, this.searchOwnerName = '', this.isLoading = false, this.errorMessage, this.preRegisterCode = '', this.registerGameUserId = '', this.isReconnecting = false, this.reconnectAttempts = 0, this.isMinimized = false, this.isLoggingIn = true, this.isGuestMode = true}): _roomListItems = roomListItems; const _PartyRoomUIState({this.isConnecting = false, this.showRoomList = false, final List<RoomListItem> roomListItems = const [], this.currentPage = 1, this.pageSize = 20, this.totalRooms = 0, this.selectedMainTagId, this.selectedSubTagId, this.searchOwnerName = '', this.isLoading = false, this.errorMessage, this.preRegisterCode = '', this.registerGameUserId = '', this.isReconnecting = false, this.reconnectAttempts = 0, this.isMinimized = false, this.isLoggingIn = false, this.isGuestMode = true, this.isRefreshingProfile = false}): _roomListItems = roomListItems;
@override@JsonKey() final bool isConnecting; @override@JsonKey() final bool isConnecting;
@ -244,6 +245,7 @@ class _PartyRoomUIState implements PartyRoomUIState {
@override@JsonKey() final bool isMinimized; @override@JsonKey() final bool isMinimized;
@override@JsonKey() final bool isLoggingIn; @override@JsonKey() final bool isLoggingIn;
@override@JsonKey() final bool isGuestMode; @override@JsonKey() final bool isGuestMode;
@override@JsonKey() final bool isRefreshingProfile;
/// Create a copy of PartyRoomUIState /// Create a copy of PartyRoomUIState
/// with the given fields replaced by the non-null parameter values. /// with the given fields replaced by the non-null parameter values.
@ -255,16 +257,16 @@ _$PartyRoomUIStateCopyWith<_PartyRoomUIState> get copyWith => __$PartyRoomUIStat
@override @override
bool operator ==(Object other) { bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _PartyRoomUIState&&(identical(other.isConnecting, isConnecting) || other.isConnecting == isConnecting)&&(identical(other.showRoomList, showRoomList) || other.showRoomList == showRoomList)&&const DeepCollectionEquality().equals(other._roomListItems, _roomListItems)&&(identical(other.currentPage, currentPage) || other.currentPage == currentPage)&&(identical(other.pageSize, pageSize) || other.pageSize == pageSize)&&(identical(other.totalRooms, totalRooms) || other.totalRooms == totalRooms)&&(identical(other.selectedMainTagId, selectedMainTagId) || other.selectedMainTagId == selectedMainTagId)&&(identical(other.selectedSubTagId, selectedSubTagId) || other.selectedSubTagId == selectedSubTagId)&&(identical(other.searchOwnerName, searchOwnerName) || other.searchOwnerName == searchOwnerName)&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)&&(identical(other.preRegisterCode, preRegisterCode) || other.preRegisterCode == preRegisterCode)&&(identical(other.registerGameUserId, registerGameUserId) || other.registerGameUserId == registerGameUserId)&&(identical(other.isReconnecting, isReconnecting) || other.isReconnecting == isReconnecting)&&(identical(other.reconnectAttempts, reconnectAttempts) || other.reconnectAttempts == reconnectAttempts)&&(identical(other.isMinimized, isMinimized) || other.isMinimized == isMinimized)&&(identical(other.isLoggingIn, isLoggingIn) || other.isLoggingIn == isLoggingIn)&&(identical(other.isGuestMode, isGuestMode) || other.isGuestMode == isGuestMode)); return identical(this, other) || (other.runtimeType == runtimeType&&other is _PartyRoomUIState&&(identical(other.isConnecting, isConnecting) || other.isConnecting == isConnecting)&&(identical(other.showRoomList, showRoomList) || other.showRoomList == showRoomList)&&const DeepCollectionEquality().equals(other._roomListItems, _roomListItems)&&(identical(other.currentPage, currentPage) || other.currentPage == currentPage)&&(identical(other.pageSize, pageSize) || other.pageSize == pageSize)&&(identical(other.totalRooms, totalRooms) || other.totalRooms == totalRooms)&&(identical(other.selectedMainTagId, selectedMainTagId) || other.selectedMainTagId == selectedMainTagId)&&(identical(other.selectedSubTagId, selectedSubTagId) || other.selectedSubTagId == selectedSubTagId)&&(identical(other.searchOwnerName, searchOwnerName) || other.searchOwnerName == searchOwnerName)&&(identical(other.isLoading, isLoading) || other.isLoading == isLoading)&&(identical(other.errorMessage, errorMessage) || other.errorMessage == errorMessage)&&(identical(other.preRegisterCode, preRegisterCode) || other.preRegisterCode == preRegisterCode)&&(identical(other.registerGameUserId, registerGameUserId) || other.registerGameUserId == registerGameUserId)&&(identical(other.isReconnecting, isReconnecting) || other.isReconnecting == isReconnecting)&&(identical(other.reconnectAttempts, reconnectAttempts) || other.reconnectAttempts == reconnectAttempts)&&(identical(other.isMinimized, isMinimized) || other.isMinimized == isMinimized)&&(identical(other.isLoggingIn, isLoggingIn) || other.isLoggingIn == isLoggingIn)&&(identical(other.isGuestMode, isGuestMode) || other.isGuestMode == isGuestMode)&&(identical(other.isRefreshingProfile, isRefreshingProfile) || other.isRefreshingProfile == isRefreshingProfile));
} }
@override @override
int get hashCode => Object.hash(runtimeType,isConnecting,showRoomList,const DeepCollectionEquality().hash(_roomListItems),currentPage,pageSize,totalRooms,selectedMainTagId,selectedSubTagId,searchOwnerName,isLoading,errorMessage,preRegisterCode,registerGameUserId,isReconnecting,reconnectAttempts,isMinimized,isLoggingIn,isGuestMode); int get hashCode => Object.hashAll([runtimeType,isConnecting,showRoomList,const DeepCollectionEquality().hash(_roomListItems),currentPage,pageSize,totalRooms,selectedMainTagId,selectedSubTagId,searchOwnerName,isLoading,errorMessage,preRegisterCode,registerGameUserId,isReconnecting,reconnectAttempts,isMinimized,isLoggingIn,isGuestMode,isRefreshingProfile]);
@override @override
String toString() { String toString() {
return 'PartyRoomUIState(isConnecting: $isConnecting, showRoomList: $showRoomList, roomListItems: $roomListItems, currentPage: $currentPage, pageSize: $pageSize, totalRooms: $totalRooms, selectedMainTagId: $selectedMainTagId, selectedSubTagId: $selectedSubTagId, searchOwnerName: $searchOwnerName, isLoading: $isLoading, errorMessage: $errorMessage, preRegisterCode: $preRegisterCode, registerGameUserId: $registerGameUserId, isReconnecting: $isReconnecting, reconnectAttempts: $reconnectAttempts, isMinimized: $isMinimized, isLoggingIn: $isLoggingIn, isGuestMode: $isGuestMode)'; return 'PartyRoomUIState(isConnecting: $isConnecting, showRoomList: $showRoomList, roomListItems: $roomListItems, currentPage: $currentPage, pageSize: $pageSize, totalRooms: $totalRooms, selectedMainTagId: $selectedMainTagId, selectedSubTagId: $selectedSubTagId, searchOwnerName: $searchOwnerName, isLoading: $isLoading, errorMessage: $errorMessage, preRegisterCode: $preRegisterCode, registerGameUserId: $registerGameUserId, isReconnecting: $isReconnecting, reconnectAttempts: $reconnectAttempts, isMinimized: $isMinimized, isLoggingIn: $isLoggingIn, isGuestMode: $isGuestMode, isRefreshingProfile: $isRefreshingProfile)';
} }
@ -275,7 +277,7 @@ abstract mixin class _$PartyRoomUIStateCopyWith<$Res> implements $PartyRoomUISta
factory _$PartyRoomUIStateCopyWith(_PartyRoomUIState value, $Res Function(_PartyRoomUIState) _then) = __$PartyRoomUIStateCopyWithImpl; factory _$PartyRoomUIStateCopyWith(_PartyRoomUIState value, $Res Function(_PartyRoomUIState) _then) = __$PartyRoomUIStateCopyWithImpl;
@override @useResult @override @useResult
$Res call({ $Res call({
bool isConnecting, bool showRoomList, List<RoomListItem> roomListItems, int currentPage, int pageSize, int totalRooms, String? selectedMainTagId, String? selectedSubTagId, String searchOwnerName, bool isLoading, String? errorMessage, String preRegisterCode, String registerGameUserId, bool isReconnecting, int reconnectAttempts, bool isMinimized, bool isLoggingIn, bool isGuestMode bool isConnecting, bool showRoomList, List<RoomListItem> roomListItems, int currentPage, int pageSize, int totalRooms, String? selectedMainTagId, String? selectedSubTagId, String searchOwnerName, bool isLoading, String? errorMessage, String preRegisterCode, String registerGameUserId, bool isReconnecting, int reconnectAttempts, bool isMinimized, bool isLoggingIn, bool isGuestMode, bool isRefreshingProfile
}); });
@ -292,7 +294,7 @@ class __$PartyRoomUIStateCopyWithImpl<$Res>
/// Create a copy of PartyRoomUIState /// Create a copy of PartyRoomUIState
/// with the given fields replaced by the non-null parameter values. /// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? isConnecting = null,Object? showRoomList = null,Object? roomListItems = null,Object? currentPage = null,Object? pageSize = null,Object? totalRooms = null,Object? selectedMainTagId = freezed,Object? selectedSubTagId = freezed,Object? searchOwnerName = null,Object? isLoading = null,Object? errorMessage = freezed,Object? preRegisterCode = null,Object? registerGameUserId = null,Object? isReconnecting = null,Object? reconnectAttempts = null,Object? isMinimized = null,Object? isLoggingIn = null,Object? isGuestMode = null,}) { @override @pragma('vm:prefer-inline') $Res call({Object? isConnecting = null,Object? showRoomList = null,Object? roomListItems = null,Object? currentPage = null,Object? pageSize = null,Object? totalRooms = null,Object? selectedMainTagId = freezed,Object? selectedSubTagId = freezed,Object? searchOwnerName = null,Object? isLoading = null,Object? errorMessage = freezed,Object? preRegisterCode = null,Object? registerGameUserId = null,Object? isReconnecting = null,Object? reconnectAttempts = null,Object? isMinimized = null,Object? isLoggingIn = null,Object? isGuestMode = null,Object? isRefreshingProfile = null,}) {
return _then(_PartyRoomUIState( return _then(_PartyRoomUIState(
isConnecting: null == isConnecting ? _self.isConnecting : isConnecting // ignore: cast_nullable_to_non_nullable isConnecting: null == isConnecting ? _self.isConnecting : isConnecting // ignore: cast_nullable_to_non_nullable
as bool,showRoomList: null == showRoomList ? _self.showRoomList : showRoomList // ignore: cast_nullable_to_non_nullable as bool,showRoomList: null == showRoomList ? _self.showRoomList : showRoomList // ignore: cast_nullable_to_non_nullable
@ -312,6 +314,7 @@ as bool,reconnectAttempts: null == reconnectAttempts ? _self.reconnectAttempts :
as int,isMinimized: null == isMinimized ? _self.isMinimized : isMinimized // ignore: cast_nullable_to_non_nullable as int,isMinimized: null == isMinimized ? _self.isMinimized : isMinimized // ignore: cast_nullable_to_non_nullable
as bool,isLoggingIn: null == isLoggingIn ? _self.isLoggingIn : isLoggingIn // ignore: cast_nullable_to_non_nullable as bool,isLoggingIn: null == isLoggingIn ? _self.isLoggingIn : isLoggingIn // ignore: cast_nullable_to_non_nullable
as bool,isGuestMode: null == isGuestMode ? _self.isGuestMode : isGuestMode // ignore: cast_nullable_to_non_nullable as bool,isGuestMode: null == isGuestMode ? _self.isGuestMode : isGuestMode // ignore: cast_nullable_to_non_nullable
as bool,isRefreshingProfile: null == isRefreshingProfile ? _self.isRefreshingProfile : isRefreshingProfile // ignore: cast_nullable_to_non_nullable
as bool, as bool,
)); ));
} }

View File

@ -41,7 +41,7 @@ final class PartyRoomUIModelProvider
} }
} }
String _$partyRoomUIModelHash() => r'b22ad79b6d4a877876b2534f35fb0448b34d4ad5'; String _$partyRoomUIModelHash() => r'cb37e8a29d22b122a5e0e552cca1af537dddc703';
abstract class _$PartyRoomUIModel extends $Notifier<PartyRoomUIState> { abstract class _$PartyRoomUIModel extends $Notifier<PartyRoomUIState> {
PartyRoomUIState build(); PartyRoomUIState build();