Template
chore: 初始化脚手架 — sunny_mochi 企业级 Flutter 模板
Core 基础设施:Flavor 三包体系、Drift+SQLCipher 加密数据库 7 拦截器 Dio 网络栈、CrashReporter 崩溃日志、Sealed Failure 错误体系 5 色板主题系统、Auth 认证骨架(Clean Architecture)、Dev Panel、Mock Adapter 通过验证:flutter analyze(0 errors)、flutter test(全绿)、staging APK 74.8MB
This commit is contained in:
@@ -0,0 +1,316 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// coverage:ignore-file
|
||||
// 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 'user_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
/// @nodoc
|
||||
mixin _$UserModel {
|
||||
|
||||
String? get userId; String? get username; String? get realName; String? get phone; String? get avatar; String? get token; String? get tokenName; String? get refreshToken; String? get email; DateTime? get birthday; int? get gender; String? get employeeNo; String? get company; String? get department;
|
||||
/// Create a copy of UserModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$UserModelCopyWith<UserModel> get copyWith => _$UserModelCopyWithImpl<UserModel>(this as UserModel, _$identity);
|
||||
|
||||
/// Serializes this UserModel to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is UserModel&&(identical(other.userId, userId) || other.userId == userId)&&(identical(other.username, username) || other.username == username)&&(identical(other.realName, realName) || other.realName == realName)&&(identical(other.phone, phone) || other.phone == phone)&&(identical(other.avatar, avatar) || other.avatar == avatar)&&(identical(other.token, token) || other.token == token)&&(identical(other.tokenName, tokenName) || other.tokenName == tokenName)&&(identical(other.refreshToken, refreshToken) || other.refreshToken == refreshToken)&&(identical(other.email, email) || other.email == email)&&(identical(other.birthday, birthday) || other.birthday == birthday)&&(identical(other.gender, gender) || other.gender == gender)&&(identical(other.employeeNo, employeeNo) || other.employeeNo == employeeNo)&&(identical(other.company, company) || other.company == company)&&(identical(other.department, department) || other.department == department));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,userId,username,realName,phone,avatar,token,tokenName,refreshToken,email,birthday,gender,employeeNo,company,department);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'UserModel(userId: $userId, username: $username, realName: $realName, phone: $phone, avatar: $avatar, token: $token, tokenName: $tokenName, refreshToken: $refreshToken, email: $email, birthday: $birthday, gender: $gender, employeeNo: $employeeNo, company: $company, department: $department)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $UserModelCopyWith<$Res> {
|
||||
factory $UserModelCopyWith(UserModel value, $Res Function(UserModel) _then) = _$UserModelCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
String? userId, String? username, String? realName, String? phone, String? avatar, String? token, String? tokenName, String? refreshToken, String? email, DateTime? birthday, int? gender, String? employeeNo, String? company, String? department
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$UserModelCopyWithImpl<$Res>
|
||||
implements $UserModelCopyWith<$Res> {
|
||||
_$UserModelCopyWithImpl(this._self, this._then);
|
||||
|
||||
final UserModel _self;
|
||||
final $Res Function(UserModel) _then;
|
||||
|
||||
/// Create a copy of UserModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? userId = freezed,Object? username = freezed,Object? realName = freezed,Object? phone = freezed,Object? avatar = freezed,Object? token = freezed,Object? tokenName = freezed,Object? refreshToken = freezed,Object? email = freezed,Object? birthday = freezed,Object? gender = freezed,Object? employeeNo = freezed,Object? company = freezed,Object? department = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
userId: freezed == userId ? _self.userId : userId // ignore: cast_nullable_to_non_nullable
|
||||
as String?,username: freezed == username ? _self.username : username // ignore: cast_nullable_to_non_nullable
|
||||
as String?,realName: freezed == realName ? _self.realName : realName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,phone: freezed == phone ? _self.phone : phone // ignore: cast_nullable_to_non_nullable
|
||||
as String?,avatar: freezed == avatar ? _self.avatar : avatar // ignore: cast_nullable_to_non_nullable
|
||||
as String?,token: freezed == token ? _self.token : token // ignore: cast_nullable_to_non_nullable
|
||||
as String?,tokenName: freezed == tokenName ? _self.tokenName : tokenName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,refreshToken: freezed == refreshToken ? _self.refreshToken : refreshToken // ignore: cast_nullable_to_non_nullable
|
||||
as String?,email: freezed == email ? _self.email : email // ignore: cast_nullable_to_non_nullable
|
||||
as String?,birthday: freezed == birthday ? _self.birthday : birthday // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime?,gender: freezed == gender ? _self.gender : gender // ignore: cast_nullable_to_non_nullable
|
||||
as int?,employeeNo: freezed == employeeNo ? _self.employeeNo : employeeNo // ignore: cast_nullable_to_non_nullable
|
||||
as String?,company: freezed == company ? _self.company : company // ignore: cast_nullable_to_non_nullable
|
||||
as String?,department: freezed == department ? _self.department : department // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [UserModel].
|
||||
extension UserModelPatterns on UserModel {
|
||||
/// A variant of `map` that fallback to returning `orElse`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _UserModel value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _UserModel() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// Callbacks receives the raw object, upcasted.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case final Subclass2 value:
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _UserModel value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _UserModel():
|
||||
return $default(_that);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `map` that fallback to returning `null`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _UserModel value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _UserModel() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to an `orElse` callback.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String? userId, String? username, String? realName, String? phone, String? avatar, String? token, String? tokenName, String? refreshToken, String? email, DateTime? birthday, int? gender, String? employeeNo, String? company, String? department)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _UserModel() when $default != null:
|
||||
return $default(_that.userId,_that.username,_that.realName,_that.phone,_that.avatar,_that.token,_that.tokenName,_that.refreshToken,_that.email,_that.birthday,_that.gender,_that.employeeNo,_that.company,_that.department);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// As opposed to `map`, this offers destructuring.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case Subclass2(:final field2):
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String? userId, String? username, String? realName, String? phone, String? avatar, String? token, String? tokenName, String? refreshToken, String? email, DateTime? birthday, int? gender, String? employeeNo, String? company, String? department) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _UserModel():
|
||||
return $default(_that.userId,_that.username,_that.realName,_that.phone,_that.avatar,_that.token,_that.tokenName,_that.refreshToken,_that.email,_that.birthday,_that.gender,_that.employeeNo,_that.company,_that.department);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to returning `null`
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String? userId, String? username, String? realName, String? phone, String? avatar, String? token, String? tokenName, String? refreshToken, String? email, DateTime? birthday, int? gender, String? employeeNo, String? company, String? department)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _UserModel() when $default != null:
|
||||
return $default(_that.userId,_that.username,_that.realName,_that.phone,_that.avatar,_that.token,_that.tokenName,_that.refreshToken,_that.email,_that.birthday,_that.gender,_that.employeeNo,_that.company,_that.department);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
|
||||
class _UserModel implements UserModel {
|
||||
const _UserModel({this.userId, this.username, this.realName, this.phone, this.avatar, this.token, this.tokenName, this.refreshToken, this.email, this.birthday, this.gender, this.employeeNo, this.company, this.department});
|
||||
factory _UserModel.fromJson(Map<String, dynamic> json) => _$UserModelFromJson(json);
|
||||
|
||||
@override final String? userId;
|
||||
@override final String? username;
|
||||
@override final String? realName;
|
||||
@override final String? phone;
|
||||
@override final String? avatar;
|
||||
@override final String? token;
|
||||
@override final String? tokenName;
|
||||
@override final String? refreshToken;
|
||||
@override final String? email;
|
||||
@override final DateTime? birthday;
|
||||
@override final int? gender;
|
||||
@override final String? employeeNo;
|
||||
@override final String? company;
|
||||
@override final String? department;
|
||||
|
||||
/// Create a copy of UserModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$UserModelCopyWith<_UserModel> get copyWith => __$UserModelCopyWithImpl<_UserModel>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$UserModelToJson(this, );
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _UserModel&&(identical(other.userId, userId) || other.userId == userId)&&(identical(other.username, username) || other.username == username)&&(identical(other.realName, realName) || other.realName == realName)&&(identical(other.phone, phone) || other.phone == phone)&&(identical(other.avatar, avatar) || other.avatar == avatar)&&(identical(other.token, token) || other.token == token)&&(identical(other.tokenName, tokenName) || other.tokenName == tokenName)&&(identical(other.refreshToken, refreshToken) || other.refreshToken == refreshToken)&&(identical(other.email, email) || other.email == email)&&(identical(other.birthday, birthday) || other.birthday == birthday)&&(identical(other.gender, gender) || other.gender == gender)&&(identical(other.employeeNo, employeeNo) || other.employeeNo == employeeNo)&&(identical(other.company, company) || other.company == company)&&(identical(other.department, department) || other.department == department));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,userId,username,realName,phone,avatar,token,tokenName,refreshToken,email,birthday,gender,employeeNo,company,department);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'UserModel(userId: $userId, username: $username, realName: $realName, phone: $phone, avatar: $avatar, token: $token, tokenName: $tokenName, refreshToken: $refreshToken, email: $email, birthday: $birthday, gender: $gender, employeeNo: $employeeNo, company: $company, department: $department)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$UserModelCopyWith<$Res> implements $UserModelCopyWith<$Res> {
|
||||
factory _$UserModelCopyWith(_UserModel value, $Res Function(_UserModel) _then) = __$UserModelCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
String? userId, String? username, String? realName, String? phone, String? avatar, String? token, String? tokenName, String? refreshToken, String? email, DateTime? birthday, int? gender, String? employeeNo, String? company, String? department
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$UserModelCopyWithImpl<$Res>
|
||||
implements _$UserModelCopyWith<$Res> {
|
||||
__$UserModelCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _UserModel _self;
|
||||
final $Res Function(_UserModel) _then;
|
||||
|
||||
/// Create a copy of UserModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? userId = freezed,Object? username = freezed,Object? realName = freezed,Object? phone = freezed,Object? avatar = freezed,Object? token = freezed,Object? tokenName = freezed,Object? refreshToken = freezed,Object? email = freezed,Object? birthday = freezed,Object? gender = freezed,Object? employeeNo = freezed,Object? company = freezed,Object? department = freezed,}) {
|
||||
return _then(_UserModel(
|
||||
userId: freezed == userId ? _self.userId : userId // ignore: cast_nullable_to_non_nullable
|
||||
as String?,username: freezed == username ? _self.username : username // ignore: cast_nullable_to_non_nullable
|
||||
as String?,realName: freezed == realName ? _self.realName : realName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,phone: freezed == phone ? _self.phone : phone // ignore: cast_nullable_to_non_nullable
|
||||
as String?,avatar: freezed == avatar ? _self.avatar : avatar // ignore: cast_nullable_to_non_nullable
|
||||
as String?,token: freezed == token ? _self.token : token // ignore: cast_nullable_to_non_nullable
|
||||
as String?,tokenName: freezed == tokenName ? _self.tokenName : tokenName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,refreshToken: freezed == refreshToken ? _self.refreshToken : refreshToken // ignore: cast_nullable_to_non_nullable
|
||||
as String?,email: freezed == email ? _self.email : email // ignore: cast_nullable_to_non_nullable
|
||||
as String?,birthday: freezed == birthday ? _self.birthday : birthday // ignore: cast_nullable_to_non_nullable
|
||||
as DateTime?,gender: freezed == gender ? _self.gender : gender // ignore: cast_nullable_to_non_nullable
|
||||
as int?,employeeNo: freezed == employeeNo ? _self.employeeNo : employeeNo // ignore: cast_nullable_to_non_nullable
|
||||
as String?,company: freezed == company ? _self.company : company // ignore: cast_nullable_to_non_nullable
|
||||
as String?,department: freezed == department ? _self.department : department // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// dart format on
|
||||
Reference in New Issue
Block a user