diff --git a/CHANGELOG.md b/CHANGELOG.md
index f7e369f..843cc65 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,15 @@
+## v0.4.6 ##
+- Updated veilid-core to v0.4.4
+ - See Veilid changelog for specifics
+- UI improvements: Theme fixes, wallpaper option added
+- Responsiveness improved
+- Contacts workflow more consistent
+- Safe-area fixes
+- Make layout more mobile-friendly
+- Improved contact invitation menus
+- Deadlock fixes in veilid_support
+- _pollWatch was degenerate and only watched first subkey
+
## v0.4.5 ##
- Updated veilid-core to v0.4.1
- See Veilid changelog for specifics
diff --git a/assets/images/handshake.png b/assets/images/handshake.png
deleted file mode 100644
index d40fad1..0000000
Binary files a/assets/images/handshake.png and /dev/null differ
diff --git a/assets/images/toilet.png b/assets/images/toilet.png
deleted file mode 100644
index 6c0efa2..0000000
Binary files a/assets/images/toilet.png and /dev/null differ
diff --git a/assets/images/toilet.svg b/assets/images/toilet.svg
new file mode 100644
index 0000000..0984274
--- /dev/null
+++ b/assets/images/toilet.svg
@@ -0,0 +1,9 @@
+
+
+
diff --git a/lib/account_manager/cubits/account_info_cubit.dart b/lib/account_manager/cubits/account_info_cubit.dart
index d9d93fc..a5eab11 100644
--- a/lib/account_manager/cubits/account_info_cubit.dart
+++ b/lib/account_manager/cubits/account_info_cubit.dart
@@ -23,7 +23,6 @@ class AccountInfoCubit extends Cubit {
if (acctInfo != null) {
emit(acctInfo);
}
- break;
}
});
}
diff --git a/lib/account_manager/cubits/local_accounts_cubit.dart b/lib/account_manager/cubits/local_accounts_cubit.dart
index 704d8c5..3781297 100644
--- a/lib/account_manager/cubits/local_accounts_cubit.dart
+++ b/lib/account_manager/cubits/local_accounts_cubit.dart
@@ -20,7 +20,6 @@ class LocalAccountsCubit extends Cubit
switch (change) {
case AccountRepositoryChange.localAccounts:
emit(_accountRepository.getLocalAccounts());
- break;
// Ignore these
case AccountRepositoryChange.userLogins:
case AccountRepositoryChange.activeLocalAccount:
diff --git a/lib/account_manager/cubits/per_account_collection_cubit.dart b/lib/account_manager/cubits/per_account_collection_cubit.dart
index 089443a..fc2d447 100644
--- a/lib/account_manager/cubits/per_account_collection_cubit.dart
+++ b/lib/account_manager/cubits/per_account_collection_cubit.dart
@@ -15,6 +15,9 @@ import '../../notifications/notifications.dart';
import '../../proto/proto.dart' as proto;
import '../account_manager.dart';
+const _kAccountRecordSubscriptionListenKey =
+ 'accountRecordSubscriptionListenKey';
+
class PerAccountCollectionCubit extends Cubit {
PerAccountCollectionCubit({
required Locator locator,
@@ -32,6 +35,7 @@ class PerAccountCollectionCubit extends Cubit {
await _processor.close();
await accountInfoCubit.close();
await _accountRecordSubscription?.cancel();
+ await serialFutureClose((this, _kAccountRecordSubscriptionListenKey));
await accountRecordCubit?.close();
await activeSingleContactChatBlocMapCubitUpdater.close();
@@ -83,7 +87,7 @@ class PerAccountCollectionCubit extends Cubit {
accountRecordCubit = null;
// Update state to 'loading'
- nextState = _updateAccountRecordState(nextState, null);
+ nextState = await _updateAccountRecordState(nextState, null);
emit(nextState);
} else {
///////////////// Logged in ///////////////////
@@ -95,20 +99,22 @@ class PerAccountCollectionCubit extends Cubit {
// Update state to value
nextState =
- _updateAccountRecordState(nextState, accountRecordCubit!.state);
+ await _updateAccountRecordState(nextState, accountRecordCubit!.state);
emit(nextState);
// Subscribe AccountRecordCubit
_accountRecordSubscription ??=
accountRecordCubit!.stream.listen((avAccountRecordState) {
- emit(_updateAccountRecordState(state, avAccountRecordState));
+ serialFuture((this, _kAccountRecordSubscriptionListenKey), () async {
+ emit(await _updateAccountRecordState(state, avAccountRecordState));
+ });
});
}
}
- PerAccountCollectionState _updateAccountRecordState(
+ Future _updateAccountRecordState(
PerAccountCollectionState prevState,
- AsyncValue? avAccountRecordState) {
+ AsyncValue? avAccountRecordState) async {
// Get next state
final nextState =
prevState.copyWith(avAccountRecordState: avAccountRecordState);
@@ -121,8 +127,8 @@ class PerAccountCollectionCubit extends Cubit {
.avAccountRecordState?.asData?.value.contactInvitationRecords
.toVeilid();
- final contactInvitationListCubit = contactInvitationListCubitUpdater.update(
- accountInfo.userLogin == null ||
+ final contactInvitationListCubit = await contactInvitationListCubitUpdater
+ .update(accountInfo.userLogin == null ||
contactInvitationListRecordPointer == null
? null
: (accountInfo, contactInvitationListRecordPointer));
@@ -131,34 +137,35 @@ class PerAccountCollectionCubit extends Cubit {
final contactListRecordPointer =
nextState.avAccountRecordState?.asData?.value.contactList.toVeilid();
- final contactListCubit = contactListCubitUpdater.update(
+ final contactListCubit = await contactListCubitUpdater.update(
accountInfo.userLogin == null || contactListRecordPointer == null
? null
: (accountInfo, contactListRecordPointer));
// WaitingInvitationsBlocMapCubit
- final waitingInvitationsBlocMapCubit = waitingInvitationsBlocMapCubitUpdater
- .update(accountInfo.userLogin == null ||
- contactInvitationListCubit == null ||
- contactListCubit == null
- ? null
- : (
- accountInfo,
- accountRecordCubit!,
- contactInvitationListCubit,
- contactListCubit,
- _locator(),
- ));
+ final waitingInvitationsBlocMapCubit =
+ await waitingInvitationsBlocMapCubitUpdater.update(
+ accountInfo.userLogin == null ||
+ contactInvitationListCubit == null ||
+ contactListCubit == null
+ ? null
+ : (
+ accountInfo,
+ accountRecordCubit!,
+ contactInvitationListCubit,
+ contactListCubit,
+ _locator(),
+ ));
// ActiveChatCubit
- final activeChatCubit = activeChatCubitUpdater
+ final activeChatCubit = await activeChatCubitUpdater
.update((accountInfo.userLogin == null) ? null : true);
// ChatListCubit
final chatListRecordPointer =
nextState.avAccountRecordState?.asData?.value.chatList.toVeilid();
- final chatListCubit = chatListCubitUpdater.update(
+ final chatListCubit = await chatListCubitUpdater.update(
accountInfo.userLogin == null ||
chatListRecordPointer == null ||
activeChatCubit == null
@@ -167,7 +174,7 @@ class PerAccountCollectionCubit extends Cubit {
// ActiveConversationsBlocMapCubit
final activeConversationsBlocMapCubit =
- activeConversationsBlocMapCubitUpdater.update(
+ await activeConversationsBlocMapCubitUpdater.update(
accountRecordCubit == null ||
chatListCubit == null ||
contactListCubit == null
@@ -181,7 +188,7 @@ class PerAccountCollectionCubit extends Cubit {
// ActiveSingleContactChatBlocMapCubit
final activeSingleContactChatBlocMapCubit =
- activeSingleContactChatBlocMapCubitUpdater.update(
+ await activeSingleContactChatBlocMapCubitUpdater.update(
accountInfo.userLogin == null ||
activeConversationsBlocMapCubit == null
? null
diff --git a/lib/account_manager/cubits/user_logins_cubit.dart b/lib/account_manager/cubits/user_logins_cubit.dart
index 734ced3..5623a34 100644
--- a/lib/account_manager/cubits/user_logins_cubit.dart
+++ b/lib/account_manager/cubits/user_logins_cubit.dart
@@ -17,7 +17,6 @@ class UserLoginsCubit extends Cubit {
switch (change) {
case AccountRepositoryChange.userLogins:
emit(_accountRepository.getUserLogins());
- break;
// Ignore these
case AccountRepositoryChange.localAccounts:
case AccountRepositoryChange.activeLocalAccount:
diff --git a/lib/account_manager/models/account_info.dart b/lib/account_manager/models/account_info.dart
index 12ed5e1..8f57add 100644
--- a/lib/account_manager/models/account_info.dart
+++ b/lib/account_manager/models/account_info.dart
@@ -13,7 +13,7 @@ enum AccountInfoStatus {
}
@immutable
-class AccountInfo extends Equatable {
+class AccountInfo extends Equatable implements ToDebugMap {
const AccountInfo({
required this.status,
required this.localAccount,
@@ -30,6 +30,13 @@ class AccountInfo extends Equatable {
localAccount,
userLogin,
];
+
+ @override
+ Map toDebugMap() => {
+ 'status': status,
+ 'localAccount': localAccount,
+ 'userLogin': userLogin,
+ };
}
extension AccountInfoExt on AccountInfo {
diff --git a/lib/account_manager/models/local_account/local_account.dart b/lib/account_manager/models/local_account/local_account.dart
index 76070ae..1ec6d22 100644
--- a/lib/account_manager/models/local_account/local_account.dart
+++ b/lib/account_manager/models/local_account/local_account.dart
@@ -16,7 +16,7 @@ part 'local_account.freezed.dart';
// This is the root of the account information tree for VeilidChat
//
@freezed
-class LocalAccount with _$LocalAccount {
+sealed class LocalAccount with _$LocalAccount {
const factory LocalAccount({
// The super identity key record for the account,
// containing the publicKey in the currentIdentity
diff --git a/lib/account_manager/models/local_account/local_account.freezed.dart b/lib/account_manager/models/local_account/local_account.freezed.dart
index effc69a..e2c3c55 100644
--- a/lib/account_manager/models/local_account/local_account.freezed.dart
+++ b/lib/account_manager/models/local_account/local_account.freezed.dart
@@ -1,3 +1,4 @@
+// dart format width=80
// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint
@@ -9,238 +10,43 @@ part of 'local_account.dart';
// FreezedGenerator
// **************************************************************************
+// dart format off
T _$identity(T value) => value;
-final _privateConstructorUsedError = UnsupportedError(
- 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
-
-LocalAccount _$LocalAccountFromJson(Map json) {
- return _LocalAccount.fromJson(json);
-}
-
/// @nodoc
mixin _$LocalAccount {
// The super identity key record for the account,
// containing the publicKey in the currentIdentity
- SuperIdentity get superIdentity =>
- throw _privateConstructorUsedError; // The encrypted currentIdentity secret that goes with
+ SuperIdentity
+ get superIdentity; // The encrypted currentIdentity secret that goes with
// the identityPublicKey with appended salt
@Uint8ListJsonConverter()
- Uint8List get identitySecretBytes =>
- throw _privateConstructorUsedError; // The kind of encryption input used on the account
- EncryptionKeyType get encryptionKeyType =>
- throw _privateConstructorUsedError; // If account is not hidden, password can be retrieved via
- bool get biometricsEnabled =>
- throw _privateConstructorUsedError; // Keep account hidden unless account password is entered
+ Uint8List
+ get identitySecretBytes; // The kind of encryption input used on the account
+ EncryptionKeyType
+ get encryptionKeyType; // If account is not hidden, password can be retrieved via
+ bool
+ get biometricsEnabled; // Keep account hidden unless account password is entered
// (tries all hidden accounts with auth method (no biometrics))
- bool get hiddenAccount =>
- throw _privateConstructorUsedError; // Display name for account until it is unlocked
- String get name => throw _privateConstructorUsedError;
-
- /// Serializes this LocalAccount to a JSON map.
- Map toJson() => throw _privateConstructorUsedError;
+ bool get hiddenAccount; // Display name for account until it is unlocked
+ String get name;
/// Create a copy of LocalAccount
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
+ @pragma('vm:prefer-inline')
$LocalAccountCopyWith get copyWith =>
- throw _privateConstructorUsedError;
-}
+ _$LocalAccountCopyWithImpl(
+ this as LocalAccount, _$identity);
-/// @nodoc
-abstract class $LocalAccountCopyWith<$Res> {
- factory $LocalAccountCopyWith(
- LocalAccount value, $Res Function(LocalAccount) then) =
- _$LocalAccountCopyWithImpl<$Res, LocalAccount>;
- @useResult
- $Res call(
- {SuperIdentity superIdentity,
- @Uint8ListJsonConverter() Uint8List identitySecretBytes,
- EncryptionKeyType encryptionKeyType,
- bool biometricsEnabled,
- bool hiddenAccount,
- String name});
-
- $SuperIdentityCopyWith<$Res> get superIdentity;
-}
-
-/// @nodoc
-class _$LocalAccountCopyWithImpl<$Res, $Val extends LocalAccount>
- implements $LocalAccountCopyWith<$Res> {
- _$LocalAccountCopyWithImpl(this._value, this._then);
-
- // ignore: unused_field
- final $Val _value;
- // ignore: unused_field
- final $Res Function($Val) _then;
-
- /// Create a copy of LocalAccount
- /// with the given fields replaced by the non-null parameter values.
- @pragma('vm:prefer-inline')
- @override
- $Res call({
- Object? superIdentity = null,
- Object? identitySecretBytes = null,
- Object? encryptionKeyType = null,
- Object? biometricsEnabled = null,
- Object? hiddenAccount = null,
- Object? name = null,
- }) {
- return _then(_value.copyWith(
- superIdentity: null == superIdentity
- ? _value.superIdentity
- : superIdentity // ignore: cast_nullable_to_non_nullable
- as SuperIdentity,
- identitySecretBytes: null == identitySecretBytes
- ? _value.identitySecretBytes
- : identitySecretBytes // ignore: cast_nullable_to_non_nullable
- as Uint8List,
- encryptionKeyType: null == encryptionKeyType
- ? _value.encryptionKeyType
- : encryptionKeyType // ignore: cast_nullable_to_non_nullable
- as EncryptionKeyType,
- biometricsEnabled: null == biometricsEnabled
- ? _value.biometricsEnabled
- : biometricsEnabled // ignore: cast_nullable_to_non_nullable
- as bool,
- hiddenAccount: null == hiddenAccount
- ? _value.hiddenAccount
- : hiddenAccount // ignore: cast_nullable_to_non_nullable
- as bool,
- name: null == name
- ? _value.name
- : name // ignore: cast_nullable_to_non_nullable
- as String,
- ) as $Val);
- }
-
- /// Create a copy of LocalAccount
- /// with the given fields replaced by the non-null parameter values.
- @override
- @pragma('vm:prefer-inline')
- $SuperIdentityCopyWith<$Res> get superIdentity {
- return $SuperIdentityCopyWith<$Res>(_value.superIdentity, (value) {
- return _then(_value.copyWith(superIdentity: value) as $Val);
- });
- }
-}
-
-/// @nodoc
-abstract class _$$LocalAccountImplCopyWith<$Res>
- implements $LocalAccountCopyWith<$Res> {
- factory _$$LocalAccountImplCopyWith(
- _$LocalAccountImpl value, $Res Function(_$LocalAccountImpl) then) =
- __$$LocalAccountImplCopyWithImpl<$Res>;
- @override
- @useResult
- $Res call(
- {SuperIdentity superIdentity,
- @Uint8ListJsonConverter() Uint8List identitySecretBytes,
- EncryptionKeyType encryptionKeyType,
- bool biometricsEnabled,
- bool hiddenAccount,
- String name});
-
- @override
- $SuperIdentityCopyWith<$Res> get superIdentity;
-}
-
-/// @nodoc
-class __$$LocalAccountImplCopyWithImpl<$Res>
- extends _$LocalAccountCopyWithImpl<$Res, _$LocalAccountImpl>
- implements _$$LocalAccountImplCopyWith<$Res> {
- __$$LocalAccountImplCopyWithImpl(
- _$LocalAccountImpl _value, $Res Function(_$LocalAccountImpl) _then)
- : super(_value, _then);
-
- /// Create a copy of LocalAccount
- /// with the given fields replaced by the non-null parameter values.
- @pragma('vm:prefer-inline')
- @override
- $Res call({
- Object? superIdentity = null,
- Object? identitySecretBytes = null,
- Object? encryptionKeyType = null,
- Object? biometricsEnabled = null,
- Object? hiddenAccount = null,
- Object? name = null,
- }) {
- return _then(_$LocalAccountImpl(
- superIdentity: null == superIdentity
- ? _value.superIdentity
- : superIdentity // ignore: cast_nullable_to_non_nullable
- as SuperIdentity,
- identitySecretBytes: null == identitySecretBytes
- ? _value.identitySecretBytes
- : identitySecretBytes // ignore: cast_nullable_to_non_nullable
- as Uint8List,
- encryptionKeyType: null == encryptionKeyType
- ? _value.encryptionKeyType
- : encryptionKeyType // ignore: cast_nullable_to_non_nullable
- as EncryptionKeyType,
- biometricsEnabled: null == biometricsEnabled
- ? _value.biometricsEnabled
- : biometricsEnabled // ignore: cast_nullable_to_non_nullable
- as bool,
- hiddenAccount: null == hiddenAccount
- ? _value.hiddenAccount
- : hiddenAccount // ignore: cast_nullable_to_non_nullable
- as bool,
- name: null == name
- ? _value.name
- : name // ignore: cast_nullable_to_non_nullable
- as String,
- ));
- }
-}
-
-/// @nodoc
-@JsonSerializable()
-class _$LocalAccountImpl implements _LocalAccount {
- const _$LocalAccountImpl(
- {required this.superIdentity,
- @Uint8ListJsonConverter() required this.identitySecretBytes,
- required this.encryptionKeyType,
- required this.biometricsEnabled,
- required this.hiddenAccount,
- required this.name});
-
- factory _$LocalAccountImpl.fromJson(Map json) =>
- _$$LocalAccountImplFromJson(json);
-
-// The super identity key record for the account,
-// containing the publicKey in the currentIdentity
- @override
- final SuperIdentity superIdentity;
-// The encrypted currentIdentity secret that goes with
-// the identityPublicKey with appended salt
- @override
- @Uint8ListJsonConverter()
- final Uint8List identitySecretBytes;
-// The kind of encryption input used on the account
- @override
- final EncryptionKeyType encryptionKeyType;
-// If account is not hidden, password can be retrieved via
- @override
- final bool biometricsEnabled;
-// Keep account hidden unless account password is entered
-// (tries all hidden accounts with auth method (no biometrics))
- @override
- final bool hiddenAccount;
-// Display name for account until it is unlocked
- @override
- final String name;
-
- @override
- String toString() {
- return 'LocalAccount(superIdentity: $superIdentity, identitySecretBytes: $identitySecretBytes, encryptionKeyType: $encryptionKeyType, biometricsEnabled: $biometricsEnabled, hiddenAccount: $hiddenAccount, name: $name)';
- }
+ /// Serializes this LocalAccount to a JSON map.
+ Map toJson();
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
- other is _$LocalAccountImpl &&
+ other is LocalAccount &&
(identical(other.superIdentity, superIdentity) ||
other.superIdentity == superIdentity) &&
const DeepCollectionEquality()
@@ -265,60 +71,250 @@ class _$LocalAccountImpl implements _LocalAccount {
hiddenAccount,
name);
- /// Create a copy of LocalAccount
- /// with the given fields replaced by the non-null parameter values.
- @JsonKey(includeFromJson: false, includeToJson: false)
@override
- @pragma('vm:prefer-inline')
- _$$LocalAccountImplCopyWith<_$LocalAccountImpl> get copyWith =>
- __$$LocalAccountImplCopyWithImpl<_$LocalAccountImpl>(this, _$identity);
-
- @override
- Map toJson() {
- return _$$LocalAccountImplToJson(
- this,
- );
+ String toString() {
+ return 'LocalAccount(superIdentity: $superIdentity, identitySecretBytes: $identitySecretBytes, encryptionKeyType: $encryptionKeyType, biometricsEnabled: $biometricsEnabled, hiddenAccount: $hiddenAccount, name: $name)';
}
}
-abstract class _LocalAccount implements LocalAccount {
- const factory _LocalAccount(
- {required final SuperIdentity superIdentity,
- @Uint8ListJsonConverter() required final Uint8List identitySecretBytes,
- required final EncryptionKeyType encryptionKeyType,
- required final bool biometricsEnabled,
- required final bool hiddenAccount,
- required final String name}) = _$LocalAccountImpl;
+/// @nodoc
+abstract mixin class $LocalAccountCopyWith<$Res> {
+ factory $LocalAccountCopyWith(
+ LocalAccount value, $Res Function(LocalAccount) _then) =
+ _$LocalAccountCopyWithImpl;
+ @useResult
+ $Res call(
+ {SuperIdentity superIdentity,
+ @Uint8ListJsonConverter() Uint8List identitySecretBytes,
+ EncryptionKeyType encryptionKeyType,
+ bool biometricsEnabled,
+ bool hiddenAccount,
+ String name});
- factory _LocalAccount.fromJson(Map json) =
- _$LocalAccountImpl.fromJson;
+ $SuperIdentityCopyWith<$Res> get superIdentity;
+}
+
+/// @nodoc
+class _$LocalAccountCopyWithImpl<$Res> implements $LocalAccountCopyWith<$Res> {
+ _$LocalAccountCopyWithImpl(this._self, this._then);
+
+ final LocalAccount _self;
+ final $Res Function(LocalAccount) _then;
+
+ /// Create a copy of LocalAccount
+ /// with the given fields replaced by the non-null parameter values.
+ @pragma('vm:prefer-inline')
+ @override
+ $Res call({
+ Object? superIdentity = null,
+ Object? identitySecretBytes = null,
+ Object? encryptionKeyType = null,
+ Object? biometricsEnabled = null,
+ Object? hiddenAccount = null,
+ Object? name = null,
+ }) {
+ return _then(_self.copyWith(
+ superIdentity: null == superIdentity
+ ? _self.superIdentity
+ : superIdentity // ignore: cast_nullable_to_non_nullable
+ as SuperIdentity,
+ identitySecretBytes: null == identitySecretBytes
+ ? _self.identitySecretBytes
+ : identitySecretBytes // ignore: cast_nullable_to_non_nullable
+ as Uint8List,
+ encryptionKeyType: null == encryptionKeyType
+ ? _self.encryptionKeyType
+ : encryptionKeyType // ignore: cast_nullable_to_non_nullable
+ as EncryptionKeyType,
+ biometricsEnabled: null == biometricsEnabled
+ ? _self.biometricsEnabled
+ : biometricsEnabled // ignore: cast_nullable_to_non_nullable
+ as bool,
+ hiddenAccount: null == hiddenAccount
+ ? _self.hiddenAccount
+ : hiddenAccount // ignore: cast_nullable_to_non_nullable
+ as bool,
+ name: null == name
+ ? _self.name
+ : name // ignore: cast_nullable_to_non_nullable
+ as String,
+ ));
+ }
+
+ /// Create a copy of LocalAccount
+ /// with the given fields replaced by the non-null parameter values.
+ @override
+ @pragma('vm:prefer-inline')
+ $SuperIdentityCopyWith<$Res> get superIdentity {
+ return $SuperIdentityCopyWith<$Res>(_self.superIdentity, (value) {
+ return _then(_self.copyWith(superIdentity: value));
+ });
+ }
+}
+
+/// @nodoc
+@JsonSerializable()
+class _LocalAccount implements LocalAccount {
+ const _LocalAccount(
+ {required this.superIdentity,
+ @Uint8ListJsonConverter() required this.identitySecretBytes,
+ required this.encryptionKeyType,
+ required this.biometricsEnabled,
+ required this.hiddenAccount,
+ required this.name});
+ factory _LocalAccount.fromJson(Map json) =>
+ _$LocalAccountFromJson(json);
// The super identity key record for the account,
// containing the publicKey in the currentIdentity
@override
- SuperIdentity
- get superIdentity; // The encrypted currentIdentity secret that goes with
+ final SuperIdentity superIdentity;
+// The encrypted currentIdentity secret that goes with
// the identityPublicKey with appended salt
@override
@Uint8ListJsonConverter()
- Uint8List
- get identitySecretBytes; // The kind of encryption input used on the account
+ final Uint8List identitySecretBytes;
+// The kind of encryption input used on the account
@override
- EncryptionKeyType
- get encryptionKeyType; // If account is not hidden, password can be retrieved via
+ final EncryptionKeyType encryptionKeyType;
+// If account is not hidden, password can be retrieved via
@override
- bool
- get biometricsEnabled; // Keep account hidden unless account password is entered
+ final bool biometricsEnabled;
+// Keep account hidden unless account password is entered
// (tries all hidden accounts with auth method (no biometrics))
@override
- bool get hiddenAccount; // Display name for account until it is unlocked
+ final bool hiddenAccount;
+// Display name for account until it is unlocked
@override
- String get name;
+ final String name;
/// Create a copy of LocalAccount
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
- _$$LocalAccountImplCopyWith<_$LocalAccountImpl> get copyWith =>
- throw _privateConstructorUsedError;
+ @pragma('vm:prefer-inline')
+ _$LocalAccountCopyWith<_LocalAccount> get copyWith =>
+ __$LocalAccountCopyWithImpl<_LocalAccount>(this, _$identity);
+
+ @override
+ Map toJson() {
+ return _$LocalAccountToJson(
+ this,
+ );
+ }
+
+ @override
+ bool operator ==(Object other) {
+ return identical(this, other) ||
+ (other.runtimeType == runtimeType &&
+ other is _LocalAccount &&
+ (identical(other.superIdentity, superIdentity) ||
+ other.superIdentity == superIdentity) &&
+ const DeepCollectionEquality()
+ .equals(other.identitySecretBytes, identitySecretBytes) &&
+ (identical(other.encryptionKeyType, encryptionKeyType) ||
+ other.encryptionKeyType == encryptionKeyType) &&
+ (identical(other.biometricsEnabled, biometricsEnabled) ||
+ other.biometricsEnabled == biometricsEnabled) &&
+ (identical(other.hiddenAccount, hiddenAccount) ||
+ other.hiddenAccount == hiddenAccount) &&
+ (identical(other.name, name) || other.name == name));
+ }
+
+ @JsonKey(includeFromJson: false, includeToJson: false)
+ @override
+ int get hashCode => Object.hash(
+ runtimeType,
+ superIdentity,
+ const DeepCollectionEquality().hash(identitySecretBytes),
+ encryptionKeyType,
+ biometricsEnabled,
+ hiddenAccount,
+ name);
+
+ @override
+ String toString() {
+ return 'LocalAccount(superIdentity: $superIdentity, identitySecretBytes: $identitySecretBytes, encryptionKeyType: $encryptionKeyType, biometricsEnabled: $biometricsEnabled, hiddenAccount: $hiddenAccount, name: $name)';
+ }
}
+
+/// @nodoc
+abstract mixin class _$LocalAccountCopyWith<$Res>
+ implements $LocalAccountCopyWith<$Res> {
+ factory _$LocalAccountCopyWith(
+ _LocalAccount value, $Res Function(_LocalAccount) _then) =
+ __$LocalAccountCopyWithImpl;
+ @override
+ @useResult
+ $Res call(
+ {SuperIdentity superIdentity,
+ @Uint8ListJsonConverter() Uint8List identitySecretBytes,
+ EncryptionKeyType encryptionKeyType,
+ bool biometricsEnabled,
+ bool hiddenAccount,
+ String name});
+
+ @override
+ $SuperIdentityCopyWith<$Res> get superIdentity;
+}
+
+/// @nodoc
+class __$LocalAccountCopyWithImpl<$Res>
+ implements _$LocalAccountCopyWith<$Res> {
+ __$LocalAccountCopyWithImpl(this._self, this._then);
+
+ final _LocalAccount _self;
+ final $Res Function(_LocalAccount) _then;
+
+ /// Create a copy of LocalAccount
+ /// with the given fields replaced by the non-null parameter values.
+ @override
+ @pragma('vm:prefer-inline')
+ $Res call({
+ Object? superIdentity = null,
+ Object? identitySecretBytes = null,
+ Object? encryptionKeyType = null,
+ Object? biometricsEnabled = null,
+ Object? hiddenAccount = null,
+ Object? name = null,
+ }) {
+ return _then(_LocalAccount(
+ superIdentity: null == superIdentity
+ ? _self.superIdentity
+ : superIdentity // ignore: cast_nullable_to_non_nullable
+ as SuperIdentity,
+ identitySecretBytes: null == identitySecretBytes
+ ? _self.identitySecretBytes
+ : identitySecretBytes // ignore: cast_nullable_to_non_nullable
+ as Uint8List,
+ encryptionKeyType: null == encryptionKeyType
+ ? _self.encryptionKeyType
+ : encryptionKeyType // ignore: cast_nullable_to_non_nullable
+ as EncryptionKeyType,
+ biometricsEnabled: null == biometricsEnabled
+ ? _self.biometricsEnabled
+ : biometricsEnabled // ignore: cast_nullable_to_non_nullable
+ as bool,
+ hiddenAccount: null == hiddenAccount
+ ? _self.hiddenAccount
+ : hiddenAccount // ignore: cast_nullable_to_non_nullable
+ as bool,
+ name: null == name
+ ? _self.name
+ : name // ignore: cast_nullable_to_non_nullable
+ as String,
+ ));
+ }
+
+ /// Create a copy of LocalAccount
+ /// with the given fields replaced by the non-null parameter values.
+ @override
+ @pragma('vm:prefer-inline')
+ $SuperIdentityCopyWith<$Res> get superIdentity {
+ return $SuperIdentityCopyWith<$Res>(_self.superIdentity, (value) {
+ return _then(_self.copyWith(superIdentity: value));
+ });
+ }
+}
+
+// dart format on
diff --git a/lib/account_manager/models/local_account/local_account.g.dart b/lib/account_manager/models/local_account/local_account.g.dart
index b60c226..40d55e5 100644
--- a/lib/account_manager/models/local_account/local_account.g.dart
+++ b/lib/account_manager/models/local_account/local_account.g.dart
@@ -6,8 +6,8 @@ part of 'local_account.dart';
// JsonSerializableGenerator
// **************************************************************************
-_$LocalAccountImpl _$$LocalAccountImplFromJson(Map json) =>
- _$LocalAccountImpl(
+_LocalAccount _$LocalAccountFromJson(Map json) =>
+ _LocalAccount(
superIdentity: SuperIdentity.fromJson(json['super_identity']),
identitySecretBytes: const Uint8ListJsonConverter()
.fromJson(json['identity_secret_bytes']),
@@ -18,7 +18,7 @@ _$LocalAccountImpl _$$LocalAccountImplFromJson(Map json) =>
name: json['name'] as String,
);
-Map _$$LocalAccountImplToJson(_$LocalAccountImpl instance) =>
+Map _$LocalAccountToJson(_LocalAccount instance) =>
{
'super_identity': instance.superIdentity.toJson(),
'identity_secret_bytes':
diff --git a/lib/account_manager/models/per_account_collection_state/per_account_collection_state.dart b/lib/account_manager/models/per_account_collection_state/per_account_collection_state.dart
index 9e0a6f0..24a394c 100644
--- a/lib/account_manager/models/per_account_collection_state/per_account_collection_state.dart
+++ b/lib/account_manager/models/per_account_collection_state/per_account_collection_state.dart
@@ -2,6 +2,7 @@ import 'package:async_tools/async_tools.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:freezed_annotation/freezed_annotation.dart';
+import 'package:veilid_support/veilid_support.dart';
import '../../../chat/chat.dart';
import '../../../chat_list/chat_list.dart';
@@ -14,7 +15,9 @@ import '../../account_manager.dart';
part 'per_account_collection_state.freezed.dart';
@freezed
-class PerAccountCollectionState with _$PerAccountCollectionState {
+sealed class PerAccountCollectionState
+ with _$PerAccountCollectionState
+ implements ToDebugMap {
const factory PerAccountCollectionState({
required AccountInfo accountInfo,
required AsyncValue? avAccountRecordState,
@@ -29,6 +32,23 @@ class PerAccountCollectionState with _$PerAccountCollectionState {
required ActiveSingleContactChatBlocMapCubit?
activeSingleContactChatBlocMapCubit,
}) = _PerAccountCollectionState;
+ const PerAccountCollectionState._();
+
+ @override
+ Map toDebugMap() => {
+ 'accountInfo': accountInfo,
+ 'avAccountRecordState': avAccountRecordState,
+ 'accountInfoCubit': accountInfoCubit,
+ 'accountRecordCubit': accountRecordCubit,
+ 'contactInvitationListCubit': contactInvitationListCubit,
+ 'contactListCubit': contactListCubit,
+ 'waitingInvitationsBlocMapCubit': waitingInvitationsBlocMapCubit,
+ 'activeChatCubit': activeChatCubit,
+ 'chatListCubit': chatListCubit,
+ 'activeConversationsBlocMapCubit': activeConversationsBlocMapCubit,
+ 'activeSingleContactChatBlocMapCubit':
+ activeSingleContactChatBlocMapCubit,
+ };
}
extension PerAccountCollectionStateExt on PerAccountCollectionState {
diff --git a/lib/account_manager/models/per_account_collection_state/per_account_collection_state.freezed.dart b/lib/account_manager/models/per_account_collection_state/per_account_collection_state.freezed.dart
index 1aa0c7e..4c2e219 100644
--- a/lib/account_manager/models/per_account_collection_state/per_account_collection_state.freezed.dart
+++ b/lib/account_manager/models/per_account_collection_state/per_account_collection_state.freezed.dart
@@ -1,3 +1,4 @@
+// dart format width=80
// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint
@@ -9,311 +10,36 @@ part of 'per_account_collection_state.dart';
// FreezedGenerator
// **************************************************************************
+// dart format off
T _$identity(T value) => value;
-final _privateConstructorUsedError = UnsupportedError(
- 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
-
/// @nodoc
mixin _$PerAccountCollectionState {
- AccountInfo get accountInfo => throw _privateConstructorUsedError;
- AsyncValue? get avAccountRecordState =>
- throw _privateConstructorUsedError;
- AccountInfoCubit? get accountInfoCubit => throw _privateConstructorUsedError;
- AccountRecordCubit? get accountRecordCubit =>
- throw _privateConstructorUsedError;
- ContactInvitationListCubit? get contactInvitationListCubit =>
- throw _privateConstructorUsedError;
- ContactListCubit? get contactListCubit => throw _privateConstructorUsedError;
- WaitingInvitationsBlocMapCubit? get waitingInvitationsBlocMapCubit =>
- throw _privateConstructorUsedError;
- ActiveChatCubit? get activeChatCubit => throw _privateConstructorUsedError;
- ChatListCubit? get chatListCubit => throw _privateConstructorUsedError;
- ActiveConversationsBlocMapCubit? get activeConversationsBlocMapCubit =>
- throw _privateConstructorUsedError;
- ActiveSingleContactChatBlocMapCubit?
- get activeSingleContactChatBlocMapCubit =>
- throw _privateConstructorUsedError;
+ AccountInfo get accountInfo;
+ AsyncValue? get avAccountRecordState;
+ AccountInfoCubit? get accountInfoCubit;
+ AccountRecordCubit? get accountRecordCubit;
+ ContactInvitationListCubit? get contactInvitationListCubit;
+ ContactListCubit? get contactListCubit;
+ WaitingInvitationsBlocMapCubit? get waitingInvitationsBlocMapCubit;
+ ActiveChatCubit? get activeChatCubit;
+ ChatListCubit? get chatListCubit;
+ ActiveConversationsBlocMapCubit? get activeConversationsBlocMapCubit;
+ ActiveSingleContactChatBlocMapCubit? get activeSingleContactChatBlocMapCubit;
/// Create a copy of PerAccountCollectionState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
+ @pragma('vm:prefer-inline')
$PerAccountCollectionStateCopyWith get copyWith =>
- throw _privateConstructorUsedError;
-}
-
-/// @nodoc
-abstract class $PerAccountCollectionStateCopyWith<$Res> {
- factory $PerAccountCollectionStateCopyWith(PerAccountCollectionState value,
- $Res Function(PerAccountCollectionState) then) =
- _$PerAccountCollectionStateCopyWithImpl<$Res, PerAccountCollectionState>;
- @useResult
- $Res call(
- {AccountInfo accountInfo,
- AsyncValue? avAccountRecordState,
- AccountInfoCubit? accountInfoCubit,
- AccountRecordCubit? accountRecordCubit,
- ContactInvitationListCubit? contactInvitationListCubit,
- ContactListCubit? contactListCubit,
- WaitingInvitationsBlocMapCubit? waitingInvitationsBlocMapCubit,
- ActiveChatCubit? activeChatCubit,
- ChatListCubit? chatListCubit,
- ActiveConversationsBlocMapCubit? activeConversationsBlocMapCubit,
- ActiveSingleContactChatBlocMapCubit?
- activeSingleContactChatBlocMapCubit});
-
- $AsyncValueCopyWith? get avAccountRecordState;
-}
-
-/// @nodoc
-class _$PerAccountCollectionStateCopyWithImpl<$Res,
- $Val extends PerAccountCollectionState>
- implements $PerAccountCollectionStateCopyWith<$Res> {
- _$PerAccountCollectionStateCopyWithImpl(this._value, this._then);
-
- // ignore: unused_field
- final $Val _value;
- // ignore: unused_field
- final $Res Function($Val) _then;
-
- /// Create a copy of PerAccountCollectionState
- /// with the given fields replaced by the non-null parameter values.
- @pragma('vm:prefer-inline')
- @override
- $Res call({
- Object? accountInfo = null,
- Object? avAccountRecordState = freezed,
- Object? accountInfoCubit = freezed,
- Object? accountRecordCubit = freezed,
- Object? contactInvitationListCubit = freezed,
- Object? contactListCubit = freezed,
- Object? waitingInvitationsBlocMapCubit = freezed,
- Object? activeChatCubit = freezed,
- Object? chatListCubit = freezed,
- Object? activeConversationsBlocMapCubit = freezed,
- Object? activeSingleContactChatBlocMapCubit = freezed,
- }) {
- return _then(_value.copyWith(
- accountInfo: null == accountInfo
- ? _value.accountInfo
- : accountInfo // ignore: cast_nullable_to_non_nullable
- as AccountInfo,
- avAccountRecordState: freezed == avAccountRecordState
- ? _value.avAccountRecordState
- : avAccountRecordState // ignore: cast_nullable_to_non_nullable
- as AsyncValue?,
- accountInfoCubit: freezed == accountInfoCubit
- ? _value.accountInfoCubit
- : accountInfoCubit // ignore: cast_nullable_to_non_nullable
- as AccountInfoCubit?,
- accountRecordCubit: freezed == accountRecordCubit
- ? _value.accountRecordCubit
- : accountRecordCubit // ignore: cast_nullable_to_non_nullable
- as AccountRecordCubit?,
- contactInvitationListCubit: freezed == contactInvitationListCubit
- ? _value.contactInvitationListCubit
- : contactInvitationListCubit // ignore: cast_nullable_to_non_nullable
- as ContactInvitationListCubit?,
- contactListCubit: freezed == contactListCubit
- ? _value.contactListCubit
- : contactListCubit // ignore: cast_nullable_to_non_nullable
- as ContactListCubit?,
- waitingInvitationsBlocMapCubit: freezed == waitingInvitationsBlocMapCubit
- ? _value.waitingInvitationsBlocMapCubit
- : waitingInvitationsBlocMapCubit // ignore: cast_nullable_to_non_nullable
- as WaitingInvitationsBlocMapCubit?,
- activeChatCubit: freezed == activeChatCubit
- ? _value.activeChatCubit
- : activeChatCubit // ignore: cast_nullable_to_non_nullable
- as ActiveChatCubit?,
- chatListCubit: freezed == chatListCubit
- ? _value.chatListCubit
- : chatListCubit // ignore: cast_nullable_to_non_nullable
- as ChatListCubit?,
- activeConversationsBlocMapCubit: freezed ==
- activeConversationsBlocMapCubit
- ? _value.activeConversationsBlocMapCubit
- : activeConversationsBlocMapCubit // ignore: cast_nullable_to_non_nullable
- as ActiveConversationsBlocMapCubit?,
- activeSingleContactChatBlocMapCubit: freezed ==
- activeSingleContactChatBlocMapCubit
- ? _value.activeSingleContactChatBlocMapCubit
- : activeSingleContactChatBlocMapCubit // ignore: cast_nullable_to_non_nullable
- as ActiveSingleContactChatBlocMapCubit?,
- ) as $Val);
- }
-
- /// Create a copy of PerAccountCollectionState
- /// with the given fields replaced by the non-null parameter values.
- @override
- @pragma('vm:prefer-inline')
- $AsyncValueCopyWith? get avAccountRecordState {
- if (_value.avAccountRecordState == null) {
- return null;
- }
-
- return $AsyncValueCopyWith(_value.avAccountRecordState!,
- (value) {
- return _then(_value.copyWith(avAccountRecordState: value) as $Val);
- });
- }
-}
-
-/// @nodoc
-abstract class _$$PerAccountCollectionStateImplCopyWith<$Res>
- implements $PerAccountCollectionStateCopyWith<$Res> {
- factory _$$PerAccountCollectionStateImplCopyWith(
- _$PerAccountCollectionStateImpl value,
- $Res Function(_$PerAccountCollectionStateImpl) then) =
- __$$PerAccountCollectionStateImplCopyWithImpl<$Res>;
- @override
- @useResult
- $Res call(
- {AccountInfo accountInfo,
- AsyncValue? avAccountRecordState,
- AccountInfoCubit? accountInfoCubit,
- AccountRecordCubit? accountRecordCubit,
- ContactInvitationListCubit? contactInvitationListCubit,
- ContactListCubit? contactListCubit,
- WaitingInvitationsBlocMapCubit? waitingInvitationsBlocMapCubit,
- ActiveChatCubit? activeChatCubit,
- ChatListCubit? chatListCubit,
- ActiveConversationsBlocMapCubit? activeConversationsBlocMapCubit,
- ActiveSingleContactChatBlocMapCubit?
- activeSingleContactChatBlocMapCubit});
-
- @override
- $AsyncValueCopyWith? get avAccountRecordState;
-}
-
-/// @nodoc
-class __$$PerAccountCollectionStateImplCopyWithImpl<$Res>
- extends _$PerAccountCollectionStateCopyWithImpl<$Res,
- _$PerAccountCollectionStateImpl>
- implements _$$PerAccountCollectionStateImplCopyWith<$Res> {
- __$$PerAccountCollectionStateImplCopyWithImpl(
- _$PerAccountCollectionStateImpl _value,
- $Res Function(_$PerAccountCollectionStateImpl) _then)
- : super(_value, _then);
-
- /// Create a copy of PerAccountCollectionState
- /// with the given fields replaced by the non-null parameter values.
- @pragma('vm:prefer-inline')
- @override
- $Res call({
- Object? accountInfo = null,
- Object? avAccountRecordState = freezed,
- Object? accountInfoCubit = freezed,
- Object? accountRecordCubit = freezed,
- Object? contactInvitationListCubit = freezed,
- Object? contactListCubit = freezed,
- Object? waitingInvitationsBlocMapCubit = freezed,
- Object? activeChatCubit = freezed,
- Object? chatListCubit = freezed,
- Object? activeConversationsBlocMapCubit = freezed,
- Object? activeSingleContactChatBlocMapCubit = freezed,
- }) {
- return _then(_$PerAccountCollectionStateImpl(
- accountInfo: null == accountInfo
- ? _value.accountInfo
- : accountInfo // ignore: cast_nullable_to_non_nullable
- as AccountInfo,
- avAccountRecordState: freezed == avAccountRecordState
- ? _value.avAccountRecordState
- : avAccountRecordState // ignore: cast_nullable_to_non_nullable
- as AsyncValue?,
- accountInfoCubit: freezed == accountInfoCubit
- ? _value.accountInfoCubit
- : accountInfoCubit // ignore: cast_nullable_to_non_nullable
- as AccountInfoCubit?,
- accountRecordCubit: freezed == accountRecordCubit
- ? _value.accountRecordCubit
- : accountRecordCubit // ignore: cast_nullable_to_non_nullable
- as AccountRecordCubit?,
- contactInvitationListCubit: freezed == contactInvitationListCubit
- ? _value.contactInvitationListCubit
- : contactInvitationListCubit // ignore: cast_nullable_to_non_nullable
- as ContactInvitationListCubit?,
- contactListCubit: freezed == contactListCubit
- ? _value.contactListCubit
- : contactListCubit // ignore: cast_nullable_to_non_nullable
- as ContactListCubit?,
- waitingInvitationsBlocMapCubit: freezed == waitingInvitationsBlocMapCubit
- ? _value.waitingInvitationsBlocMapCubit
- : waitingInvitationsBlocMapCubit // ignore: cast_nullable_to_non_nullable
- as WaitingInvitationsBlocMapCubit?,
- activeChatCubit: freezed == activeChatCubit
- ? _value.activeChatCubit
- : activeChatCubit // ignore: cast_nullable_to_non_nullable
- as ActiveChatCubit?,
- chatListCubit: freezed == chatListCubit
- ? _value.chatListCubit
- : chatListCubit // ignore: cast_nullable_to_non_nullable
- as ChatListCubit?,
- activeConversationsBlocMapCubit: freezed ==
- activeConversationsBlocMapCubit
- ? _value.activeConversationsBlocMapCubit
- : activeConversationsBlocMapCubit // ignore: cast_nullable_to_non_nullable
- as ActiveConversationsBlocMapCubit?,
- activeSingleContactChatBlocMapCubit: freezed ==
- activeSingleContactChatBlocMapCubit
- ? _value.activeSingleContactChatBlocMapCubit
- : activeSingleContactChatBlocMapCubit // ignore: cast_nullable_to_non_nullable
- as ActiveSingleContactChatBlocMapCubit?,
- ));
- }
-}
-
-/// @nodoc
-
-class _$PerAccountCollectionStateImpl implements _PerAccountCollectionState {
- const _$PerAccountCollectionStateImpl(
- {required this.accountInfo,
- required this.avAccountRecordState,
- required this.accountInfoCubit,
- required this.accountRecordCubit,
- required this.contactInvitationListCubit,
- required this.contactListCubit,
- required this.waitingInvitationsBlocMapCubit,
- required this.activeChatCubit,
- required this.chatListCubit,
- required this.activeConversationsBlocMapCubit,
- required this.activeSingleContactChatBlocMapCubit});
-
- @override
- final AccountInfo accountInfo;
- @override
- final AsyncValue? avAccountRecordState;
- @override
- final AccountInfoCubit? accountInfoCubit;
- @override
- final AccountRecordCubit? accountRecordCubit;
- @override
- final ContactInvitationListCubit? contactInvitationListCubit;
- @override
- final ContactListCubit? contactListCubit;
- @override
- final WaitingInvitationsBlocMapCubit? waitingInvitationsBlocMapCubit;
- @override
- final ActiveChatCubit? activeChatCubit;
- @override
- final ChatListCubit? chatListCubit;
- @override
- final ActiveConversationsBlocMapCubit? activeConversationsBlocMapCubit;
- @override
- final ActiveSingleContactChatBlocMapCubit?
- activeSingleContactChatBlocMapCubit;
-
- @override
- String toString() {
- return 'PerAccountCollectionState(accountInfo: $accountInfo, avAccountRecordState: $avAccountRecordState, accountInfoCubit: $accountInfoCubit, accountRecordCubit: $accountRecordCubit, contactInvitationListCubit: $contactInvitationListCubit, contactListCubit: $contactListCubit, waitingInvitationsBlocMapCubit: $waitingInvitationsBlocMapCubit, activeChatCubit: $activeChatCubit, chatListCubit: $chatListCubit, activeConversationsBlocMapCubit: $activeConversationsBlocMapCubit, activeSingleContactChatBlocMapCubit: $activeSingleContactChatBlocMapCubit)';
- }
+ _$PerAccountCollectionStateCopyWithImpl(
+ this as PerAccountCollectionState, _$identity);
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
- other is _$PerAccountCollectionStateImpl &&
+ other is PerAccountCollectionState &&
(identical(other.accountInfo, accountInfo) ||
other.accountInfo == accountInfo) &&
(identical(other.avAccountRecordState, avAccountRecordState) ||
@@ -361,61 +87,350 @@ class _$PerAccountCollectionStateImpl implements _PerAccountCollectionState {
activeConversationsBlocMapCubit,
activeSingleContactChatBlocMapCubit);
+ @override
+ String toString() {
+ return 'PerAccountCollectionState(accountInfo: $accountInfo, avAccountRecordState: $avAccountRecordState, accountInfoCubit: $accountInfoCubit, accountRecordCubit: $accountRecordCubit, contactInvitationListCubit: $contactInvitationListCubit, contactListCubit: $contactListCubit, waitingInvitationsBlocMapCubit: $waitingInvitationsBlocMapCubit, activeChatCubit: $activeChatCubit, chatListCubit: $chatListCubit, activeConversationsBlocMapCubit: $activeConversationsBlocMapCubit, activeSingleContactChatBlocMapCubit: $activeSingleContactChatBlocMapCubit)';
+ }
+}
+
+/// @nodoc
+abstract mixin class $PerAccountCollectionStateCopyWith<$Res> {
+ factory $PerAccountCollectionStateCopyWith(PerAccountCollectionState value,
+ $Res Function(PerAccountCollectionState) _then) =
+ _$PerAccountCollectionStateCopyWithImpl;
+ @useResult
+ $Res call(
+ {AccountInfo accountInfo,
+ AsyncValue? avAccountRecordState,
+ AccountInfoCubit? accountInfoCubit,
+ AccountRecordCubit? accountRecordCubit,
+ ContactInvitationListCubit? contactInvitationListCubit,
+ ContactListCubit? contactListCubit,
+ WaitingInvitationsBlocMapCubit? waitingInvitationsBlocMapCubit,
+ ActiveChatCubit? activeChatCubit,
+ ChatListCubit? chatListCubit,
+ ActiveConversationsBlocMapCubit? activeConversationsBlocMapCubit,
+ ActiveSingleContactChatBlocMapCubit?
+ activeSingleContactChatBlocMapCubit});
+
+ $AsyncValueCopyWith? get avAccountRecordState;
+}
+
+/// @nodoc
+class _$PerAccountCollectionStateCopyWithImpl<$Res>
+ implements $PerAccountCollectionStateCopyWith<$Res> {
+ _$PerAccountCollectionStateCopyWithImpl(this._self, this._then);
+
+ final PerAccountCollectionState _self;
+ final $Res Function(PerAccountCollectionState) _then;
+
+ /// Create a copy of PerAccountCollectionState
+ /// with the given fields replaced by the non-null parameter values.
+ @pragma('vm:prefer-inline')
+ @override
+ $Res call({
+ Object? accountInfo = null,
+ Object? avAccountRecordState = freezed,
+ Object? accountInfoCubit = freezed,
+ Object? accountRecordCubit = freezed,
+ Object? contactInvitationListCubit = freezed,
+ Object? contactListCubit = freezed,
+ Object? waitingInvitationsBlocMapCubit = freezed,
+ Object? activeChatCubit = freezed,
+ Object? chatListCubit = freezed,
+ Object? activeConversationsBlocMapCubit = freezed,
+ Object? activeSingleContactChatBlocMapCubit = freezed,
+ }) {
+ return _then(_self.copyWith(
+ accountInfo: null == accountInfo
+ ? _self.accountInfo
+ : accountInfo // ignore: cast_nullable_to_non_nullable
+ as AccountInfo,
+ avAccountRecordState: freezed == avAccountRecordState
+ ? _self.avAccountRecordState!
+ : avAccountRecordState // ignore: cast_nullable_to_non_nullable
+ as AsyncValue?,
+ accountInfoCubit: freezed == accountInfoCubit
+ ? _self.accountInfoCubit
+ : accountInfoCubit // ignore: cast_nullable_to_non_nullable
+ as AccountInfoCubit?,
+ accountRecordCubit: freezed == accountRecordCubit
+ ? _self.accountRecordCubit
+ : accountRecordCubit // ignore: cast_nullable_to_non_nullable
+ as AccountRecordCubit?,
+ contactInvitationListCubit: freezed == contactInvitationListCubit
+ ? _self.contactInvitationListCubit
+ : contactInvitationListCubit // ignore: cast_nullable_to_non_nullable
+ as ContactInvitationListCubit?,
+ contactListCubit: freezed == contactListCubit
+ ? _self.contactListCubit
+ : contactListCubit // ignore: cast_nullable_to_non_nullable
+ as ContactListCubit?,
+ waitingInvitationsBlocMapCubit: freezed == waitingInvitationsBlocMapCubit
+ ? _self.waitingInvitationsBlocMapCubit
+ : waitingInvitationsBlocMapCubit // ignore: cast_nullable_to_non_nullable
+ as WaitingInvitationsBlocMapCubit?,
+ activeChatCubit: freezed == activeChatCubit
+ ? _self.activeChatCubit
+ : activeChatCubit // ignore: cast_nullable_to_non_nullable
+ as ActiveChatCubit?,
+ chatListCubit: freezed == chatListCubit
+ ? _self.chatListCubit
+ : chatListCubit // ignore: cast_nullable_to_non_nullable
+ as ChatListCubit?,
+ activeConversationsBlocMapCubit: freezed ==
+ activeConversationsBlocMapCubit
+ ? _self.activeConversationsBlocMapCubit
+ : activeConversationsBlocMapCubit // ignore: cast_nullable_to_non_nullable
+ as ActiveConversationsBlocMapCubit?,
+ activeSingleContactChatBlocMapCubit: freezed ==
+ activeSingleContactChatBlocMapCubit
+ ? _self.activeSingleContactChatBlocMapCubit
+ : activeSingleContactChatBlocMapCubit // ignore: cast_nullable_to_non_nullable
+ as ActiveSingleContactChatBlocMapCubit?,
+ ));
+ }
+
/// Create a copy of PerAccountCollectionState
/// with the given fields replaced by the non-null parameter values.
- @JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
- _$$PerAccountCollectionStateImplCopyWith<_$PerAccountCollectionStateImpl>
- get copyWith => __$$PerAccountCollectionStateImplCopyWithImpl<
- _$PerAccountCollectionStateImpl>(this, _$identity);
+ $AsyncValueCopyWith? get avAccountRecordState {
+ if (_self.avAccountRecordState == null) {
+ return null;
+ }
+
+ return $AsyncValueCopyWith(_self.avAccountRecordState!,
+ (value) {
+ return _then(_self.copyWith(avAccountRecordState: value));
+ });
+ }
}
-abstract class _PerAccountCollectionState implements PerAccountCollectionState {
- const factory _PerAccountCollectionState(
- {required final AccountInfo accountInfo,
- required final AsyncValue? avAccountRecordState,
- required final AccountInfoCubit? accountInfoCubit,
- required final AccountRecordCubit? accountRecordCubit,
- required final ContactInvitationListCubit? contactInvitationListCubit,
- required final ContactListCubit? contactListCubit,
- required final WaitingInvitationsBlocMapCubit?
- waitingInvitationsBlocMapCubit,
- required final ActiveChatCubit? activeChatCubit,
- required final ChatListCubit? chatListCubit,
- required final ActiveConversationsBlocMapCubit?
- activeConversationsBlocMapCubit,
- required final ActiveSingleContactChatBlocMapCubit?
- activeSingleContactChatBlocMapCubit}) =
- _$PerAccountCollectionStateImpl;
+/// @nodoc
+
+class _PerAccountCollectionState extends PerAccountCollectionState {
+ const _PerAccountCollectionState(
+ {required this.accountInfo,
+ required this.avAccountRecordState,
+ required this.accountInfoCubit,
+ required this.accountRecordCubit,
+ required this.contactInvitationListCubit,
+ required this.contactListCubit,
+ required this.waitingInvitationsBlocMapCubit,
+ required this.activeChatCubit,
+ required this.chatListCubit,
+ required this.activeConversationsBlocMapCubit,
+ required this.activeSingleContactChatBlocMapCubit})
+ : super._();
@override
- AccountInfo get accountInfo;
+ final AccountInfo accountInfo;
@override
- AsyncValue? get avAccountRecordState;
+ final AsyncValue? avAccountRecordState;
@override
- AccountInfoCubit? get accountInfoCubit;
+ final AccountInfoCubit? accountInfoCubit;
@override
- AccountRecordCubit? get accountRecordCubit;
+ final AccountRecordCubit? accountRecordCubit;
@override
- ContactInvitationListCubit? get contactInvitationListCubit;
+ final ContactInvitationListCubit? contactInvitationListCubit;
@override
- ContactListCubit? get contactListCubit;
+ final ContactListCubit? contactListCubit;
@override
- WaitingInvitationsBlocMapCubit? get waitingInvitationsBlocMapCubit;
+ final WaitingInvitationsBlocMapCubit? waitingInvitationsBlocMapCubit;
@override
- ActiveChatCubit? get activeChatCubit;
+ final ActiveChatCubit? activeChatCubit;
@override
- ChatListCubit? get chatListCubit;
+ final ChatListCubit? chatListCubit;
@override
- ActiveConversationsBlocMapCubit? get activeConversationsBlocMapCubit;
+ final ActiveConversationsBlocMapCubit? activeConversationsBlocMapCubit;
@override
- ActiveSingleContactChatBlocMapCubit? get activeSingleContactChatBlocMapCubit;
+ final ActiveSingleContactChatBlocMapCubit?
+ activeSingleContactChatBlocMapCubit;
/// Create a copy of PerAccountCollectionState
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
- _$$PerAccountCollectionStateImplCopyWith<_$PerAccountCollectionStateImpl>
- get copyWith => throw _privateConstructorUsedError;
+ @pragma('vm:prefer-inline')
+ _$PerAccountCollectionStateCopyWith<_PerAccountCollectionState>
+ get copyWith =>
+ __$PerAccountCollectionStateCopyWithImpl<_PerAccountCollectionState>(
+ this, _$identity);
+
+ @override
+ bool operator ==(Object other) {
+ return identical(this, other) ||
+ (other.runtimeType == runtimeType &&
+ other is _PerAccountCollectionState &&
+ (identical(other.accountInfo, accountInfo) ||
+ other.accountInfo == accountInfo) &&
+ (identical(other.avAccountRecordState, avAccountRecordState) ||
+ other.avAccountRecordState == avAccountRecordState) &&
+ (identical(other.accountInfoCubit, accountInfoCubit) ||
+ other.accountInfoCubit == accountInfoCubit) &&
+ (identical(other.accountRecordCubit, accountRecordCubit) ||
+ other.accountRecordCubit == accountRecordCubit) &&
+ (identical(other.contactInvitationListCubit,
+ contactInvitationListCubit) ||
+ other.contactInvitationListCubit ==
+ contactInvitationListCubit) &&
+ (identical(other.contactListCubit, contactListCubit) ||
+ other.contactListCubit == contactListCubit) &&
+ (identical(other.waitingInvitationsBlocMapCubit,
+ waitingInvitationsBlocMapCubit) ||
+ other.waitingInvitationsBlocMapCubit ==
+ waitingInvitationsBlocMapCubit) &&
+ (identical(other.activeChatCubit, activeChatCubit) ||
+ other.activeChatCubit == activeChatCubit) &&
+ (identical(other.chatListCubit, chatListCubit) ||
+ other.chatListCubit == chatListCubit) &&
+ (identical(other.activeConversationsBlocMapCubit,
+ activeConversationsBlocMapCubit) ||
+ other.activeConversationsBlocMapCubit ==
+ activeConversationsBlocMapCubit) &&
+ (identical(other.activeSingleContactChatBlocMapCubit,
+ activeSingleContactChatBlocMapCubit) ||
+ other.activeSingleContactChatBlocMapCubit ==
+ activeSingleContactChatBlocMapCubit));
+ }
+
+ @override
+ int get hashCode => Object.hash(
+ runtimeType,
+ accountInfo,
+ avAccountRecordState,
+ accountInfoCubit,
+ accountRecordCubit,
+ contactInvitationListCubit,
+ contactListCubit,
+ waitingInvitationsBlocMapCubit,
+ activeChatCubit,
+ chatListCubit,
+ activeConversationsBlocMapCubit,
+ activeSingleContactChatBlocMapCubit);
+
+ @override
+ String toString() {
+ return 'PerAccountCollectionState(accountInfo: $accountInfo, avAccountRecordState: $avAccountRecordState, accountInfoCubit: $accountInfoCubit, accountRecordCubit: $accountRecordCubit, contactInvitationListCubit: $contactInvitationListCubit, contactListCubit: $contactListCubit, waitingInvitationsBlocMapCubit: $waitingInvitationsBlocMapCubit, activeChatCubit: $activeChatCubit, chatListCubit: $chatListCubit, activeConversationsBlocMapCubit: $activeConversationsBlocMapCubit, activeSingleContactChatBlocMapCubit: $activeSingleContactChatBlocMapCubit)';
+ }
}
+
+/// @nodoc
+abstract mixin class _$PerAccountCollectionStateCopyWith<$Res>
+ implements $PerAccountCollectionStateCopyWith<$Res> {
+ factory _$PerAccountCollectionStateCopyWith(_PerAccountCollectionState value,
+ $Res Function(_PerAccountCollectionState) _then) =
+ __$PerAccountCollectionStateCopyWithImpl;
+ @override
+ @useResult
+ $Res call(
+ {AccountInfo accountInfo,
+ AsyncValue? avAccountRecordState,
+ AccountInfoCubit? accountInfoCubit,
+ AccountRecordCubit? accountRecordCubit,
+ ContactInvitationListCubit? contactInvitationListCubit,
+ ContactListCubit? contactListCubit,
+ WaitingInvitationsBlocMapCubit? waitingInvitationsBlocMapCubit,
+ ActiveChatCubit? activeChatCubit,
+ ChatListCubit? chatListCubit,
+ ActiveConversationsBlocMapCubit? activeConversationsBlocMapCubit,
+ ActiveSingleContactChatBlocMapCubit?
+ activeSingleContactChatBlocMapCubit});
+
+ @override
+ $AsyncValueCopyWith? get avAccountRecordState;
+}
+
+/// @nodoc
+class __$PerAccountCollectionStateCopyWithImpl<$Res>
+ implements _$PerAccountCollectionStateCopyWith<$Res> {
+ __$PerAccountCollectionStateCopyWithImpl(this._self, this._then);
+
+ final _PerAccountCollectionState _self;
+ final $Res Function(_PerAccountCollectionState) _then;
+
+ /// Create a copy of PerAccountCollectionState
+ /// with the given fields replaced by the non-null parameter values.
+ @override
+ @pragma('vm:prefer-inline')
+ $Res call({
+ Object? accountInfo = null,
+ Object? avAccountRecordState = freezed,
+ Object? accountInfoCubit = freezed,
+ Object? accountRecordCubit = freezed,
+ Object? contactInvitationListCubit = freezed,
+ Object? contactListCubit = freezed,
+ Object? waitingInvitationsBlocMapCubit = freezed,
+ Object? activeChatCubit = freezed,
+ Object? chatListCubit = freezed,
+ Object? activeConversationsBlocMapCubit = freezed,
+ Object? activeSingleContactChatBlocMapCubit = freezed,
+ }) {
+ return _then(_PerAccountCollectionState(
+ accountInfo: null == accountInfo
+ ? _self.accountInfo
+ : accountInfo // ignore: cast_nullable_to_non_nullable
+ as AccountInfo,
+ avAccountRecordState: freezed == avAccountRecordState
+ ? _self.avAccountRecordState
+ : avAccountRecordState // ignore: cast_nullable_to_non_nullable
+ as AsyncValue?,
+ accountInfoCubit: freezed == accountInfoCubit
+ ? _self.accountInfoCubit
+ : accountInfoCubit // ignore: cast_nullable_to_non_nullable
+ as AccountInfoCubit?,
+ accountRecordCubit: freezed == accountRecordCubit
+ ? _self.accountRecordCubit
+ : accountRecordCubit // ignore: cast_nullable_to_non_nullable
+ as AccountRecordCubit?,
+ contactInvitationListCubit: freezed == contactInvitationListCubit
+ ? _self.contactInvitationListCubit
+ : contactInvitationListCubit // ignore: cast_nullable_to_non_nullable
+ as ContactInvitationListCubit?,
+ contactListCubit: freezed == contactListCubit
+ ? _self.contactListCubit
+ : contactListCubit // ignore: cast_nullable_to_non_nullable
+ as ContactListCubit?,
+ waitingInvitationsBlocMapCubit: freezed == waitingInvitationsBlocMapCubit
+ ? _self.waitingInvitationsBlocMapCubit
+ : waitingInvitationsBlocMapCubit // ignore: cast_nullable_to_non_nullable
+ as WaitingInvitationsBlocMapCubit?,
+ activeChatCubit: freezed == activeChatCubit
+ ? _self.activeChatCubit
+ : activeChatCubit // ignore: cast_nullable_to_non_nullable
+ as ActiveChatCubit?,
+ chatListCubit: freezed == chatListCubit
+ ? _self.chatListCubit
+ : chatListCubit // ignore: cast_nullable_to_non_nullable
+ as ChatListCubit?,
+ activeConversationsBlocMapCubit: freezed ==
+ activeConversationsBlocMapCubit
+ ? _self.activeConversationsBlocMapCubit
+ : activeConversationsBlocMapCubit // ignore: cast_nullable_to_non_nullable
+ as ActiveConversationsBlocMapCubit?,
+ activeSingleContactChatBlocMapCubit: freezed ==
+ activeSingleContactChatBlocMapCubit
+ ? _self.activeSingleContactChatBlocMapCubit
+ : activeSingleContactChatBlocMapCubit // ignore: cast_nullable_to_non_nullable
+ as ActiveSingleContactChatBlocMapCubit?,
+ ));
+ }
+
+ /// Create a copy of PerAccountCollectionState
+ /// with the given fields replaced by the non-null parameter values.
+ @override
+ @pragma('vm:prefer-inline')
+ $AsyncValueCopyWith? get avAccountRecordState {
+ if (_self.avAccountRecordState == null) {
+ return null;
+ }
+
+ return $AsyncValueCopyWith(_self.avAccountRecordState!,
+ (value) {
+ return _then(_self.copyWith(avAccountRecordState: value));
+ });
+ }
+}
+
+// dart format on
diff --git a/lib/account_manager/models/user_login/user_login.dart b/lib/account_manager/models/user_login/user_login.dart
index 7c024cf..d43fdfd 100644
--- a/lib/account_manager/models/user_login/user_login.dart
+++ b/lib/account_manager/models/user_login/user_login.dart
@@ -9,7 +9,7 @@ part 'user_login.g.dart';
// User logins are stored in the user_logins tablestore table
// indexed by the accountSuperIdentityRecordKey
@freezed
-class UserLogin with _$UserLogin {
+sealed class UserLogin with _$UserLogin {
const factory UserLogin({
// SuperIdentity record key for the user
// used to index the local accounts table
diff --git a/lib/account_manager/models/user_login/user_login.freezed.dart b/lib/account_manager/models/user_login/user_login.freezed.dart
index 2804a77..b0c6070 100644
--- a/lib/account_manager/models/user_login/user_login.freezed.dart
+++ b/lib/account_manager/models/user_login/user_login.freezed.dart
@@ -1,3 +1,4 @@
+// dart format width=80
// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint
@@ -9,195 +10,36 @@ part of 'user_login.dart';
// FreezedGenerator
// **************************************************************************
+// dart format off
T _$identity(T value) => value;
-final _privateConstructorUsedError = UnsupportedError(
- 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
-
-UserLogin _$UserLoginFromJson(Map json) {
- return _UserLogin.fromJson(json);
-}
-
/// @nodoc
mixin _$UserLogin {
// SuperIdentity record key for the user
// used to index the local accounts table
- Typed get superIdentityRecordKey =>
- throw _privateConstructorUsedError; // The identity secret as unlocked from the local accounts table
- Typed get identitySecret =>
- throw _privateConstructorUsedError; // The account record key, owner key and secret pulled from the identity
- AccountRecordInfo get accountRecordInfo =>
- throw _privateConstructorUsedError; // The time this login was most recently used
- Timestamp get lastActive => throw _privateConstructorUsedError;
-
- /// Serializes this UserLogin to a JSON map.
- Map toJson() => throw _privateConstructorUsedError;
+ TypedKey
+ get superIdentityRecordKey; // The identity secret as unlocked from the local accounts table
+ TypedSecret
+ get identitySecret; // The account record key, owner key and secret pulled from the identity
+ AccountRecordInfo
+ get accountRecordInfo; // The time this login was most recently used
+ Timestamp get lastActive;
/// Create a copy of UserLogin
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
+ @pragma('vm:prefer-inline')
$UserLoginCopyWith get copyWith =>
- throw _privateConstructorUsedError;
-}
+ _$UserLoginCopyWithImpl(this as UserLogin, _$identity);
-/// @nodoc
-abstract class $UserLoginCopyWith<$Res> {
- factory $UserLoginCopyWith(UserLogin value, $Res Function(UserLogin) then) =
- _$UserLoginCopyWithImpl<$Res, UserLogin>;
- @useResult
- $Res call(
- {Typed superIdentityRecordKey,
- Typed identitySecret,
- AccountRecordInfo accountRecordInfo,
- Timestamp lastActive});
-
- $AccountRecordInfoCopyWith<$Res> get accountRecordInfo;
-}
-
-/// @nodoc
-class _$UserLoginCopyWithImpl<$Res, $Val extends UserLogin>
- implements $UserLoginCopyWith<$Res> {
- _$UserLoginCopyWithImpl(this._value, this._then);
-
- // ignore: unused_field
- final $Val _value;
- // ignore: unused_field
- final $Res Function($Val) _then;
-
- /// Create a copy of UserLogin
- /// with the given fields replaced by the non-null parameter values.
- @pragma('vm:prefer-inline')
- @override
- $Res call({
- Object? superIdentityRecordKey = null,
- Object? identitySecret = null,
- Object? accountRecordInfo = null,
- Object? lastActive = null,
- }) {
- return _then(_value.copyWith(
- superIdentityRecordKey: null == superIdentityRecordKey
- ? _value.superIdentityRecordKey
- : superIdentityRecordKey // ignore: cast_nullable_to_non_nullable
- as Typed,
- identitySecret: null == identitySecret
- ? _value.identitySecret
- : identitySecret // ignore: cast_nullable_to_non_nullable
- as Typed,
- accountRecordInfo: null == accountRecordInfo
- ? _value.accountRecordInfo
- : accountRecordInfo // ignore: cast_nullable_to_non_nullable
- as AccountRecordInfo,
- lastActive: null == lastActive
- ? _value.lastActive
- : lastActive // ignore: cast_nullable_to_non_nullable
- as Timestamp,
- ) as $Val);
- }
-
- /// Create a copy of UserLogin
- /// with the given fields replaced by the non-null parameter values.
- @override
- @pragma('vm:prefer-inline')
- $AccountRecordInfoCopyWith<$Res> get accountRecordInfo {
- return $AccountRecordInfoCopyWith<$Res>(_value.accountRecordInfo, (value) {
- return _then(_value.copyWith(accountRecordInfo: value) as $Val);
- });
- }
-}
-
-/// @nodoc
-abstract class _$$UserLoginImplCopyWith<$Res>
- implements $UserLoginCopyWith<$Res> {
- factory _$$UserLoginImplCopyWith(
- _$UserLoginImpl value, $Res Function(_$UserLoginImpl) then) =
- __$$UserLoginImplCopyWithImpl<$Res>;
- @override
- @useResult
- $Res call(
- {Typed superIdentityRecordKey,
- Typed identitySecret,
- AccountRecordInfo accountRecordInfo,
- Timestamp lastActive});
-
- @override
- $AccountRecordInfoCopyWith<$Res> get accountRecordInfo;
-}
-
-/// @nodoc
-class __$$UserLoginImplCopyWithImpl<$Res>
- extends _$UserLoginCopyWithImpl<$Res, _$UserLoginImpl>
- implements _$$UserLoginImplCopyWith<$Res> {
- __$$UserLoginImplCopyWithImpl(
- _$UserLoginImpl _value, $Res Function(_$UserLoginImpl) _then)
- : super(_value, _then);
-
- /// Create a copy of UserLogin
- /// with the given fields replaced by the non-null parameter values.
- @pragma('vm:prefer-inline')
- @override
- $Res call({
- Object? superIdentityRecordKey = null,
- Object? identitySecret = null,
- Object? accountRecordInfo = null,
- Object? lastActive = null,
- }) {
- return _then(_$UserLoginImpl(
- superIdentityRecordKey: null == superIdentityRecordKey
- ? _value.superIdentityRecordKey
- : superIdentityRecordKey // ignore: cast_nullable_to_non_nullable
- as Typed,
- identitySecret: null == identitySecret
- ? _value.identitySecret
- : identitySecret // ignore: cast_nullable_to_non_nullable
- as Typed,
- accountRecordInfo: null == accountRecordInfo
- ? _value.accountRecordInfo
- : accountRecordInfo // ignore: cast_nullable_to_non_nullable
- as AccountRecordInfo,
- lastActive: null == lastActive
- ? _value.lastActive
- : lastActive // ignore: cast_nullable_to_non_nullable
- as Timestamp,
- ));
- }
-}
-
-/// @nodoc
-@JsonSerializable()
-class _$UserLoginImpl implements _UserLogin {
- const _$UserLoginImpl(
- {required this.superIdentityRecordKey,
- required this.identitySecret,
- required this.accountRecordInfo,
- required this.lastActive});
-
- factory _$UserLoginImpl.fromJson(Map json) =>
- _$$UserLoginImplFromJson(json);
-
-// SuperIdentity record key for the user
-// used to index the local accounts table
- @override
- final Typed superIdentityRecordKey;
-// The identity secret as unlocked from the local accounts table
- @override
- final Typed identitySecret;
-// The account record key, owner key and secret pulled from the identity
- @override
- final AccountRecordInfo accountRecordInfo;
-// The time this login was most recently used
- @override
- final Timestamp lastActive;
-
- @override
- String toString() {
- return 'UserLogin(superIdentityRecordKey: $superIdentityRecordKey, identitySecret: $identitySecret, accountRecordInfo: $accountRecordInfo, lastActive: $lastActive)';
- }
+ /// Serializes this UserLogin to a JSON map.
+ Map toJson();
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
- other is _$UserLoginImpl &&
+ other is UserLogin &&
(identical(other.superIdentityRecordKey, superIdentityRecordKey) ||
other.superIdentityRecordKey == superIdentityRecordKey) &&
(identical(other.identitySecret, identitySecret) ||
@@ -213,50 +55,204 @@ class _$UserLoginImpl implements _UserLogin {
int get hashCode => Object.hash(runtimeType, superIdentityRecordKey,
identitySecret, accountRecordInfo, lastActive);
- /// Create a copy of UserLogin
- /// with the given fields replaced by the non-null parameter values.
- @JsonKey(includeFromJson: false, includeToJson: false)
@override
- @pragma('vm:prefer-inline')
- _$$UserLoginImplCopyWith<_$UserLoginImpl> get copyWith =>
- __$$UserLoginImplCopyWithImpl<_$UserLoginImpl>(this, _$identity);
-
- @override
- Map toJson() {
- return _$$UserLoginImplToJson(
- this,
- );
+ String toString() {
+ return 'UserLogin(superIdentityRecordKey: $superIdentityRecordKey, identitySecret: $identitySecret, accountRecordInfo: $accountRecordInfo, lastActive: $lastActive)';
}
}
-abstract class _UserLogin implements UserLogin {
- const factory _UserLogin(
- {required final Typed superIdentityRecordKey,
- required final Typed identitySecret,
- required final AccountRecordInfo accountRecordInfo,
- required final Timestamp lastActive}) = _$UserLoginImpl;
+/// @nodoc
+abstract mixin class $UserLoginCopyWith<$Res> {
+ factory $UserLoginCopyWith(UserLogin value, $Res Function(UserLogin) _then) =
+ _$UserLoginCopyWithImpl;
+ @useResult
+ $Res call(
+ {Typed superIdentityRecordKey,
+ Typed identitySecret,
+ AccountRecordInfo accountRecordInfo,
+ Timestamp lastActive});
- factory _UserLogin.fromJson(Map json) =
- _$UserLoginImpl.fromJson;
+ $AccountRecordInfoCopyWith<$Res> get accountRecordInfo;
+}
+
+/// @nodoc
+class _$UserLoginCopyWithImpl<$Res> implements $UserLoginCopyWith<$Res> {
+ _$UserLoginCopyWithImpl(this._self, this._then);
+
+ final UserLogin _self;
+ final $Res Function(UserLogin) _then;
+
+ /// Create a copy of UserLogin
+ /// with the given fields replaced by the non-null parameter values.
+ @pragma('vm:prefer-inline')
+ @override
+ $Res call({
+ Object? superIdentityRecordKey = null,
+ Object? identitySecret = null,
+ Object? accountRecordInfo = null,
+ Object? lastActive = null,
+ }) {
+ return _then(_self.copyWith(
+ superIdentityRecordKey: null == superIdentityRecordKey
+ ? _self.superIdentityRecordKey!
+ : superIdentityRecordKey // ignore: cast_nullable_to_non_nullable
+ as Typed,
+ identitySecret: null == identitySecret
+ ? _self.identitySecret!
+ : identitySecret // ignore: cast_nullable_to_non_nullable
+ as Typed,
+ accountRecordInfo: null == accountRecordInfo
+ ? _self.accountRecordInfo
+ : accountRecordInfo // ignore: cast_nullable_to_non_nullable
+ as AccountRecordInfo,
+ lastActive: null == lastActive
+ ? _self.lastActive
+ : lastActive // ignore: cast_nullable_to_non_nullable
+ as Timestamp,
+ ));
+ }
+
+ /// Create a copy of UserLogin
+ /// with the given fields replaced by the non-null parameter values.
+ @override
+ @pragma('vm:prefer-inline')
+ $AccountRecordInfoCopyWith<$Res> get accountRecordInfo {
+ return $AccountRecordInfoCopyWith<$Res>(_self.accountRecordInfo, (value) {
+ return _then(_self.copyWith(accountRecordInfo: value));
+ });
+ }
+}
+
+/// @nodoc
+@JsonSerializable()
+class _UserLogin implements UserLogin {
+ const _UserLogin(
+ {required this.superIdentityRecordKey,
+ required this.identitySecret,
+ required this.accountRecordInfo,
+ required this.lastActive});
+ factory _UserLogin.fromJson(Map json) =>
+ _$UserLoginFromJson(json);
// SuperIdentity record key for the user
// used to index the local accounts table
@override
- Typed
- get superIdentityRecordKey; // The identity secret as unlocked from the local accounts table
+ final Typed superIdentityRecordKey;
+// The identity secret as unlocked from the local accounts table
@override
- Typed
- get identitySecret; // The account record key, owner key and secret pulled from the identity
+ final Typed identitySecret;
+// The account record key, owner key and secret pulled from the identity
@override
- AccountRecordInfo
- get accountRecordInfo; // The time this login was most recently used
+ final AccountRecordInfo accountRecordInfo;
+// The time this login was most recently used
@override
- Timestamp get lastActive;
+ final Timestamp lastActive;
/// Create a copy of UserLogin
/// with the given fields replaced by the non-null parameter values.
@override
@JsonKey(includeFromJson: false, includeToJson: false)
- _$$UserLoginImplCopyWith<_$UserLoginImpl> get copyWith =>
- throw _privateConstructorUsedError;
+ @pragma('vm:prefer-inline')
+ _$UserLoginCopyWith<_UserLogin> get copyWith =>
+ __$UserLoginCopyWithImpl<_UserLogin>(this, _$identity);
+
+ @override
+ Map toJson() {
+ return _$UserLoginToJson(
+ this,
+ );
+ }
+
+ @override
+ bool operator ==(Object other) {
+ return identical(this, other) ||
+ (other.runtimeType == runtimeType &&
+ other is _UserLogin &&
+ (identical(other.superIdentityRecordKey, superIdentityRecordKey) ||
+ other.superIdentityRecordKey == superIdentityRecordKey) &&
+ (identical(other.identitySecret, identitySecret) ||
+ other.identitySecret == identitySecret) &&
+ (identical(other.accountRecordInfo, accountRecordInfo) ||
+ other.accountRecordInfo == accountRecordInfo) &&
+ (identical(other.lastActive, lastActive) ||
+ other.lastActive == lastActive));
+ }
+
+ @JsonKey(includeFromJson: false, includeToJson: false)
+ @override
+ int get hashCode => Object.hash(runtimeType, superIdentityRecordKey,
+ identitySecret, accountRecordInfo, lastActive);
+
+ @override
+ String toString() {
+ return 'UserLogin(superIdentityRecordKey: $superIdentityRecordKey, identitySecret: $identitySecret, accountRecordInfo: $accountRecordInfo, lastActive: $lastActive)';
+ }
}
+
+/// @nodoc
+abstract mixin class _$UserLoginCopyWith<$Res>
+ implements $UserLoginCopyWith<$Res> {
+ factory _$UserLoginCopyWith(
+ _UserLogin value, $Res Function(_UserLogin) _then) =
+ __$UserLoginCopyWithImpl;
+ @override
+ @useResult
+ $Res call(
+ {Typed superIdentityRecordKey,
+ Typed identitySecret,
+ AccountRecordInfo accountRecordInfo,
+ Timestamp lastActive});
+
+ @override
+ $AccountRecordInfoCopyWith<$Res> get accountRecordInfo;
+}
+
+/// @nodoc
+class __$UserLoginCopyWithImpl<$Res> implements _$UserLoginCopyWith<$Res> {
+ __$UserLoginCopyWithImpl(this._self, this._then);
+
+ final _UserLogin _self;
+ final $Res Function(_UserLogin) _then;
+
+ /// Create a copy of UserLogin
+ /// with the given fields replaced by the non-null parameter values.
+ @override
+ @pragma('vm:prefer-inline')
+ $Res call({
+ Object? superIdentityRecordKey = null,
+ Object? identitySecret = null,
+ Object? accountRecordInfo = null,
+ Object? lastActive = null,
+ }) {
+ return _then(_UserLogin(
+ superIdentityRecordKey: null == superIdentityRecordKey
+ ? _self.superIdentityRecordKey
+ : superIdentityRecordKey // ignore: cast_nullable_to_non_nullable
+ as Typed,
+ identitySecret: null == identitySecret
+ ? _self.identitySecret
+ : identitySecret // ignore: cast_nullable_to_non_nullable
+ as Typed,
+ accountRecordInfo: null == accountRecordInfo
+ ? _self.accountRecordInfo
+ : accountRecordInfo // ignore: cast_nullable_to_non_nullable
+ as AccountRecordInfo,
+ lastActive: null == lastActive
+ ? _self.lastActive
+ : lastActive // ignore: cast_nullable_to_non_nullable
+ as Timestamp,
+ ));
+ }
+
+ /// Create a copy of UserLogin
+ /// with the given fields replaced by the non-null parameter values.
+ @override
+ @pragma('vm:prefer-inline')
+ $AccountRecordInfoCopyWith<$Res> get accountRecordInfo {
+ return $AccountRecordInfoCopyWith<$Res>(_self.accountRecordInfo, (value) {
+ return _then(_self.copyWith(accountRecordInfo: value));
+ });
+ }
+}
+
+// dart format on
diff --git a/lib/account_manager/models/user_login/user_login.g.dart b/lib/account_manager/models/user_login/user_login.g.dart
index 173d853..fa5314b 100644
--- a/lib/account_manager/models/user_login/user_login.g.dart
+++ b/lib/account_manager/models/user_login/user_login.g.dart
@@ -6,8 +6,7 @@ part of 'user_login.dart';
// JsonSerializableGenerator
// **************************************************************************
-_$UserLoginImpl _$$UserLoginImplFromJson(Map json) =>
- _$UserLoginImpl(
+_UserLogin _$UserLoginFromJson(Map json) => _UserLogin(
superIdentityRecordKey: Typed.fromJson(
json['super_identity_record_key']),
identitySecret:
@@ -17,7 +16,7 @@ _$UserLoginImpl _$$UserLoginImplFromJson(Map json) =>
lastActive: Timestamp.fromJson(json['last_active']),
);
-Map _$$UserLoginImplToJson(_$UserLoginImpl instance) =>
+Map _$UserLoginToJson(_UserLogin instance) =>
{
'super_identity_record_key': instance.superIdentityRecordKey.toJson(),
'identity_secret': instance.identitySecret.toJson(),
diff --git a/lib/account_manager/views/edit_account_page.dart b/lib/account_manager/views/edit_account_page.dart
index 81b67eb..bd18967 100644
--- a/lib/account_manager/views/edit_account_page.dart
+++ b/lib/account_manager/views/edit_account_page.dart
@@ -61,6 +61,13 @@ class _EditAccountPageState extends WindowSetupState {
);
Future _onRemoveAccount() async {
+ // dismiss the keyboard by unfocusing the textfield
+ FocusScope.of(context).unfocus();
+ await asyncSleep(const Duration(milliseconds: 250));
+ if (!mounted) {
+ return;
+ }
+
final confirmed = await StyledDialog.show(
context: context,
title: translate('edit_account_page.remove_account_confirm'),
@@ -87,10 +94,7 @@ class _EditAccountPageState extends WindowSetupState {
]))
]).paddingAll(24)
]));
- if (confirmed != null && confirmed && mounted) {
- // dismiss the keyboard by unfocusing the textfield
- FocusScope.of(context).unfocus();
-
+ if (confirmed != null && confirmed) {
try {
setState(() {
_isInAsyncCall = true;
@@ -125,6 +129,13 @@ class _EditAccountPageState extends WindowSetupState {
}
Future _onDestroyAccount() async {
+ // dismiss the keyboard by unfocusing the textfield
+ FocusScope.of(context).unfocus();
+ await asyncSleep(const Duration(milliseconds: 250));
+ if (!mounted) {
+ return;
+ }
+
final confirmed = await StyledDialog.show(
context: context,
title: translate('edit_account_page.destroy_account_confirm'),
@@ -154,10 +165,7 @@ class _EditAccountPageState extends WindowSetupState {
]))
]).paddingAll(24)
]));
- if (confirmed != null && confirmed && mounted) {
- // dismiss the keyboard by unfocusing the textfield
- FocusScope.of(context).unfocus();
-
+ if (confirmed != null && confirmed) {
try {
setState(() {
_isInAsyncCall = true;
diff --git a/lib/account_manager/views/edit_profile_form.dart b/lib/account_manager/views/edit_profile_form.dart
index d6bb504..80bd2b3 100644
--- a/lib/account_manager/views/edit_profile_form.dart
+++ b/lib/account_manager/views/edit_profile_form.dart
@@ -282,9 +282,6 @@ class _EditProfileFormState extends State {
FormBuilderCheckbox(
name: EditProfileForm.formFieldAutoAway,
initialValue: _savedValue.autoAway,
- side: BorderSide(color: scale.primaryScale.border, width: 2),
- checkColor: scale.primaryScale.borderText,
- activeColor: scale.primaryScale.border,
title: Text(translate('account.form_auto_away'),
style: textTheme.labelMedium),
onChanged: (v) {
diff --git a/lib/account_manager/views/profile_widget.dart b/lib/account_manager/views/profile_widget.dart
index 672b13a..c026856 100644
--- a/lib/account_manager/views/profile_widget.dart
+++ b/lib/account_manager/views/profile_widget.dart
@@ -43,7 +43,7 @@ class ProfileWidget extends StatelessWidget {
: scale.primaryScale.borderText,
width: 2),
borderRadius: BorderRadius.all(
- Radius.circular(12 * scaleConfig.borderRadiusScale))),
+ Radius.circular(8 * scaleConfig.borderRadiusScale))),
),
child: Row(children: [
const Spacer(),
@@ -54,7 +54,7 @@ class ProfileWidget extends StatelessWidget {
? scale.primaryScale.border
: scale.primaryScale.borderText),
textAlign: TextAlign.left,
- ).paddingAll(12),
+ ).paddingAll(8),
if (_profile.pronouns.isNotEmpty && _showPronouns)
Text('(${_profile.pronouns})',
textAlign: TextAlign.right,
@@ -62,7 +62,7 @@ class ProfileWidget extends StatelessWidget {
color: scaleConfig.preferBorders
? scale.primaryScale.border
: scale.primaryScale.primary))
- .paddingAll(12),
+ .paddingAll(8),
const Spacer()
]),
);
diff --git a/lib/app.dart b/lib/app.dart
index 519f2bb..802b0d7 100644
--- a/lib/app.dart
+++ b/lib/app.dart
@@ -1,15 +1,12 @@
import 'package:animated_theme_switcher/animated_theme_switcher.dart';
-import 'package:async_tools/async_tools.dart';
import 'package:fast_immutable_collections/fast_immutable_collections.dart';
import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
-import 'package:flutter/services.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:flutter_translate/flutter_translate.dart';
import 'package:form_builder_validators/form_builder_validators.dart';
import 'package:provider/provider.dart';
-import 'package:veilid_support/veilid_support.dart';
import 'account_manager/account_manager.dart';
import 'init.dart';
@@ -19,17 +16,8 @@ import 'router/router.dart';
import 'settings/settings.dart';
import 'theme/theme.dart';
import 'tick.dart';
-import 'tools/loggy.dart';
import 'veilid_processor/veilid_processor.dart';
-class ReloadThemeIntent extends Intent {
- const ReloadThemeIntent();
-}
-
-class AttachDetachIntent extends Intent {
- const AttachDetachIntent();
-}
-
class ScrollBehaviorModified extends ScrollBehavior {
const ScrollBehaviorModified();
@override
@@ -47,59 +35,6 @@ class VeilidChatApp extends StatelessWidget {
final ThemeData initialThemeData;
- void _reloadTheme(BuildContext context) {
- singleFuture(this, () async {
- log.info('Reloading theme');
-
- await VeilidChatGlobalInit.loadAssetManifest();
-
- final theme =
- PreferencesRepository.instance.value.themePreference.themeData();
- if (context.mounted) {
- ThemeSwitcher.of(context).changeTheme(theme: theme);
-
- // Hack to reload translations
- final localizationDelegate = LocalizedApp.of(context).delegate;
- await LocalizationDelegate.create(
- fallbackLocale: localizationDelegate.fallbackLocale.toString(),
- supportedLocales: localizationDelegate.supportedLocales
- .map((x) => x.toString())
- .toList());
- }
- });
- }
-
- void _attachDetach(BuildContext context) {
- singleFuture(this, () async {
- if (ProcessorRepository.instance.processorConnectionState.isAttached) {
- log.info('Detaching');
- await Veilid.instance.detach();
- } else if (ProcessorRepository
- .instance.processorConnectionState.isDetached) {
- log.info('Attaching');
- await Veilid.instance.attach();
- }
- });
- }
-
- Widget _buildShortcuts({required Widget Function(BuildContext) builder}) =>
- ThemeSwitcher(
- builder: (context) => Shortcuts(
- shortcuts: {
- LogicalKeySet(
- LogicalKeyboardKey.alt, LogicalKeyboardKey.keyR):
- const ReloadThemeIntent(),
- LogicalKeySet(
- LogicalKeyboardKey.alt, LogicalKeyboardKey.keyD):
- const AttachDetachIntent(),
- },
- child: Actions(actions: >{
- ReloadThemeIntent: CallbackAction(
- onInvoke: (intent) => _reloadTheme(context)),
- AttachDetachIntent: CallbackAction(
- onInvoke: (intent) => _attachDetach(context)),
- }, child: Focus(autofocus: true, child: builder(context)))));
-
Widget appBuilder(
BuildContext context, LocalizationDelegate localizationDelegate) =>
ThemeProvider(
@@ -138,8 +73,7 @@ class VeilidChatApp extends StatelessWidget {
accountRepository: AccountRepository.instance,
locator: context.read)),
],
- child:
- BackgroundTicker(child: _buildShortcuts(builder: (context) {
+ child: BackgroundTicker(child: Builder(builder: (context) {
final scale = theme.extension()!;
final scaleConfig = theme.extension()!;
diff --git a/lib/chat/cubits/chat_component_cubit.dart b/lib/chat/cubits/chat_component_cubit.dart
index 9e50e02..7ea9e95 100644
--- a/lib/chat/cubits/chat_component_cubit.dart
+++ b/lib/chat/cubits/chat_component_cubit.dart
@@ -2,7 +2,6 @@ import 'dart:async';
import 'dart:typed_data';
import 'package:async_tools/async_tools.dart';
-import 'package:bloc_advanced_tools/bloc_advanced_tools.dart';
import 'package:fast_immutable_collections/fast_immutable_collections.dart';
import 'package:fixnum/fixnum.dart';
import 'package:flutter/widgets.dart';
@@ -184,9 +183,7 @@ class ChatComponentCubit extends Cubit {
emit(_convertMessages(state, avMessagesState));
}
- void _onChangedContacts(
- BlocBusyState>>>
- bavContacts) {
+ void _onChangedContacts(DHTShortArrayCubitState bavContacts) {
// Rewrite users when contacts change
singleFuture((this, _sfChangedContacts), _updateConversationSubscriptions);
}
@@ -353,6 +350,7 @@ class ChatComponentCubit extends Cubit {
case proto.Message_Kind.membership:
case proto.Message_Kind.moderation:
case proto.Message_Kind.notSet:
+ case proto.Message_Kind.readReceipt:
return (currentState, null);
}
}
@@ -440,9 +438,7 @@ class ChatComponentCubit extends Cubit {
final Map>>
_conversationSubscriptions = {};
late StreamSubscription _messagesSubscription;
- late StreamSubscription<
- BlocBusyState<
- AsyncValue>>>>
+ late StreamSubscription>
_contactListSubscription;
double scrollOffset = 0;
}
diff --git a/lib/chat/models/chat_component_state.dart b/lib/chat/models/chat_component_state.dart
index b06b413..82e492d 100644
--- a/lib/chat/models/chat_component_state.dart
+++ b/lib/chat/models/chat_component_state.dart
@@ -13,7 +13,7 @@ import 'window_state.dart';
part 'chat_component_state.freezed.dart';
@freezed
-class ChatComponentState with _$ChatComponentState {
+sealed class ChatComponentState with _$ChatComponentState {
const factory ChatComponentState(
{
// GlobalKey for the chat
diff --git a/lib/chat/models/chat_component_state.freezed.dart b/lib/chat/models/chat_component_state.freezed.dart
index f967997..ae3acee 100644
--- a/lib/chat/models/chat_component_state.freezed.dart
+++ b/lib/chat/models/chat_component_state.freezed.dart
@@ -1,3 +1,4 @@
+// dart format width=80
// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint
@@ -9,44 +10,78 @@ part of 'chat_component_state.dart';
// FreezedGenerator
// **************************************************************************
+// dart format off
T _$identity(T value) => value;
-final _privateConstructorUsedError = UnsupportedError(
- 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
-
/// @nodoc
mixin _$ChatComponentState {
// GlobalKey for the chat
- GlobalKey get chatKey =>
- throw _privateConstructorUsedError; // ScrollController for the chat
- AutoScrollController get scrollController =>
- throw _privateConstructorUsedError; // TextEditingController for the chat
- InputTextFieldController get textEditingController =>
- throw _privateConstructorUsedError; // Local user
- User? get localUser =>
- throw _privateConstructorUsedError; // Active remote users
- IMap, User> get remoteUsers =>
- throw _privateConstructorUsedError; // Historical remote users
- IMap, User> get historicalRemoteUsers =>
- throw _privateConstructorUsedError; // Unknown users
- IMap, User> get unknownUsers =>
- throw _privateConstructorUsedError; // Messages state
- AsyncValue> get messageWindow =>
- throw _privateConstructorUsedError; // Title of the chat
- String get title => throw _privateConstructorUsedError;
+ GlobalKey get chatKey; // ScrollController for the chat
+ AutoScrollController
+ get scrollController; // TextEditingController for the chat
+ InputTextFieldController get textEditingController; // Local user
+ User? get localUser; // Active remote users
+ IMap get remoteUsers; // Historical remote users
+ IMap get historicalRemoteUsers; // Unknown users
+ IMap get unknownUsers; // Messages state
+ AsyncValue> get messageWindow; // Title of the chat
+ String get title;
/// Create a copy of ChatComponentState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
+ @pragma('vm:prefer-inline')
$ChatComponentStateCopyWith get copyWith =>
- throw _privateConstructorUsedError;
+ _$ChatComponentStateCopyWithImpl(
+ this as ChatComponentState, _$identity);
+
+ @override
+ bool operator ==(Object other) {
+ 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) ||
+ other.remoteUsers == remoteUsers) &&
+ (identical(other.historicalRemoteUsers, historicalRemoteUsers) ||
+ other.historicalRemoteUsers == historicalRemoteUsers) &&
+ (identical(other.unknownUsers, unknownUsers) ||
+ other.unknownUsers == unknownUsers) &&
+ (identical(other.messageWindow, messageWindow) ||
+ other.messageWindow == messageWindow) &&
+ (identical(other.title, title) || other.title == title));
+ }
+
+ @override
+ int get hashCode => Object.hash(
+ runtimeType,
+ chatKey,
+ scrollController,
+ textEditingController,
+ 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)';
+ }
}
/// @nodoc
-abstract class $ChatComponentStateCopyWith<$Res> {
+abstract mixin class $ChatComponentStateCopyWith<$Res> {
factory $ChatComponentStateCopyWith(
- ChatComponentState value, $Res Function(ChatComponentState) then) =
- _$ChatComponentStateCopyWithImpl<$Res, ChatComponentState>;
+ ChatComponentState value, $Res Function(ChatComponentState) _then) =
+ _$ChatComponentStateCopyWithImpl;
@useResult
$Res call(
{GlobalKey chatKey,
@@ -63,14 +98,12 @@ abstract class $ChatComponentStateCopyWith<$Res> {
}
/// @nodoc
-class _$ChatComponentStateCopyWithImpl<$Res, $Val extends ChatComponentState>
+class _$ChatComponentStateCopyWithImpl<$Res>
implements $ChatComponentStateCopyWith<$Res> {
- _$ChatComponentStateCopyWithImpl(this._value, this._then);
+ _$ChatComponentStateCopyWithImpl(this._self, this._then);
- // ignore: unused_field
- final $Val _value;
- // ignore: unused_field
- final $Res Function($Val) _then;
+ final ChatComponentState _self;
+ final $Res Function(ChatComponentState) _then;
/// Create a copy of ChatComponentState
/// with the given fields replaced by the non-null parameter values.
@@ -87,44 +120,44 @@ class _$ChatComponentStateCopyWithImpl<$Res, $Val extends ChatComponentState>
Object? messageWindow = null,
Object? title = null,
}) {
- return _then(_value.copyWith(
+ return _then(_self.copyWith(
chatKey: null == chatKey
- ? _value.chatKey
+ ? _self.chatKey
: chatKey // ignore: cast_nullable_to_non_nullable
as GlobalKey,
scrollController: null == scrollController
- ? _value.scrollController
+ ? _self.scrollController
: scrollController // ignore: cast_nullable_to_non_nullable
as AutoScrollController,
textEditingController: null == textEditingController
- ? _value.textEditingController
+ ? _self.textEditingController
: textEditingController // ignore: cast_nullable_to_non_nullable
as InputTextFieldController,
localUser: freezed == localUser
- ? _value.localUser
+ ? _self.localUser
: localUser // ignore: cast_nullable_to_non_nullable
as User?,
remoteUsers: null == remoteUsers
- ? _value.remoteUsers
+ ? _self.remoteUsers!
: remoteUsers // ignore: cast_nullable_to_non_nullable
as IMap, User>,
historicalRemoteUsers: null == historicalRemoteUsers
- ? _value.historicalRemoteUsers
+ ? _self.historicalRemoteUsers!
: historicalRemoteUsers // ignore: cast_nullable_to_non_nullable
as IMap, User>,
unknownUsers: null == unknownUsers
- ? _value.unknownUsers
+ ? _self.unknownUsers!
: unknownUsers // ignore: cast_nullable_to_non_nullable
as IMap, User>,
messageWindow: null == messageWindow
- ? _value.messageWindow
+ ? _self.messageWindow
: messageWindow // ignore: cast_nullable_to_non_nullable
as AsyncValue>,
title: null == title
- ? _value.title
+ ? _self.title
: title // ignore: cast_nullable_to_non_nullable
as String,
- ) as $Val);
+ ));
}
/// Create a copy of ChatComponentState
@@ -132,104 +165,17 @@ class _$ChatComponentStateCopyWithImpl<$Res, $Val extends ChatComponentState>
@override
@pragma('vm:prefer-inline')
$AsyncValueCopyWith, $Res> get messageWindow {
- return $AsyncValueCopyWith, $Res>(_value.messageWindow,
+ return $AsyncValueCopyWith, $Res>(_self.messageWindow,
(value) {
- return _then(_value.copyWith(messageWindow: value) as $Val);
+ return _then(_self.copyWith(messageWindow: value));
});
}
}
/// @nodoc
-abstract class _$$ChatComponentStateImplCopyWith<$Res>
- implements $ChatComponentStateCopyWith<$Res> {
- factory _$$ChatComponentStateImplCopyWith(_$ChatComponentStateImpl value,
- $Res Function(_$ChatComponentStateImpl) then) =
- __$$ChatComponentStateImplCopyWithImpl<$Res>;
- @override
- @useResult
- $Res call(
- {GlobalKey chatKey,
- AutoScrollController scrollController,
- InputTextFieldController textEditingController,
- User? localUser,
- IMap, User> remoteUsers,
- IMap, User> historicalRemoteUsers,
- IMap, User> unknownUsers,
- AsyncValue> messageWindow,
- String title});
- @override
- $AsyncValueCopyWith, $Res> get messageWindow;
-}
-
-/// @nodoc
-class __$$ChatComponentStateImplCopyWithImpl<$Res>
- extends _$ChatComponentStateCopyWithImpl<$Res, _$ChatComponentStateImpl>
- implements _$$ChatComponentStateImplCopyWith<$Res> {
- __$$ChatComponentStateImplCopyWithImpl(_$ChatComponentStateImpl _value,
- $Res Function(_$ChatComponentStateImpl) _then)
- : super(_value, _then);
-
- /// Create a copy of ChatComponentState
- /// with the given fields replaced by the non-null parameter values.
- @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,
- Object? unknownUsers = null,
- Object? messageWindow = null,
- Object? title = null,
- }) {
- return _then(_$ChatComponentStateImpl(
- chatKey: null == chatKey
- ? _value.chatKey
- : chatKey // ignore: cast_nullable_to_non_nullable
- as GlobalKey,
- scrollController: null == scrollController
- ? _value.scrollController
- : scrollController // ignore: cast_nullable_to_non_nullable
- as AutoScrollController,
- textEditingController: null == textEditingController
- ? _value.textEditingController
- : textEditingController // ignore: cast_nullable_to_non_nullable
- as InputTextFieldController,
- localUser: freezed == localUser
- ? _value.localUser
- : localUser // ignore: cast_nullable_to_non_nullable
- as User?,
- remoteUsers: null == remoteUsers
- ? _value.remoteUsers
- : remoteUsers // ignore: cast_nullable_to_non_nullable
- as IMap, User>,
- historicalRemoteUsers: null == historicalRemoteUsers
- ? _value.historicalRemoteUsers
- : historicalRemoteUsers // ignore: cast_nullable_to_non_nullable
- as IMap, User>,
- unknownUsers: null == unknownUsers
- ? _value.unknownUsers
- : unknownUsers // ignore: cast_nullable_to_non_nullable
- as IMap, User>,
- messageWindow: null == messageWindow
- ? _value.messageWindow
- : messageWindow // ignore: cast_nullable_to_non_nullable
- as AsyncValue>,
- title: null == title
- ? _value.title
- : title // ignore: cast_nullable_to_non_nullable
- as String,
- ));
- }
-}
-
-/// @nodoc
-
-class _$ChatComponentStateImpl implements _ChatComponentState {
- const _$ChatComponentStateImpl(
+class _ChatComponentState implements ChatComponentState {
+ const _ChatComponentState(
{required this.chatKey,
required this.scrollController,
required this.textEditingController,
@@ -268,16 +214,19 @@ class _$ChatComponentStateImpl implements _ChatComponentState {
@override
final String title;
+ /// Create a copy of ChatComponentState
+ /// with the given fields replaced by the non-null parameter values.
@override
- String toString() {
- return 'ChatComponentState(chatKey: $chatKey, scrollController: $scrollController, textEditingController: $textEditingController, localUser: $localUser, remoteUsers: $remoteUsers, historicalRemoteUsers: $historicalRemoteUsers, unknownUsers: $unknownUsers, messageWindow: $messageWindow, title: $title)';
- }
+ @JsonKey(includeFromJson: false, includeToJson: false)
+ @pragma('vm:prefer-inline')
+ _$ChatComponentStateCopyWith<_ChatComponentState> get copyWith =>
+ __$ChatComponentStateCopyWithImpl<_ChatComponentState>(this, _$identity);
@override
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
- other is _$ChatComponentStateImpl &&
+ other is _ChatComponentState &&
(identical(other.chatKey, chatKey) || other.chatKey == chatKey) &&
(identical(other.scrollController, scrollController) ||
other.scrollController == scrollController) &&
@@ -309,56 +258,108 @@ class _$ChatComponentStateImpl implements _ChatComponentState {
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)';
+ }
+}
+
+/// @nodoc
+abstract mixin class _$ChatComponentStateCopyWith<$Res>
+ implements $ChatComponentStateCopyWith<$Res> {
+ factory _$ChatComponentStateCopyWith(
+ _ChatComponentState value, $Res Function(_ChatComponentState) _then) =
+ __$ChatComponentStateCopyWithImpl;
+ @override
+ @useResult
+ $Res call(
+ {GlobalKey chatKey,
+ AutoScrollController scrollController,
+ InputTextFieldController textEditingController,
+ User? localUser,
+ IMap, User> remoteUsers,
+ IMap, User> historicalRemoteUsers,
+ IMap, User> unknownUsers,
+ AsyncValue> messageWindow,
+ String title});
+
+ @override
+ $AsyncValueCopyWith, $Res> get messageWindow;
+}
+
+/// @nodoc
+class __$ChatComponentStateCopyWithImpl<$Res>
+ implements _$ChatComponentStateCopyWith<$Res> {
+ __$ChatComponentStateCopyWithImpl(this._self, this._then);
+
+ final _ChatComponentState _self;
+ final $Res Function(_ChatComponentState) _then;
+
/// Create a copy of ChatComponentState
/// with the given fields replaced by the non-null parameter values.
- @JsonKey(includeFromJson: false, includeToJson: false)
@override
@pragma('vm:prefer-inline')
- _$$ChatComponentStateImplCopyWith<_$ChatComponentStateImpl> get copyWith =>
- __$$ChatComponentStateImplCopyWithImpl<_$ChatComponentStateImpl>(
- this, _$identity);
-}
-
-abstract class _ChatComponentState implements ChatComponentState {
- const factory _ChatComponentState(
- {required final GlobalKey chatKey,
- required final AutoScrollController scrollController,
- required final InputTextFieldController textEditingController,
- required final User? localUser,
- required final IMap, User> remoteUsers,
- required final IMap, User>
- historicalRemoteUsers,
- required final IMap, User> unknownUsers,
- required final AsyncValue> messageWindow,
- required final String title}) = _$ChatComponentStateImpl;
-
-// GlobalKey for the chat
- @override
- GlobalKey get chatKey; // ScrollController for the chat
- @override
- AutoScrollController
- get scrollController; // TextEditingController for the chat
- @override
- InputTextFieldController get textEditingController; // Local user
- @override
- User? get localUser; // Active remote users
- @override
- IMap, User>
- get remoteUsers; // Historical remote users
- @override
- IMap, User>
- get historicalRemoteUsers; // Unknown users
- @override
- IMap, User> get unknownUsers; // Messages state
- @override
- AsyncValue> get messageWindow; // Title of the chat
- @override
- String get title;
+ $Res call({
+ Object? chatKey = null,
+ Object? scrollController = null,
+ Object? textEditingController = null,
+ Object? localUser = freezed,
+ Object? remoteUsers = null,
+ Object? historicalRemoteUsers = null,
+ Object? unknownUsers = null,
+ Object? messageWindow = null,
+ Object? title = null,
+ }) {
+ return _then(_ChatComponentState(
+ chatKey: null == chatKey
+ ? _self.chatKey
+ : chatKey // ignore: cast_nullable_to_non_nullable
+ as GlobalKey,
+ 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
+ as User?,
+ remoteUsers: null == remoteUsers
+ ? _self.remoteUsers
+ : remoteUsers // ignore: cast_nullable_to_non_nullable
+ as IMap, User>,
+ historicalRemoteUsers: null == historicalRemoteUsers
+ ? _self.historicalRemoteUsers
+ : historicalRemoteUsers // ignore: cast_nullable_to_non_nullable
+ as IMap, User>,
+ unknownUsers: null == unknownUsers
+ ? _self.unknownUsers
+ : unknownUsers // ignore: cast_nullable_to_non_nullable
+ as IMap, User>,
+ messageWindow: null == messageWindow
+ ? _self.messageWindow
+ : messageWindow // ignore: cast_nullable_to_non_nullable
+ as AsyncValue>,
+ title: null == title
+ ? _self.title
+ : title // ignore: cast_nullable_to_non_nullable
+ as String,
+ ));
+ }
/// Create a copy of ChatComponentState
/// with the given fields replaced by the non-null parameter values.
@override
- @JsonKey(includeFromJson: false, includeToJson: false)
- _$$ChatComponentStateImplCopyWith<_$ChatComponentStateImpl> get copyWith =>
- throw _privateConstructorUsedError;
+ @pragma('vm:prefer-inline')
+ $AsyncValueCopyWith, $Res> get messageWindow {
+ return $AsyncValueCopyWith, $Res>(_self.messageWindow,
+ (value) {
+ return _then(_self.copyWith(messageWindow: value));
+ });
+ }
}
+
+// dart format on
diff --git a/lib/chat/models/message_state.dart b/lib/chat/models/message_state.dart
index 8eacc8e..cf82021 100644
--- a/lib/chat/models/message_state.dart
+++ b/lib/chat/models/message_state.dart
@@ -24,7 +24,7 @@ enum MessageSendState {
}
@freezed
-class MessageState with _$MessageState {
+sealed class MessageState with _$MessageState {
const factory MessageState({
// Content of the message
@JsonKey(fromJson: messageFromJson, toJson: messageToJson)
diff --git a/lib/chat/models/message_state.freezed.dart b/lib/chat/models/message_state.freezed.dart
index baafea6..0900f8b 100644
--- a/lib/chat/models/message_state.freezed.dart
+++ b/lib/chat/models/message_state.freezed.dart
@@ -1,3 +1,4 @@
+// dart format width=80
// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint
@@ -9,99 +10,69 @@ part of 'message_state.dart';
// FreezedGenerator
// **************************************************************************
+// dart format off
T _$identity(T value) => value;
-final _privateConstructorUsedError = UnsupportedError(
- 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
-
-MessageState _$MessageStateFromJson(Map json) {
- return _MessageState.fromJson(json);
-}
-
/// @nodoc
-mixin _$MessageState {
+mixin _$MessageState implements DiagnosticableTreeMixin {
// Content of the message
@JsonKey(fromJson: messageFromJson, toJson: messageToJson)
- proto.Message get content =>
- throw _privateConstructorUsedError; // Sent timestamp
- Timestamp get sentTimestamp =>
- throw _privateConstructorUsedError; // Reconciled timestamp
- Timestamp? get reconciledTimestamp =>
- throw _privateConstructorUsedError; // The state of the message
- MessageSendState? get sendState => throw _privateConstructorUsedError;
-
- /// Serializes this MessageState to a JSON map.
- Map toJson() => throw _privateConstructorUsedError;
+ proto.Message get content; // Sent timestamp
+ Timestamp get sentTimestamp; // Reconciled timestamp
+ Timestamp? get reconciledTimestamp; // The state of the message
+ MessageSendState? get sendState;
/// Create a copy of MessageState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
- $MessageStateCopyWith get copyWith =>
- throw _privateConstructorUsedError;
-}
-
-/// @nodoc
-abstract class $MessageStateCopyWith<$Res> {
- factory $MessageStateCopyWith(
- MessageState value, $Res Function(MessageState) then) =
- _$MessageStateCopyWithImpl<$Res, MessageState>;
- @useResult
- $Res call(
- {@JsonKey(fromJson: messageFromJson, toJson: messageToJson)
- proto.Message content,
- Timestamp sentTimestamp,
- Timestamp? reconciledTimestamp,
- MessageSendState? sendState});
-}
-
-/// @nodoc
-class _$MessageStateCopyWithImpl<$Res, $Val extends MessageState>
- implements $MessageStateCopyWith<$Res> {
- _$MessageStateCopyWithImpl(this._value, this._then);
-
- // ignore: unused_field
- final $Val _value;
- // ignore: unused_field
- final $Res Function($Val) _then;
-
- /// Create a copy of MessageState
- /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
+ $MessageStateCopyWith get copyWith =>
+ _$MessageStateCopyWithImpl(
+ this as MessageState, _$identity);
+
+ /// Serializes this MessageState to a JSON map.
+ Map toJson();
+
@override
- $Res call({
- Object? content = null,
- Object? sentTimestamp = null,
- Object? reconciledTimestamp = freezed,
- Object? sendState = freezed,
- }) {
- return _then(_value.copyWith(
- content: null == content
- ? _value.content
- : content // ignore: cast_nullable_to_non_nullable
- as proto.Message,
- sentTimestamp: null == sentTimestamp
- ? _value.sentTimestamp
- : sentTimestamp // ignore: cast_nullable_to_non_nullable
- as Timestamp,
- reconciledTimestamp: freezed == reconciledTimestamp
- ? _value.reconciledTimestamp
- : reconciledTimestamp // ignore: cast_nullable_to_non_nullable
- as Timestamp?,
- sendState: freezed == sendState
- ? _value.sendState
- : sendState // ignore: cast_nullable_to_non_nullable
- as MessageSendState?,
- ) as $Val);
+ void debugFillProperties(DiagnosticPropertiesBuilder properties) {
+ properties
+ ..add(DiagnosticsProperty('type', 'MessageState'))
+ ..add(DiagnosticsProperty('content', content))
+ ..add(DiagnosticsProperty('sentTimestamp', sentTimestamp))
+ ..add(DiagnosticsProperty('reconciledTimestamp', reconciledTimestamp))
+ ..add(DiagnosticsProperty('sendState', sendState));
+ }
+
+ @override
+ bool operator ==(Object other) {
+ return identical(this, other) ||
+ (other.runtimeType == runtimeType &&
+ other is MessageState &&
+ (identical(other.content, content) || other.content == content) &&
+ (identical(other.sentTimestamp, sentTimestamp) ||
+ other.sentTimestamp == sentTimestamp) &&
+ (identical(other.reconciledTimestamp, reconciledTimestamp) ||
+ other.reconciledTimestamp == reconciledTimestamp) &&
+ (identical(other.sendState, sendState) ||
+ other.sendState == sendState));
+ }
+
+ @JsonKey(includeFromJson: false, includeToJson: false)
+ @override
+ int get hashCode => Object.hash(
+ runtimeType, content, sentTimestamp, reconciledTimestamp, sendState);
+
+ @override
+ String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) {
+ return 'MessageState(content: $content, sentTimestamp: $sentTimestamp, reconciledTimestamp: $reconciledTimestamp, sendState: $sendState)';
}
}
/// @nodoc
-abstract class _$$MessageStateImplCopyWith<$Res>
- implements $MessageStateCopyWith<$Res> {
- factory _$$MessageStateImplCopyWith(
- _$MessageStateImpl value, $Res Function(_$MessageStateImpl) then) =
- __$$MessageStateImplCopyWithImpl<$Res>;
- @override
+abstract mixin class $MessageStateCopyWith<$Res> {
+ factory $MessageStateCopyWith(
+ MessageState value, $Res Function(MessageState) _then) =
+ _$MessageStateCopyWithImpl;
@useResult
$Res call(
{@JsonKey(fromJson: messageFromJson, toJson: messageToJson)
@@ -112,12 +83,11 @@ abstract class _$$MessageStateImplCopyWith<$Res>
}
/// @nodoc
-class __$$MessageStateImplCopyWithImpl<$Res>
- extends _$MessageStateCopyWithImpl<$Res, _$MessageStateImpl>
- implements _$$MessageStateImplCopyWith<$Res> {
- __$$MessageStateImplCopyWithImpl(
- _$MessageStateImpl _value, $Res Function(_$MessageStateImpl) _then)
- : super(_value, _then);
+class _$MessageStateCopyWithImpl<$Res> implements $MessageStateCopyWith<$Res> {
+ _$MessageStateCopyWithImpl(this._self, this._then);
+
+ final MessageState _self;
+ final $Res Function(MessageState) _then;
/// Create a copy of MessageState
/// with the given fields replaced by the non-null parameter values.
@@ -129,21 +99,21 @@ class __$$MessageStateImplCopyWithImpl<$Res>
Object? reconciledTimestamp = freezed,
Object? sendState = freezed,
}) {
- return _then(_$MessageStateImpl(
+ return _then(_self.copyWith(
content: null == content
- ? _value.content
+ ? _self.content
: content // ignore: cast_nullable_to_non_nullable
as proto.Message,
sentTimestamp: null == sentTimestamp
- ? _value.sentTimestamp
+ ? _self.sentTimestamp
: sentTimestamp // ignore: cast_nullable_to_non_nullable
as Timestamp,
reconciledTimestamp: freezed == reconciledTimestamp
- ? _value.reconciledTimestamp
+ ? _self.reconciledTimestamp
: reconciledTimestamp // ignore: cast_nullable_to_non_nullable
as Timestamp?,
sendState: freezed == sendState
- ? _value.sendState
+ ? _self.sendState
: sendState // ignore: cast_nullable_to_non_nullable
as MessageSendState?,
));
@@ -152,16 +122,15 @@ class __$$MessageStateImplCopyWithImpl<$Res>
/// @nodoc
@JsonSerializable()
-class _$MessageStateImpl with DiagnosticableTreeMixin implements _MessageState {
- const _$MessageStateImpl(
+class _MessageState with DiagnosticableTreeMixin implements MessageState {
+ const _MessageState(
{@JsonKey(fromJson: messageFromJson, toJson: messageToJson)
required this.content,
required this.sentTimestamp,
required this.reconciledTimestamp,
required this.sendState});
-
- factory _$MessageStateImpl.fromJson(Map json) =>
- _$$MessageStateImplFromJson(json);
+ factory _MessageState.fromJson(Map json) =>
+ _$MessageStateFromJson(json);
// Content of the message
@override
@@ -177,14 +146,23 @@ class _$MessageStateImpl with DiagnosticableTreeMixin implements _MessageState {
@override
final MessageSendState? sendState;
+ /// Create a copy of MessageState
+ /// with the given fields replaced by the non-null parameter values.
@override
- String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) {
- return 'MessageState(content: $content, sentTimestamp: $sentTimestamp, reconciledTimestamp: $reconciledTimestamp, sendState: $sendState)';
+ @JsonKey(includeFromJson: false, includeToJson: false)
+ @pragma('vm:prefer-inline')
+ _$MessageStateCopyWith<_MessageState> get copyWith =>
+ __$MessageStateCopyWithImpl<_MessageState>(this, _$identity);
+
+ @override
+ Map toJson() {
+ return _$MessageStateToJson(
+ this,
+ );
}
@override
void debugFillProperties(DiagnosticPropertiesBuilder properties) {
- super.debugFillProperties(properties);
properties
..add(DiagnosticsProperty('type', 'MessageState'))
..add(DiagnosticsProperty('content', content))
@@ -197,7 +175,7 @@ class _$MessageStateImpl with DiagnosticableTreeMixin implements _MessageState {
bool operator ==(Object other) {
return identical(this, other) ||
(other.runtimeType == runtimeType &&
- other is _$MessageStateImpl &&
+ other is _MessageState &&
(identical(other.content, content) || other.content == content) &&
(identical(other.sentTimestamp, sentTimestamp) ||
other.sentTimestamp == sentTimestamp) &&
@@ -212,48 +190,65 @@ class _$MessageStateImpl with DiagnosticableTreeMixin implements _MessageState {
int get hashCode => Object.hash(
runtimeType, content, sentTimestamp, reconciledTimestamp, sendState);
- /// Create a copy of MessageState
- /// with the given fields replaced by the non-null parameter values.
- @JsonKey(includeFromJson: false, includeToJson: false)
@override
- @pragma('vm:prefer-inline')
- _$$MessageStateImplCopyWith<_$MessageStateImpl> get copyWith =>
- __$$MessageStateImplCopyWithImpl<_$MessageStateImpl>(this, _$identity);
-
- @override
- Map toJson() {
- return _$$MessageStateImplToJson(
- this,
- );
+ String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) {
+ return 'MessageState(content: $content, sentTimestamp: $sentTimestamp, reconciledTimestamp: $reconciledTimestamp, sendState: $sendState)';
}
}
-abstract class _MessageState implements MessageState {
- const factory _MessageState(
+/// @nodoc
+abstract mixin class _$MessageStateCopyWith<$Res>
+ implements $MessageStateCopyWith<$Res> {
+ factory _$MessageStateCopyWith(
+ _MessageState value, $Res Function(_MessageState) _then) =
+ __$MessageStateCopyWithImpl;
+ @override
+ @useResult
+ $Res call(
{@JsonKey(fromJson: messageFromJson, toJson: messageToJson)
- required final proto.Message content,
- required final Timestamp sentTimestamp,
- required final Timestamp? reconciledTimestamp,
- required final MessageSendState? sendState}) = _$MessageStateImpl;
+ proto.Message content,
+ Timestamp sentTimestamp,
+ Timestamp? reconciledTimestamp,
+ MessageSendState? sendState});
+}
- factory _MessageState.fromJson(Map json) =
- _$MessageStateImpl.fromJson;
+/// @nodoc
+class __$MessageStateCopyWithImpl<$Res>
+ implements _$MessageStateCopyWith<$Res> {
+ __$MessageStateCopyWithImpl(this._self, this._then);
-// Content of the message
- @override
- @JsonKey(fromJson: messageFromJson, toJson: messageToJson)
- proto.Message get content; // Sent timestamp
- @override
- Timestamp get sentTimestamp; // Reconciled timestamp
- @override
- Timestamp? get reconciledTimestamp; // The state of the message
- @override
- MessageSendState? get sendState;
+ final _MessageState _self;
+ final $Res Function(_MessageState) _then;
/// Create a copy of MessageState
/// with the given fields replaced by the non-null parameter values.
@override
- @JsonKey(includeFromJson: false, includeToJson: false)
- _$$MessageStateImplCopyWith<_$MessageStateImpl> get copyWith =>
- throw _privateConstructorUsedError;
+ @pragma('vm:prefer-inline')
+ $Res call({
+ Object? content = null,
+ Object? sentTimestamp = null,
+ Object? reconciledTimestamp = freezed,
+ Object? sendState = freezed,
+ }) {
+ return _then(_MessageState(
+ content: null == content
+ ? _self.content
+ : content // ignore: cast_nullable_to_non_nullable
+ as proto.Message,
+ sentTimestamp: null == sentTimestamp
+ ? _self.sentTimestamp
+ : sentTimestamp // ignore: cast_nullable_to_non_nullable
+ as Timestamp,
+ reconciledTimestamp: freezed == reconciledTimestamp
+ ? _self.reconciledTimestamp
+ : reconciledTimestamp // ignore: cast_nullable_to_non_nullable
+ as Timestamp?,
+ sendState: freezed == sendState
+ ? _self.sendState
+ : sendState // ignore: cast_nullable_to_non_nullable
+ as MessageSendState?,
+ ));
+ }
}
+
+// dart format on
diff --git a/lib/chat/models/message_state.g.dart b/lib/chat/models/message_state.g.dart
index 99899a7..daae37f 100644
--- a/lib/chat/models/message_state.g.dart
+++ b/lib/chat/models/message_state.g.dart
@@ -6,8 +6,8 @@ part of 'message_state.dart';
// JsonSerializableGenerator
// **************************************************************************
-_$MessageStateImpl _$$MessageStateImplFromJson(Map json) =>
- _$MessageStateImpl(
+_MessageState _$MessageStateFromJson(Map json) =>
+ _MessageState(
content: messageFromJson(json['content'] as Map),
sentTimestamp: Timestamp.fromJson(json['sent_timestamp']),
reconciledTimestamp: json['reconciled_timestamp'] == null
@@ -18,7 +18,7 @@ _$MessageStateImpl _$$MessageStateImplFromJson(Map json) =>
: MessageSendState.fromJson(json['send_state']),
);
-Map _$$MessageStateImplToJson(_$MessageStateImpl instance) =>
+Map _$MessageStateToJson(_MessageState instance) =>
{
'content': messageToJson(instance.content),
'sent_timestamp': instance.sentTimestamp.toJson(),
diff --git a/lib/chat/models/window_state.dart b/lib/chat/models/window_state.dart
index 91cde8a..14a94a5 100644
--- a/lib/chat/models/window_state.dart
+++ b/lib/chat/models/window_state.dart
@@ -5,7 +5,7 @@ import 'package:freezed_annotation/freezed_annotation.dart';
part 'window_state.freezed.dart';
@freezed
-class WindowState with _$WindowState {
+sealed class WindowState with _$WindowState {
const factory WindowState({
// List of objects in the window
required IList window,
diff --git a/lib/chat/models/window_state.freezed.dart b/lib/chat/models/window_state.freezed.dart
index 59ff754..38a2ec1 100644
--- a/lib/chat/models/window_state.freezed.dart
+++ b/lib/chat/models/window_state.freezed.dart
@@ -1,3 +1,4 @@
+// dart format width=80
// coverage:ignore-file
// GENERATED CODE - DO NOT MODIFY BY HAND
// ignore_for_file: type=lint
@@ -9,98 +10,71 @@ part of 'window_state.dart';
// FreezedGenerator
// **************************************************************************
+// dart format off
T _$identity(T value) => value;
-final _privateConstructorUsedError = UnsupportedError(
- 'It seems like you constructed your class using `MyClass._()`. This constructor is only meant to be used by freezed and you are not supposed to need it nor use it.\nPlease check the documentation here for more information: https://github.com/rrousselGit/freezed#adding-getters-and-methods-to-our-models');
-
/// @nodoc
-mixin _$WindowState {
+mixin _$WindowState implements DiagnosticableTreeMixin {
// List of objects in the window
- IList get window =>
- throw _privateConstructorUsedError; // Total number of objects (windowTail max)
- int get length =>
- throw _privateConstructorUsedError; // One past the end of the last element
- int get windowTail =>
- throw _privateConstructorUsedError; // The total number of elements to try to keep in the window
- int get windowCount =>
- throw _privateConstructorUsedError; // If we should have the tail following the array
- bool get follow => throw _privateConstructorUsedError;
+ IList get window; // Total number of objects (windowTail max)
+ int get length; // One past the end of the last element
+ int get windowTail; // The total number of elements to try to keep in the window
+ int get windowCount; // If we should have the tail following the array
+ bool get follow;
/// Create a copy of WindowState
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
- $WindowStateCopyWith> get copyWith =>
- throw _privateConstructorUsedError;
-}
-
-/// @nodoc
-abstract class $WindowStateCopyWith {
- factory $WindowStateCopyWith(
- WindowState value, $Res Function(WindowState) then) =
- _$WindowStateCopyWithImpl>;
- @useResult
- $Res call(
- {IList window,
- int length,
- int windowTail,
- int windowCount,
- bool follow});
-}
-
-/// @nodoc
-class _$WindowStateCopyWithImpl>
- implements $WindowStateCopyWith {
- _$WindowStateCopyWithImpl(this._value, this._then);
-
- // ignore: unused_field
- final $Val _value;
- // ignore: unused_field
- final $Res Function($Val) _then;
-
- /// Create a copy of WindowState
- /// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline')
+ $WindowStateCopyWith> get copyWith =>
+ _$WindowStateCopyWithImpl>(
+ this as WindowState, _$identity);
+
@override
- $Res call({
- Object? window = null,
- Object? length = null,
- Object? windowTail = null,
- Object? windowCount = null,
- Object? follow = null,
- }) {
- return _then(_value.copyWith(
- window: null == window
- ? _value.window
- : window // ignore: cast_nullable_to_non_nullable
- as IList,
- length: null == length
- ? _value.length
- : length // ignore: cast_nullable_to_non_nullable
- as int,
- windowTail: null == windowTail
- ? _value.windowTail
- : windowTail // ignore: cast_nullable_to_non_nullable
- as int,
- windowCount: null == windowCount
- ? _value.windowCount
- : windowCount // ignore: cast_nullable_to_non_nullable
- as int,
- follow: null == follow
- ? _value.follow
- : follow // ignore: cast_nullable_to_non_nullable
- as bool,
- ) as $Val);
+ void debugFillProperties(DiagnosticPropertiesBuilder properties) {
+ properties
+ ..add(DiagnosticsProperty('type', 'WindowState<$T>'))
+ ..add(DiagnosticsProperty('window', window))
+ ..add(DiagnosticsProperty('length', length))
+ ..add(DiagnosticsProperty('windowTail', windowTail))
+ ..add(DiagnosticsProperty('windowCount', windowCount))
+ ..add(DiagnosticsProperty('follow', follow));
+ }
+
+ @override
+ bool operator ==(Object other) {
+ return identical(this, other) ||
+ (other.runtimeType == runtimeType &&
+ other is WindowState &&
+ const DeepCollectionEquality().equals(other.window, window) &&
+ (identical(other.length, length) || other.length == length) &&
+ (identical(other.windowTail, windowTail) ||
+ other.windowTail == windowTail) &&
+ (identical(other.windowCount, windowCount) ||
+ other.windowCount == windowCount) &&
+ (identical(other.follow, follow) || other.follow == follow));
+ }
+
+ @override
+ int get hashCode => Object.hash(
+ runtimeType,
+ const DeepCollectionEquality().hash(window),
+ length,
+ windowTail,
+ windowCount,
+ follow);
+
+ @override
+ String toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) {
+ return 'WindowState<$T>(window: $window, length: $length, windowTail: $windowTail, windowCount: $windowCount, follow: $follow)';
}
}
/// @nodoc
-abstract class _$$WindowStateImplCopyWith
- implements $WindowStateCopyWith {
- factory _$$WindowStateImplCopyWith(_$WindowStateImpl value,
- $Res Function(_$WindowStateImpl) then) =
- __$$WindowStateImplCopyWithImpl;
- @override
+abstract mixin class $WindowStateCopyWith {
+ factory $WindowStateCopyWith(
+ WindowState value, $Res Function(WindowState) _then) =
+ _$WindowStateCopyWithImpl;
@useResult
$Res call(
{IList window,
@@ -111,12 +85,12 @@ abstract class _$$WindowStateImplCopyWith
}
/// @nodoc
-class __$$WindowStateImplCopyWithImpl
- extends _$WindowStateCopyWithImpl>
- implements _$$WindowStateImplCopyWith {
- __$$WindowStateImplCopyWithImpl(
- _$WindowStateImpl _value, $Res Function(_$WindowStateImpl) _then)
- : super(_value, _then);
+class _$WindowStateCopyWithImpl
+ implements $WindowStateCopyWith {
+ _$WindowStateCopyWithImpl(this._self, this._then);
+
+ final WindowState _self;
+ final $Res Function(WindowState) _then;
/// Create a copy of WindowState
/// with the given fields replaced by the non-null parameter values.
@@ -129,25 +103,25 @@ class __$$WindowStateImplCopyWithImpl
Object? windowCount = null,
Object? follow = null,
}) {
- return _then(_$WindowStateImpl(
+ return _then(_self.copyWith(
window: null == window
- ? _value.window
+ ? _self.window
: window // ignore: cast_nullable_to_non_nullable
as IList,
length: null == length
- ? _value.length
+ ? _self.length
: length // ignore: cast_nullable_to_non_nullable
as int,
windowTail: null == windowTail
- ? _value.windowTail
+ ? _self.windowTail
: windowTail // ignore: cast_nullable_to_non_nullable
as int,
windowCount: null == windowCount
- ? _value.windowCount
+ ? _self.windowCount
: windowCount // ignore: cast_nullable_to_non_nullable
as int,
follow: null == follow
- ? _value.follow
+ ? _self.follow
: follow // ignore: cast_nullable_to_non_nullable
as bool,
));
@@ -156,10 +130,8 @@ class __$$WindowStateImplCopyWithImpl
/// @nodoc
-class _$WindowStateImpl
- with DiagnosticableTreeMixin
- implements _WindowState {
- const _$WindowStateImpl(
+class _WindowState