- 新增 SplashPage(启动页)和 LoginPage(登录页),支持路由跳转 - 扩展 AuthState,增加 submitting/alert/busy 状态及消费机制 - AuthController 增加 checkLoginState/register/showAlert 等方法 - 删除旧模型文件(binding_item, token_response, verify_response) - 删除旧版 LoginPage,迁移至 features/auth 目录 - 更新本地化字符串,增加注册相关文案 - 调整默认 API 地址为本地开发环境
275 lines
8.3 KiB
Dart
275 lines
8.3 KiB
Dart
// coverage:ignore-file
|
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
|
// ignore_for_file: type=lint
|
|
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
|
|
|
part of 'auth_state.dart';
|
|
|
|
// **************************************************************************
|
|
// FreezedGenerator
|
|
// **************************************************************************
|
|
|
|
T _$identity<T>(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 _$AuthState {
|
|
bool get loggedIn => throw _privateConstructorUsedError;
|
|
bool get restoring => throw _privateConstructorUsedError;
|
|
bool get submitting => throw _privateConstructorUsedError;
|
|
String? get username => throw _privateConstructorUsedError;
|
|
String? get error => throw _privateConstructorUsedError;
|
|
String? get alert => throw _privateConstructorUsedError;
|
|
|
|
/// Create a copy of AuthState
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
$AuthStateCopyWith<AuthState> get copyWith =>
|
|
throw _privateConstructorUsedError;
|
|
}
|
|
|
|
/// @nodoc
|
|
abstract class $AuthStateCopyWith<$Res> {
|
|
factory $AuthStateCopyWith(AuthState value, $Res Function(AuthState) then) =
|
|
_$AuthStateCopyWithImpl<$Res, AuthState>;
|
|
@useResult
|
|
$Res call({
|
|
bool loggedIn,
|
|
bool restoring,
|
|
bool submitting,
|
|
String? username,
|
|
String? error,
|
|
String? alert,
|
|
});
|
|
}
|
|
|
|
/// @nodoc
|
|
class _$AuthStateCopyWithImpl<$Res, $Val extends AuthState>
|
|
implements $AuthStateCopyWith<$Res> {
|
|
_$AuthStateCopyWithImpl(this._value, this._then);
|
|
|
|
// ignore: unused_field
|
|
final $Val _value;
|
|
// ignore: unused_field
|
|
final $Res Function($Val) _then;
|
|
|
|
/// Create a copy of AuthState
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@pragma('vm:prefer-inline')
|
|
@override
|
|
$Res call({
|
|
Object? loggedIn = null,
|
|
Object? restoring = null,
|
|
Object? submitting = null,
|
|
Object? username = freezed,
|
|
Object? error = freezed,
|
|
Object? alert = freezed,
|
|
}) {
|
|
return _then(
|
|
_value.copyWith(
|
|
loggedIn: null == loggedIn
|
|
? _value.loggedIn
|
|
: loggedIn // ignore: cast_nullable_to_non_nullable
|
|
as bool,
|
|
restoring: null == restoring
|
|
? _value.restoring
|
|
: restoring // ignore: cast_nullable_to_non_nullable
|
|
as bool,
|
|
submitting: null == submitting
|
|
? _value.submitting
|
|
: submitting // ignore: cast_nullable_to_non_nullable
|
|
as bool,
|
|
username: freezed == username
|
|
? _value.username
|
|
: username // ignore: cast_nullable_to_non_nullable
|
|
as String?,
|
|
error: freezed == error
|
|
? _value.error
|
|
: error // ignore: cast_nullable_to_non_nullable
|
|
as String?,
|
|
alert: freezed == alert
|
|
? _value.alert
|
|
: alert // ignore: cast_nullable_to_non_nullable
|
|
as String?,
|
|
)
|
|
as $Val,
|
|
);
|
|
}
|
|
}
|
|
|
|
/// @nodoc
|
|
abstract class _$$AuthStateImplCopyWith<$Res>
|
|
implements $AuthStateCopyWith<$Res> {
|
|
factory _$$AuthStateImplCopyWith(
|
|
_$AuthStateImpl value,
|
|
$Res Function(_$AuthStateImpl) then,
|
|
) = __$$AuthStateImplCopyWithImpl<$Res>;
|
|
@override
|
|
@useResult
|
|
$Res call({
|
|
bool loggedIn,
|
|
bool restoring,
|
|
bool submitting,
|
|
String? username,
|
|
String? error,
|
|
String? alert,
|
|
});
|
|
}
|
|
|
|
/// @nodoc
|
|
class __$$AuthStateImplCopyWithImpl<$Res>
|
|
extends _$AuthStateCopyWithImpl<$Res, _$AuthStateImpl>
|
|
implements _$$AuthStateImplCopyWith<$Res> {
|
|
__$$AuthStateImplCopyWithImpl(
|
|
_$AuthStateImpl _value,
|
|
$Res Function(_$AuthStateImpl) _then,
|
|
) : super(_value, _then);
|
|
|
|
/// Create a copy of AuthState
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@pragma('vm:prefer-inline')
|
|
@override
|
|
$Res call({
|
|
Object? loggedIn = null,
|
|
Object? restoring = null,
|
|
Object? submitting = null,
|
|
Object? username = freezed,
|
|
Object? error = freezed,
|
|
Object? alert = freezed,
|
|
}) {
|
|
return _then(
|
|
_$AuthStateImpl(
|
|
loggedIn: null == loggedIn
|
|
? _value.loggedIn
|
|
: loggedIn // ignore: cast_nullable_to_non_nullable
|
|
as bool,
|
|
restoring: null == restoring
|
|
? _value.restoring
|
|
: restoring // ignore: cast_nullable_to_non_nullable
|
|
as bool,
|
|
submitting: null == submitting
|
|
? _value.submitting
|
|
: submitting // ignore: cast_nullable_to_non_nullable
|
|
as bool,
|
|
username: freezed == username
|
|
? _value.username
|
|
: username // ignore: cast_nullable_to_non_nullable
|
|
as String?,
|
|
error: freezed == error
|
|
? _value.error
|
|
: error // ignore: cast_nullable_to_non_nullable
|
|
as String?,
|
|
alert: freezed == alert
|
|
? _value.alert
|
|
: alert // ignore: cast_nullable_to_non_nullable
|
|
as String?,
|
|
),
|
|
);
|
|
}
|
|
}
|
|
|
|
/// @nodoc
|
|
|
|
class _$AuthStateImpl extends _AuthState {
|
|
const _$AuthStateImpl({
|
|
this.loggedIn = false,
|
|
this.restoring = false,
|
|
this.submitting = false,
|
|
this.username,
|
|
this.error,
|
|
this.alert,
|
|
}) : super._();
|
|
|
|
@override
|
|
@JsonKey()
|
|
final bool loggedIn;
|
|
@override
|
|
@JsonKey()
|
|
final bool restoring;
|
|
@override
|
|
@JsonKey()
|
|
final bool submitting;
|
|
@override
|
|
final String? username;
|
|
@override
|
|
final String? error;
|
|
@override
|
|
final String? alert;
|
|
|
|
@override
|
|
String toString() {
|
|
return 'AuthState(loggedIn: $loggedIn, restoring: $restoring, submitting: $submitting, username: $username, error: $error, alert: $alert)';
|
|
}
|
|
|
|
@override
|
|
bool operator ==(Object other) {
|
|
return identical(this, other) ||
|
|
(other.runtimeType == runtimeType &&
|
|
other is _$AuthStateImpl &&
|
|
(identical(other.loggedIn, loggedIn) ||
|
|
other.loggedIn == loggedIn) &&
|
|
(identical(other.restoring, restoring) ||
|
|
other.restoring == restoring) &&
|
|
(identical(other.submitting, submitting) ||
|
|
other.submitting == submitting) &&
|
|
(identical(other.username, username) ||
|
|
other.username == username) &&
|
|
(identical(other.error, error) || other.error == error) &&
|
|
(identical(other.alert, alert) || other.alert == alert));
|
|
}
|
|
|
|
@override
|
|
int get hashCode => Object.hash(
|
|
runtimeType,
|
|
loggedIn,
|
|
restoring,
|
|
submitting,
|
|
username,
|
|
error,
|
|
alert,
|
|
);
|
|
|
|
/// Create a copy of AuthState
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
@override
|
|
@pragma('vm:prefer-inline')
|
|
_$$AuthStateImplCopyWith<_$AuthStateImpl> get copyWith =>
|
|
__$$AuthStateImplCopyWithImpl<_$AuthStateImpl>(this, _$identity);
|
|
}
|
|
|
|
abstract class _AuthState extends AuthState {
|
|
const factory _AuthState({
|
|
final bool loggedIn,
|
|
final bool restoring,
|
|
final bool submitting,
|
|
final String? username,
|
|
final String? error,
|
|
final String? alert,
|
|
}) = _$AuthStateImpl;
|
|
const _AuthState._() : super._();
|
|
|
|
@override
|
|
bool get loggedIn;
|
|
@override
|
|
bool get restoring;
|
|
@override
|
|
bool get submitting;
|
|
@override
|
|
String? get username;
|
|
@override
|
|
String? get error;
|
|
@override
|
|
String? get alert;
|
|
|
|
/// Create a copy of AuthState
|
|
/// with the given fields replaced by the non-null parameter values.
|
|
@override
|
|
@JsonKey(includeFromJson: false, includeToJson: false)
|
|
_$$AuthStateImplCopyWith<_$AuthStateImpl> get copyWith =>
|
|
throw _privateConstructorUsedError;
|
|
}
|