Working with client side auth
This commit is contained in:
parent
386f7fffd6
commit
61ded00870
11 changed files with 72 additions and 125 deletions
|
@ -16,7 +16,7 @@ T _$identity<T>(T value) => value;
|
|||
/// @nodoc
|
||||
mixin _$MatrixUser {
|
||||
|
||||
String get userId; String get matrixToken; String get nonce;
|
||||
String get userId; String get matrixToken;
|
||||
/// Create a copy of MatrixUser
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
|
@ -29,16 +29,16 @@ $MatrixUserCopyWith<MatrixUser> get copyWith => _$MatrixUserCopyWithImpl<MatrixU
|
|||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is MatrixUser&&(identical(other.userId, userId) || other.userId == userId)&&(identical(other.matrixToken, matrixToken) || other.matrixToken == matrixToken)&&(identical(other.nonce, nonce) || other.nonce == nonce));
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is MatrixUser&&(identical(other.userId, userId) || other.userId == userId)&&(identical(other.matrixToken, matrixToken) || other.matrixToken == matrixToken));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,userId,matrixToken,nonce);
|
||||
int get hashCode => Object.hash(runtimeType,userId,matrixToken);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return "MatrixUser(userId: $userId, matrixToken: $matrixToken, nonce: $nonce)";
|
||||
return "MatrixUser(userId: $userId, matrixToken: $matrixToken)";
|
||||
}
|
||||
|
||||
|
||||
|
@ -49,7 +49,7 @@ abstract mixin class $MatrixUserCopyWith<$Res> {
|
|||
factory $MatrixUserCopyWith(MatrixUser value, $Res Function(MatrixUser) _then) = _$MatrixUserCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
String userId, String matrixToken, String nonce
|
||||
String userId, String matrixToken
|
||||
});
|
||||
|
||||
|
||||
|
@ -66,11 +66,10 @@ class _$MatrixUserCopyWithImpl<$Res>
|
|||
|
||||
/// Create a copy of MatrixUser
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma("vm:prefer-inline") @override $Res call({Object? userId = null,Object? matrixToken = null,Object? nonce = null,}) {
|
||||
@pragma("vm:prefer-inline") @override $Res call({Object? userId = null,Object? matrixToken = null,}) {
|
||||
return _then(_self.copyWith(
|
||||
userId: null == userId ? _self.userId : userId // ignore: cast_nullable_to_non_nullable
|
||||
as String,matrixToken: null == matrixToken ? _self.matrixToken : matrixToken // ignore: cast_nullable_to_non_nullable
|
||||
as String,nonce: null == nonce ? _self.nonce : nonce // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
));
|
||||
}
|
||||
|
@ -82,12 +81,11 @@ as String,
|
|||
@JsonSerializable()
|
||||
|
||||
class _MatrixUser implements MatrixUser {
|
||||
const _MatrixUser({required this.userId, required this.matrixToken, required this.nonce});
|
||||
const _MatrixUser({required this.userId, required this.matrixToken});
|
||||
factory _MatrixUser.fromJson(Map<String, dynamic> json) => _$MatrixUserFromJson(json);
|
||||
|
||||
@override final String userId;
|
||||
@override final String matrixToken;
|
||||
@override final String nonce;
|
||||
|
||||
/// Create a copy of MatrixUser
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
|
@ -102,16 +100,16 @@ Map<String, dynamic> toJson() {
|
|||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _MatrixUser&&(identical(other.userId, userId) || other.userId == userId)&&(identical(other.matrixToken, matrixToken) || other.matrixToken == matrixToken)&&(identical(other.nonce, nonce) || other.nonce == nonce));
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _MatrixUser&&(identical(other.userId, userId) || other.userId == userId)&&(identical(other.matrixToken, matrixToken) || other.matrixToken == matrixToken));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,userId,matrixToken,nonce);
|
||||
int get hashCode => Object.hash(runtimeType,userId,matrixToken);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return "MatrixUser(userId: $userId, matrixToken: $matrixToken, nonce: $nonce)";
|
||||
return "MatrixUser(userId: $userId, matrixToken: $matrixToken)";
|
||||
}
|
||||
|
||||
|
||||
|
@ -122,7 +120,7 @@ abstract mixin class _$MatrixUserCopyWith<$Res> implements $MatrixUserCopyWith<$
|
|||
factory _$MatrixUserCopyWith(_MatrixUser value, $Res Function(_MatrixUser) _then) = __$MatrixUserCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
String userId, String matrixToken, String nonce
|
||||
String userId, String matrixToken
|
||||
});
|
||||
|
||||
|
||||
|
@ -139,11 +137,10 @@ class __$MatrixUserCopyWithImpl<$Res>
|
|||
|
||||
/// Create a copy of MatrixUser
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma("vm:prefer-inline") $Res call({Object? userId = null,Object? matrixToken = null,Object? nonce = null,}) {
|
||||
@override @pragma("vm:prefer-inline") $Res call({Object? userId = null,Object? matrixToken = null,}) {
|
||||
return _then(_MatrixUser(
|
||||
userId: null == userId ? _self.userId : userId // ignore: cast_nullable_to_non_nullable
|
||||
as String,matrixToken: null == matrixToken ? _self.matrixToken : matrixToken // ignore: cast_nullable_to_non_nullable
|
||||
as String,nonce: null == nonce ? _self.nonce : nonce // ignore: cast_nullable_to_non_nullable
|
||||
as String,
|
||||
));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue