mirror of
https://gitlab.com/veilid/veilidchat.git
synced 2025-07-28 08:54:06 -04:00
new chat widget
This commit is contained in:
parent
063eeb8d12
commit
1a9cca0667
44 changed files with 1904 additions and 981 deletions
|
@ -15,15 +15,11 @@ T _$identity<T>(T value) => value;
|
|||
|
||||
/// @nodoc
|
||||
mixin _$ChatComponentState {
|
||||
// GlobalKey for the chat
|
||||
GlobalKey<ChatState> get chatKey; // ScrollController for the chat
|
||||
AutoScrollController
|
||||
get scrollController; // TextEditingController for the chat
|
||||
InputTextFieldController get textEditingController; // Local user
|
||||
// Local user
|
||||
User? get localUser; // Active remote users
|
||||
IMap<TypedKey, User> get remoteUsers; // Historical remote users
|
||||
IMap<TypedKey, User> get historicalRemoteUsers; // Unknown users
|
||||
IMap<TypedKey, User> get unknownUsers; // Messages state
|
||||
IMap<UserID, User> get remoteUsers; // Historical remote users
|
||||
IMap<UserID, User> get historicalRemoteUsers; // Unknown users
|
||||
IMap<UserID, User> get unknownUsers; // Messages state
|
||||
AsyncValue<WindowState<Message>> get messageWindow; // Title of the chat
|
||||
String get title;
|
||||
|
||||
|
@ -40,11 +36,6 @@ mixin _$ChatComponentState {
|
|||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is ChatComponentState &&
|
||||
(identical(other.chatKey, chatKey) || other.chatKey == chatKey) &&
|
||||
(identical(other.scrollController, scrollController) ||
|
||||
other.scrollController == scrollController) &&
|
||||
(identical(other.textEditingController, textEditingController) ||
|
||||
other.textEditingController == textEditingController) &&
|
||||
(identical(other.localUser, localUser) ||
|
||||
other.localUser == localUser) &&
|
||||
(identical(other.remoteUsers, remoteUsers) ||
|
||||
|
@ -59,21 +50,12 @@ mixin _$ChatComponentState {
|
|||
}
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType,
|
||||
chatKey,
|
||||
scrollController,
|
||||
textEditingController,
|
||||
localUser,
|
||||
remoteUsers,
|
||||
historicalRemoteUsers,
|
||||
unknownUsers,
|
||||
messageWindow,
|
||||
title);
|
||||
int get hashCode => Object.hash(runtimeType, localUser, remoteUsers,
|
||||
historicalRemoteUsers, unknownUsers, messageWindow, title);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ChatComponentState(chatKey: $chatKey, scrollController: $scrollController, textEditingController: $textEditingController, localUser: $localUser, remoteUsers: $remoteUsers, historicalRemoteUsers: $historicalRemoteUsers, unknownUsers: $unknownUsers, messageWindow: $messageWindow, title: $title)';
|
||||
return 'ChatComponentState(localUser: $localUser, remoteUsers: $remoteUsers, historicalRemoteUsers: $historicalRemoteUsers, unknownUsers: $unknownUsers, messageWindow: $messageWindow, title: $title)';
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -84,16 +66,14 @@ abstract mixin class $ChatComponentStateCopyWith<$Res> {
|
|||
_$ChatComponentStateCopyWithImpl;
|
||||
@useResult
|
||||
$Res call(
|
||||
{GlobalKey<ChatState> chatKey,
|
||||
AutoScrollController scrollController,
|
||||
InputTextFieldController textEditingController,
|
||||
User? localUser,
|
||||
IMap<Typed<FixedEncodedString43>, User> remoteUsers,
|
||||
IMap<Typed<FixedEncodedString43>, User> historicalRemoteUsers,
|
||||
IMap<Typed<FixedEncodedString43>, User> unknownUsers,
|
||||
{User? localUser,
|
||||
IMap<String, User> remoteUsers,
|
||||
IMap<String, User> historicalRemoteUsers,
|
||||
IMap<String, User> unknownUsers,
|
||||
AsyncValue<WindowState<Message>> messageWindow,
|
||||
String title});
|
||||
|
||||
$UserCopyWith<$Res>? get localUser;
|
||||
$AsyncValueCopyWith<WindowState<Message>, $Res> get messageWindow;
|
||||
}
|
||||
|
||||
|
@ -110,9 +90,6 @@ class _$ChatComponentStateCopyWithImpl<$Res>
|
|||
@pragma('vm:prefer-inline')
|
||||
@override
|
||||
$Res call({
|
||||
Object? chatKey = null,
|
||||
Object? scrollController = null,
|
||||
Object? textEditingController = null,
|
||||
Object? localUser = freezed,
|
||||
Object? remoteUsers = null,
|
||||
Object? historicalRemoteUsers = null,
|
||||
|
@ -121,18 +98,6 @@ class _$ChatComponentStateCopyWithImpl<$Res>
|
|||
Object? title = null,
|
||||
}) {
|
||||
return _then(_self.copyWith(
|
||||
chatKey: null == chatKey
|
||||
? _self.chatKey
|
||||
: chatKey // ignore: cast_nullable_to_non_nullable
|
||||
as GlobalKey<ChatState>,
|
||||
scrollController: null == scrollController
|
||||
? _self.scrollController
|
||||
: scrollController // ignore: cast_nullable_to_non_nullable
|
||||
as AutoScrollController,
|
||||
textEditingController: null == textEditingController
|
||||
? _self.textEditingController
|
||||
: textEditingController // ignore: cast_nullable_to_non_nullable
|
||||
as InputTextFieldController,
|
||||
localUser: freezed == localUser
|
||||
? _self.localUser
|
||||
: localUser // ignore: cast_nullable_to_non_nullable
|
||||
|
@ -140,15 +105,15 @@ class _$ChatComponentStateCopyWithImpl<$Res>
|
|||
remoteUsers: null == remoteUsers
|
||||
? _self.remoteUsers!
|
||||
: remoteUsers // ignore: cast_nullable_to_non_nullable
|
||||
as IMap<Typed<FixedEncodedString43>, User>,
|
||||
as IMap<String, User>,
|
||||
historicalRemoteUsers: null == historicalRemoteUsers
|
||||
? _self.historicalRemoteUsers!
|
||||
: historicalRemoteUsers // ignore: cast_nullable_to_non_nullable
|
||||
as IMap<Typed<FixedEncodedString43>, User>,
|
||||
as IMap<String, User>,
|
||||
unknownUsers: null == unknownUsers
|
||||
? _self.unknownUsers!
|
||||
: unknownUsers // ignore: cast_nullable_to_non_nullable
|
||||
as IMap<Typed<FixedEncodedString43>, User>,
|
||||
as IMap<String, User>,
|
||||
messageWindow: null == messageWindow
|
||||
? _self.messageWindow
|
||||
: messageWindow // ignore: cast_nullable_to_non_nullable
|
||||
|
@ -160,6 +125,20 @@ class _$ChatComponentStateCopyWithImpl<$Res>
|
|||
));
|
||||
}
|
||||
|
||||
/// Create a copy of ChatComponentState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$UserCopyWith<$Res>? get localUser {
|
||||
if (_self.localUser == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $UserCopyWith<$Res>(_self.localUser!, (value) {
|
||||
return _then(_self.copyWith(localUser: value));
|
||||
});
|
||||
}
|
||||
|
||||
/// Create a copy of ChatComponentState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
|
@ -176,37 +155,25 @@ class _$ChatComponentStateCopyWithImpl<$Res>
|
|||
|
||||
class _ChatComponentState implements ChatComponentState {
|
||||
const _ChatComponentState(
|
||||
{required this.chatKey,
|
||||
required this.scrollController,
|
||||
required this.textEditingController,
|
||||
required this.localUser,
|
||||
{required this.localUser,
|
||||
required this.remoteUsers,
|
||||
required this.historicalRemoteUsers,
|
||||
required this.unknownUsers,
|
||||
required this.messageWindow,
|
||||
required this.title});
|
||||
|
||||
// GlobalKey for the chat
|
||||
@override
|
||||
final GlobalKey<ChatState> chatKey;
|
||||
// ScrollController for the chat
|
||||
@override
|
||||
final AutoScrollController scrollController;
|
||||
// TextEditingController for the chat
|
||||
@override
|
||||
final InputTextFieldController textEditingController;
|
||||
// Local user
|
||||
@override
|
||||
final User? localUser;
|
||||
// Active remote users
|
||||
@override
|
||||
final IMap<Typed<FixedEncodedString43>, User> remoteUsers;
|
||||
final IMap<String, User> remoteUsers;
|
||||
// Historical remote users
|
||||
@override
|
||||
final IMap<Typed<FixedEncodedString43>, User> historicalRemoteUsers;
|
||||
final IMap<String, User> historicalRemoteUsers;
|
||||
// Unknown users
|
||||
@override
|
||||
final IMap<Typed<FixedEncodedString43>, User> unknownUsers;
|
||||
final IMap<String, User> unknownUsers;
|
||||
// Messages state
|
||||
@override
|
||||
final AsyncValue<WindowState<Message>> messageWindow;
|
||||
|
@ -227,11 +194,6 @@ class _ChatComponentState implements ChatComponentState {
|
|||
return identical(this, other) ||
|
||||
(other.runtimeType == runtimeType &&
|
||||
other is _ChatComponentState &&
|
||||
(identical(other.chatKey, chatKey) || other.chatKey == chatKey) &&
|
||||
(identical(other.scrollController, scrollController) ||
|
||||
other.scrollController == scrollController) &&
|
||||
(identical(other.textEditingController, textEditingController) ||
|
||||
other.textEditingController == textEditingController) &&
|
||||
(identical(other.localUser, localUser) ||
|
||||
other.localUser == localUser) &&
|
||||
(identical(other.remoteUsers, remoteUsers) ||
|
||||
|
@ -246,21 +208,12 @@ class _ChatComponentState implements ChatComponentState {
|
|||
}
|
||||
|
||||
@override
|
||||
int get hashCode => Object.hash(
|
||||
runtimeType,
|
||||
chatKey,
|
||||
scrollController,
|
||||
textEditingController,
|
||||
localUser,
|
||||
remoteUsers,
|
||||
historicalRemoteUsers,
|
||||
unknownUsers,
|
||||
messageWindow,
|
||||
title);
|
||||
int get hashCode => Object.hash(runtimeType, localUser, remoteUsers,
|
||||
historicalRemoteUsers, unknownUsers, messageWindow, title);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ChatComponentState(chatKey: $chatKey, scrollController: $scrollController, textEditingController: $textEditingController, localUser: $localUser, remoteUsers: $remoteUsers, historicalRemoteUsers: $historicalRemoteUsers, unknownUsers: $unknownUsers, messageWindow: $messageWindow, title: $title)';
|
||||
return 'ChatComponentState(localUser: $localUser, remoteUsers: $remoteUsers, historicalRemoteUsers: $historicalRemoteUsers, unknownUsers: $unknownUsers, messageWindow: $messageWindow, title: $title)';
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -273,16 +226,15 @@ abstract mixin class _$ChatComponentStateCopyWith<$Res>
|
|||
@override
|
||||
@useResult
|
||||
$Res call(
|
||||
{GlobalKey<ChatState> chatKey,
|
||||
AutoScrollController scrollController,
|
||||
InputTextFieldController textEditingController,
|
||||
User? localUser,
|
||||
IMap<Typed<FixedEncodedString43>, User> remoteUsers,
|
||||
IMap<Typed<FixedEncodedString43>, User> historicalRemoteUsers,
|
||||
IMap<Typed<FixedEncodedString43>, User> unknownUsers,
|
||||
{User? localUser,
|
||||
IMap<String, User> remoteUsers,
|
||||
IMap<String, User> historicalRemoteUsers,
|
||||
IMap<String, User> unknownUsers,
|
||||
AsyncValue<WindowState<Message>> messageWindow,
|
||||
String title});
|
||||
|
||||
@override
|
||||
$UserCopyWith<$Res>? get localUser;
|
||||
@override
|
||||
$AsyncValueCopyWith<WindowState<Message>, $Res> get messageWindow;
|
||||
}
|
||||
|
@ -300,9 +252,6 @@ class __$ChatComponentStateCopyWithImpl<$Res>
|
|||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$Res call({
|
||||
Object? chatKey = null,
|
||||
Object? scrollController = null,
|
||||
Object? textEditingController = null,
|
||||
Object? localUser = freezed,
|
||||
Object? remoteUsers = null,
|
||||
Object? historicalRemoteUsers = null,
|
||||
|
@ -311,18 +260,6 @@ class __$ChatComponentStateCopyWithImpl<$Res>
|
|||
Object? title = null,
|
||||
}) {
|
||||
return _then(_ChatComponentState(
|
||||
chatKey: null == chatKey
|
||||
? _self.chatKey
|
||||
: chatKey // ignore: cast_nullable_to_non_nullable
|
||||
as GlobalKey<ChatState>,
|
||||
scrollController: null == scrollController
|
||||
? _self.scrollController
|
||||
: scrollController // ignore: cast_nullable_to_non_nullable
|
||||
as AutoScrollController,
|
||||
textEditingController: null == textEditingController
|
||||
? _self.textEditingController
|
||||
: textEditingController // ignore: cast_nullable_to_non_nullable
|
||||
as InputTextFieldController,
|
||||
localUser: freezed == localUser
|
||||
? _self.localUser
|
||||
: localUser // ignore: cast_nullable_to_non_nullable
|
||||
|
@ -330,15 +267,15 @@ class __$ChatComponentStateCopyWithImpl<$Res>
|
|||
remoteUsers: null == remoteUsers
|
||||
? _self.remoteUsers
|
||||
: remoteUsers // ignore: cast_nullable_to_non_nullable
|
||||
as IMap<Typed<FixedEncodedString43>, User>,
|
||||
as IMap<String, User>,
|
||||
historicalRemoteUsers: null == historicalRemoteUsers
|
||||
? _self.historicalRemoteUsers
|
||||
: historicalRemoteUsers // ignore: cast_nullable_to_non_nullable
|
||||
as IMap<Typed<FixedEncodedString43>, User>,
|
||||
as IMap<String, User>,
|
||||
unknownUsers: null == unknownUsers
|
||||
? _self.unknownUsers
|
||||
: unknownUsers // ignore: cast_nullable_to_non_nullable
|
||||
as IMap<Typed<FixedEncodedString43>, User>,
|
||||
as IMap<String, User>,
|
||||
messageWindow: null == messageWindow
|
||||
? _self.messageWindow
|
||||
: messageWindow // ignore: cast_nullable_to_non_nullable
|
||||
|
@ -350,6 +287,20 @@ class __$ChatComponentStateCopyWithImpl<$Res>
|
|||
));
|
||||
}
|
||||
|
||||
/// Create a copy of ChatComponentState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$UserCopyWith<$Res>? get localUser {
|
||||
if (_self.localUser == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $UserCopyWith<$Res>(_self.localUser!, (value) {
|
||||
return _then(_self.copyWith(localUser: value));
|
||||
});
|
||||
}
|
||||
|
||||
/// Create a copy of ChatComponentState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue