Merge branch 'refs/heads/feature/chicken' into feature/inspectionV1.0.2
# Conflicts: # packages/auth/lib/presentation/pages/auth/view.dart # packages/auth/pubspec.yaml # packages/core/lib/presentation/widget/app_bar/r_app_bar.dart # packages/core/lib/presentation/widget/inputs/r_input.dart
This commit is contained in:
@@ -5,10 +5,14 @@ class DioErrorHandler {
|
||||
void handle(DioException error) {
|
||||
switch (error.response?.statusCode) {
|
||||
case 401:
|
||||
_handle401();
|
||||
_handleGeneric(error);
|
||||
break;
|
||||
case 403:
|
||||
_handle403();
|
||||
_handleGeneric(error);
|
||||
break;
|
||||
|
||||
case 410:
|
||||
_handle410();
|
||||
break;
|
||||
default:
|
||||
_handleGeneric(error);
|
||||
@@ -16,21 +20,22 @@ class DioErrorHandler {
|
||||
}
|
||||
|
||||
//wrong password/user name => "detail": "No active account found with the given credentials" - 401
|
||||
void _handle401() {
|
||||
Get.showSnackbar(
|
||||
_errorSnackBar('نام کاربری یا رمز عبور اشتباه است'),
|
||||
);
|
||||
void _handle410() {
|
||||
Get.showSnackbar(_errorSnackBar('نام کاربری یا رمز عبور اشتباه است'));
|
||||
}
|
||||
|
||||
//wrong captcha => "detail": "Captcha code is incorrect" - 403
|
||||
void _handle403() {
|
||||
Get.showSnackbar(
|
||||
_errorSnackBar('کد امنیتی اشتباه است'),
|
||||
);
|
||||
}
|
||||
void _handle403() {}
|
||||
|
||||
void _handleGeneric(DioException error) {
|
||||
// General error handling
|
||||
Get.showSnackbar(
|
||||
_errorSnackBar(
|
||||
error.response?.data.keys.first == 'is_user'
|
||||
? 'کاربر با این شماره تلفن وجود ندارد'
|
||||
: error.response?.data[error.response?.data.keys.first] ??
|
||||
'خطا در برقراری ارتباط با سرور',
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
GetSnackBar _errorSnackBar(String message) {
|
||||
|
||||
@@ -4,15 +4,21 @@ import 'package:rasadyar_core/core.dart';
|
||||
import '../di/auth_di.dart';
|
||||
import 'constant.dart';
|
||||
|
||||
/*
|
||||
class DioRemoteManager {
|
||||
DioRemote? _currentClient;
|
||||
ApiEnvironment? _currentEnv;
|
||||
|
||||
Future<DioRemote> setEnvironment([
|
||||
ApiEnvironment env = ApiEnvironment.dam,
|
||||
]) async {
|
||||
Future<DioRemote> setEnvironment([ApiEnvironment env = ApiEnvironment.dam]) async {
|
||||
if (_currentEnv != env) {
|
||||
_currentClient = DioRemote(env.baseUrl);
|
||||
_currentClient = DioRemote(
|
||||
baseUrl: env.baseUrl,
|
||||
interceptors: AppInterceptor(
|
||||
refreshTokenCallback: () async{
|
||||
return null;
|
||||
},
|
||||
),
|
||||
);
|
||||
await _currentClient?.init();
|
||||
_currentEnv = env;
|
||||
}
|
||||
@@ -39,7 +45,6 @@ Future<void> switchAuthEnvironment(ApiEnvironment env) async {
|
||||
await diAuth.unregister<AuthRepositoryImpl>();
|
||||
}
|
||||
|
||||
diAuth.registerLazySingleton<AuthRepositoryImpl>(
|
||||
() => AuthRepositoryImpl(dioRemote),
|
||||
);
|
||||
diAuth.registerLazySingleton<AuthRepositoryImpl>(() => AuthRepositoryImpl(dioRemote));
|
||||
}
|
||||
*/
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import 'package:rasadyar_auth/data/common/constant.dart';
|
||||
import 'package:rasadyar_auth/data/common/dio_error_handler.dart';
|
||||
import 'package:rasadyar_auth/data/models/response/auth/auth_response_model.dart';
|
||||
import 'package:rasadyar_auth/data/repositories/auth_repository_imp.dart';
|
||||
import 'package:rasadyar_auth/data/services/token_storage_service.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
@@ -9,13 +9,54 @@ import '../common/dio_manager.dart';
|
||||
GetIt diAuth = GetIt.instance;
|
||||
|
||||
Future<void> setupAuthDI() async {
|
||||
diAuth.registerLazySingleton(() => DioRemoteManager());
|
||||
|
||||
diAuth.registerLazySingleton<AppInterceptor>(
|
||||
() => AppInterceptor(
|
||||
refreshTokenCallback: () async {
|
||||
var tokenService = Get.find<TokenStorageService>();
|
||||
final authRepo = diAuth.get<AuthRepositoryImpl>();
|
||||
|
||||
final manager = diAuth.get<DioRemoteManager>();
|
||||
final dioRemote = await manager.setEnvironment(ApiEnvironment.dam);
|
||||
diAuth.registerCachedFactory<AuthRepositoryImpl>(
|
||||
() => AuthRepositoryImpl(dioRemote),
|
||||
final refreshToken = tokenService.refreshToken.value;
|
||||
if (refreshToken == null) return null;
|
||||
|
||||
final result = await authRepo.loginWithRefreshToken(
|
||||
authRequest: {"refresh_token": refreshToken},
|
||||
);
|
||||
|
||||
if (result is AuthResponseModel) {
|
||||
await tokenService.saveAccessToken(result.access!);
|
||||
return result.access;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
saveTokenCallback: (String newToken) async {
|
||||
//
|
||||
},
|
||||
clearTokenCallback: () async {
|
||||
//await tokenService.clearTokens(); // حذف همه توکنها
|
||||
},
|
||||
),
|
||||
);
|
||||
|
||||
diAuth.registerLazySingleton<DioRemote>(
|
||||
() => DioRemote(interceptors: diAuth.get<AppInterceptor>()),
|
||||
);
|
||||
|
||||
final dioRemote = diAuth.get<DioRemote>();
|
||||
await dioRemote.init();
|
||||
diAuth.registerSingleton<AuthRepositoryImpl>(AuthRepositoryImpl(dioRemote));
|
||||
diAuth.registerLazySingleton<DioErrorHandler>(() => DioErrorHandler());
|
||||
}
|
||||
|
||||
Future<void> newSetupAuthDI(String newUrl) async {
|
||||
diAuth.registerLazySingleton<DioRemote>(
|
||||
() => DioRemote(baseUrl: newUrl, interceptors: diAuth.get<AppInterceptor>()),
|
||||
instanceName: 'newRemote',
|
||||
);
|
||||
final dioRemote = diAuth.get<DioRemote>(instanceName: 'newRemote');
|
||||
await dioRemote.init();
|
||||
diAuth.registerSingleton<AuthRepositoryImpl>(
|
||||
AuthRepositoryImpl(dioRemote),
|
||||
instanceName: 'newUrl',
|
||||
);
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import 'package:rasadyar_auth/auth.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
import 'package:rasadyar_core/utils/local/local_utils.dart';
|
||||
|
||||
part 'user_local_model.g.dart';
|
||||
|
||||
@HiveType(typeId: 0)
|
||||
@HiveType(typeId: authUserLocalModelTypeId)
|
||||
class UserLocalModel extends HiveObject {
|
||||
@HiveField(0)
|
||||
String? username;
|
||||
@@ -19,6 +19,12 @@ class UserLocalModel extends HiveObject {
|
||||
@HiveField(5)
|
||||
Module? module;
|
||||
|
||||
@HiveField(6)
|
||||
String? backend;
|
||||
|
||||
@HiveField(7)
|
||||
String? apiKey;
|
||||
|
||||
UserLocalModel({
|
||||
this.username,
|
||||
this.password,
|
||||
@@ -26,6 +32,8 @@ class UserLocalModel extends HiveObject {
|
||||
this.refreshToken,
|
||||
this.name,
|
||||
this.module,
|
||||
this.backend,
|
||||
this.apiKey,
|
||||
});
|
||||
|
||||
UserLocalModel copyWith({
|
||||
@@ -35,6 +43,8 @@ class UserLocalModel extends HiveObject {
|
||||
String? refreshToken,
|
||||
String? name,
|
||||
Module? module,
|
||||
String? backend,
|
||||
String? apiKey,
|
||||
}) {
|
||||
return UserLocalModel(
|
||||
username: username ?? this.username,
|
||||
@@ -43,14 +53,18 @@ class UserLocalModel extends HiveObject {
|
||||
refreshToken: refreshToken ?? this.refreshToken,
|
||||
name: name ?? this.name,
|
||||
module: module ?? this.module,
|
||||
backend: backend ?? this.backend,
|
||||
apiKey: apiKey ?? this.apiKey,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@HiveType(typeId: 1)
|
||||
@HiveType(typeId: authModuleTypeId)
|
||||
enum Module {
|
||||
@HiveField(0)
|
||||
liveStocks,
|
||||
@HiveField(1)
|
||||
inspection,
|
||||
@HiveField(2)
|
||||
chicken,
|
||||
}
|
||||
|
||||
@@ -23,13 +23,15 @@ class UserLocalModelAdapter extends TypeAdapter<UserLocalModel> {
|
||||
refreshToken: fields[3] as String?,
|
||||
name: fields[4] as String?,
|
||||
module: fields[5] as Module?,
|
||||
backend: fields[6] as String?,
|
||||
apiKey: fields[7] as String?,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void write(BinaryWriter writer, UserLocalModel obj) {
|
||||
writer
|
||||
..writeByte(6)
|
||||
..writeByte(8)
|
||||
..writeByte(0)
|
||||
..write(obj.username)
|
||||
..writeByte(1)
|
||||
@@ -41,7 +43,11 @@ class UserLocalModelAdapter extends TypeAdapter<UserLocalModel> {
|
||||
..writeByte(4)
|
||||
..write(obj.name)
|
||||
..writeByte(5)
|
||||
..write(obj.module);
|
||||
..write(obj.module)
|
||||
..writeByte(6)
|
||||
..write(obj.backend)
|
||||
..writeByte(7)
|
||||
..write(obj.apiKey);
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -66,6 +72,8 @@ class ModuleAdapter extends TypeAdapter<Module> {
|
||||
return Module.liveStocks;
|
||||
case 1:
|
||||
return Module.inspection;
|
||||
case 2:
|
||||
return Module.chicken;
|
||||
default:
|
||||
return Module.liveStocks;
|
||||
}
|
||||
@@ -78,6 +86,8 @@ class ModuleAdapter extends TypeAdapter<Module> {
|
||||
writer.writeByte(0);
|
||||
case Module.inspection:
|
||||
writer.writeByte(1);
|
||||
case Module.chicken:
|
||||
writer.writeByte(2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
part 'user_info_model.freezed.dart';
|
||||
|
||||
part 'user_info_model.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class UserInfoModel with _$UserInfoModel {
|
||||
const factory UserInfoModel({
|
||||
bool? isUser,
|
||||
String? address,
|
||||
String? backend,
|
||||
String? apiKey,
|
||||
}) = _UserInfoModel ;
|
||||
|
||||
factory UserInfoModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$UserInfoModelFromJson(json);
|
||||
}
|
||||
@@ -0,0 +1,157 @@
|
||||
// dart format width=80
|
||||
// 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 'user_info_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
/// @nodoc
|
||||
mixin _$UserInfoModel {
|
||||
|
||||
bool? get isUser; String? get address; String? get backend; String? get apiKey;
|
||||
/// Create a copy of UserInfoModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$UserInfoModelCopyWith<UserInfoModel> get copyWith => _$UserInfoModelCopyWithImpl<UserInfoModel>(this as UserInfoModel, _$identity);
|
||||
|
||||
/// Serializes this UserInfoModel to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is UserInfoModel&&(identical(other.isUser, isUser) || other.isUser == isUser)&&(identical(other.address, address) || other.address == address)&&(identical(other.backend, backend) || other.backend == backend)&&(identical(other.apiKey, apiKey) || other.apiKey == apiKey));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,isUser,address,backend,apiKey);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'UserInfoModel(isUser: $isUser, address: $address, backend: $backend, apiKey: $apiKey)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $UserInfoModelCopyWith<$Res> {
|
||||
factory $UserInfoModelCopyWith(UserInfoModel value, $Res Function(UserInfoModel) _then) = _$UserInfoModelCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
bool? isUser, String? address, String? backend, String? apiKey
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$UserInfoModelCopyWithImpl<$Res>
|
||||
implements $UserInfoModelCopyWith<$Res> {
|
||||
_$UserInfoModelCopyWithImpl(this._self, this._then);
|
||||
|
||||
final UserInfoModel _self;
|
||||
final $Res Function(UserInfoModel) _then;
|
||||
|
||||
/// Create a copy of UserInfoModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? isUser = freezed,Object? address = freezed,Object? backend = freezed,Object? apiKey = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
isUser: freezed == isUser ? _self.isUser : isUser // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable
|
||||
as String?,backend: freezed == backend ? _self.backend : backend // ignore: cast_nullable_to_non_nullable
|
||||
as String?,apiKey: freezed == apiKey ? _self.apiKey : apiKey // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
|
||||
class _UserInfoModel implements UserInfoModel {
|
||||
const _UserInfoModel({this.isUser, this.address, this.backend, this.apiKey});
|
||||
factory _UserInfoModel.fromJson(Map<String, dynamic> json) => _$UserInfoModelFromJson(json);
|
||||
|
||||
@override final bool? isUser;
|
||||
@override final String? address;
|
||||
@override final String? backend;
|
||||
@override final String? apiKey;
|
||||
|
||||
/// Create a copy of UserInfoModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$UserInfoModelCopyWith<_UserInfoModel> get copyWith => __$UserInfoModelCopyWithImpl<_UserInfoModel>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$UserInfoModelToJson(this, );
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _UserInfoModel&&(identical(other.isUser, isUser) || other.isUser == isUser)&&(identical(other.address, address) || other.address == address)&&(identical(other.backend, backend) || other.backend == backend)&&(identical(other.apiKey, apiKey) || other.apiKey == apiKey));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,isUser,address,backend,apiKey);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'UserInfoModel(isUser: $isUser, address: $address, backend: $backend, apiKey: $apiKey)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$UserInfoModelCopyWith<$Res> implements $UserInfoModelCopyWith<$Res> {
|
||||
factory _$UserInfoModelCopyWith(_UserInfoModel value, $Res Function(_UserInfoModel) _then) = __$UserInfoModelCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
bool? isUser, String? address, String? backend, String? apiKey
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$UserInfoModelCopyWithImpl<$Res>
|
||||
implements _$UserInfoModelCopyWith<$Res> {
|
||||
__$UserInfoModelCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _UserInfoModel _self;
|
||||
final $Res Function(_UserInfoModel) _then;
|
||||
|
||||
/// Create a copy of UserInfoModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? isUser = freezed,Object? address = freezed,Object? backend = freezed,Object? apiKey = freezed,}) {
|
||||
return _then(_UserInfoModel(
|
||||
isUser: freezed == isUser ? _self.isUser : isUser // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable
|
||||
as String?,backend: freezed == backend ? _self.backend : backend // ignore: cast_nullable_to_non_nullable
|
||||
as String?,apiKey: freezed == apiKey ? _self.apiKey : apiKey // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// dart format on
|
||||
@@ -0,0 +1,23 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'user_info_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_UserInfoModel _$UserInfoModelFromJson(Map<String, dynamic> json) =>
|
||||
_UserInfoModel(
|
||||
isUser: json['is_user'] as bool?,
|
||||
address: json['address'] as String?,
|
||||
backend: json['backend'] as String?,
|
||||
apiKey: json['api_key'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$UserInfoModelToJson(_UserInfoModel instance) =>
|
||||
<String, dynamic>{
|
||||
'is_user': instance.isUser,
|
||||
'address': instance.address,
|
||||
'backend': instance.backend,
|
||||
'api_key': instance.apiKey,
|
||||
};
|
||||
@@ -0,0 +1,30 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'user_profile_model.freezed.dart';
|
||||
|
||||
part 'user_profile_model.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class UserProfileModel with _$UserProfileModel {
|
||||
const factory UserProfileModel({
|
||||
String? accessToken,
|
||||
String? expiresIn,
|
||||
String? scope,
|
||||
String? expireTime,
|
||||
String? mobile,
|
||||
String? fullname,
|
||||
String? firstname,
|
||||
String? lastname,
|
||||
String? city,
|
||||
String? province,
|
||||
String? nationalCode,
|
||||
String? nationalId,
|
||||
String? birthday,
|
||||
String? image,
|
||||
int? baseOrder,
|
||||
List<String>? role,
|
||||
}) = _UserProfileModel;
|
||||
|
||||
factory UserProfileModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$UserProfileModelFromJson(json);
|
||||
}
|
||||
@@ -0,0 +1,201 @@
|
||||
// dart format width=80
|
||||
// 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 'user_profile_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
/// @nodoc
|
||||
mixin _$UserProfileModel {
|
||||
|
||||
String? get accessToken; String? get expiresIn; String? get scope; String? get expireTime; String? get mobile; String? get fullname; String? get firstname; String? get lastname; String? get city; String? get province; String? get nationalCode; String? get nationalId; String? get birthday; String? get image; int? get baseOrder; List<String>? get role;
|
||||
/// Create a copy of UserProfileModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$UserProfileModelCopyWith<UserProfileModel> get copyWith => _$UserProfileModelCopyWithImpl<UserProfileModel>(this as UserProfileModel, _$identity);
|
||||
|
||||
/// Serializes this UserProfileModel to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is UserProfileModel&&(identical(other.accessToken, accessToken) || other.accessToken == accessToken)&&(identical(other.expiresIn, expiresIn) || other.expiresIn == expiresIn)&&(identical(other.scope, scope) || other.scope == scope)&&(identical(other.expireTime, expireTime) || other.expireTime == expireTime)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.fullname, fullname) || other.fullname == fullname)&&(identical(other.firstname, firstname) || other.firstname == firstname)&&(identical(other.lastname, lastname) || other.lastname == lastname)&&(identical(other.city, city) || other.city == city)&&(identical(other.province, province) || other.province == province)&&(identical(other.nationalCode, nationalCode) || other.nationalCode == nationalCode)&&(identical(other.nationalId, nationalId) || other.nationalId == nationalId)&&(identical(other.birthday, birthday) || other.birthday == birthday)&&(identical(other.image, image) || other.image == image)&&(identical(other.baseOrder, baseOrder) || other.baseOrder == baseOrder)&&const DeepCollectionEquality().equals(other.role, role));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,accessToken,expiresIn,scope,expireTime,mobile,fullname,firstname,lastname,city,province,nationalCode,nationalId,birthday,image,baseOrder,const DeepCollectionEquality().hash(role));
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'UserProfileModel(accessToken: $accessToken, expiresIn: $expiresIn, scope: $scope, expireTime: $expireTime, mobile: $mobile, fullname: $fullname, firstname: $firstname, lastname: $lastname, city: $city, province: $province, nationalCode: $nationalCode, nationalId: $nationalId, birthday: $birthday, image: $image, baseOrder: $baseOrder, role: $role)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $UserProfileModelCopyWith<$Res> {
|
||||
factory $UserProfileModelCopyWith(UserProfileModel value, $Res Function(UserProfileModel) _then) = _$UserProfileModelCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
String? accessToken, String? expiresIn, String? scope, String? expireTime, String? mobile, String? fullname, String? firstname, String? lastname, String? city, String? province, String? nationalCode, String? nationalId, String? birthday, String? image, int? baseOrder, List<String>? role
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$UserProfileModelCopyWithImpl<$Res>
|
||||
implements $UserProfileModelCopyWith<$Res> {
|
||||
_$UserProfileModelCopyWithImpl(this._self, this._then);
|
||||
|
||||
final UserProfileModel _self;
|
||||
final $Res Function(UserProfileModel) _then;
|
||||
|
||||
/// Create a copy of UserProfileModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? accessToken = freezed,Object? expiresIn = freezed,Object? scope = freezed,Object? expireTime = freezed,Object? mobile = freezed,Object? fullname = freezed,Object? firstname = freezed,Object? lastname = freezed,Object? city = freezed,Object? province = freezed,Object? nationalCode = freezed,Object? nationalId = freezed,Object? birthday = freezed,Object? image = freezed,Object? baseOrder = freezed,Object? role = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
accessToken: freezed == accessToken ? _self.accessToken : accessToken // ignore: cast_nullable_to_non_nullable
|
||||
as String?,expiresIn: freezed == expiresIn ? _self.expiresIn : expiresIn // ignore: cast_nullable_to_non_nullable
|
||||
as String?,scope: freezed == scope ? _self.scope : scope // ignore: cast_nullable_to_non_nullable
|
||||
as String?,expireTime: freezed == expireTime ? _self.expireTime : expireTime // ignore: cast_nullable_to_non_nullable
|
||||
as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable
|
||||
as String?,fullname: freezed == fullname ? _self.fullname : fullname // ignore: cast_nullable_to_non_nullable
|
||||
as String?,firstname: freezed == firstname ? _self.firstname : firstname // ignore: cast_nullable_to_non_nullable
|
||||
as String?,lastname: freezed == lastname ? _self.lastname : lastname // ignore: cast_nullable_to_non_nullable
|
||||
as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable
|
||||
as String?,province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable
|
||||
as String?,nationalCode: freezed == nationalCode ? _self.nationalCode : nationalCode // ignore: cast_nullable_to_non_nullable
|
||||
as String?,nationalId: freezed == nationalId ? _self.nationalId : nationalId // ignore: cast_nullable_to_non_nullable
|
||||
as String?,birthday: freezed == birthday ? _self.birthday : birthday // ignore: cast_nullable_to_non_nullable
|
||||
as String?,image: freezed == image ? _self.image : image // ignore: cast_nullable_to_non_nullable
|
||||
as String?,baseOrder: freezed == baseOrder ? _self.baseOrder : baseOrder // ignore: cast_nullable_to_non_nullable
|
||||
as int?,role: freezed == role ? _self.role : role // ignore: cast_nullable_to_non_nullable
|
||||
as List<String>?,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
|
||||
class _UserProfileModel implements UserProfileModel {
|
||||
const _UserProfileModel({this.accessToken, this.expiresIn, this.scope, this.expireTime, this.mobile, this.fullname, this.firstname, this.lastname, this.city, this.province, this.nationalCode, this.nationalId, this.birthday, this.image, this.baseOrder, final List<String>? role}): _role = role;
|
||||
factory _UserProfileModel.fromJson(Map<String, dynamic> json) => _$UserProfileModelFromJson(json);
|
||||
|
||||
@override final String? accessToken;
|
||||
@override final String? expiresIn;
|
||||
@override final String? scope;
|
||||
@override final String? expireTime;
|
||||
@override final String? mobile;
|
||||
@override final String? fullname;
|
||||
@override final String? firstname;
|
||||
@override final String? lastname;
|
||||
@override final String? city;
|
||||
@override final String? province;
|
||||
@override final String? nationalCode;
|
||||
@override final String? nationalId;
|
||||
@override final String? birthday;
|
||||
@override final String? image;
|
||||
@override final int? baseOrder;
|
||||
final List<String>? _role;
|
||||
@override List<String>? get role {
|
||||
final value = _role;
|
||||
if (value == null) return null;
|
||||
if (_role is EqualUnmodifiableListView) return _role;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(value);
|
||||
}
|
||||
|
||||
|
||||
/// Create a copy of UserProfileModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$UserProfileModelCopyWith<_UserProfileModel> get copyWith => __$UserProfileModelCopyWithImpl<_UserProfileModel>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$UserProfileModelToJson(this, );
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _UserProfileModel&&(identical(other.accessToken, accessToken) || other.accessToken == accessToken)&&(identical(other.expiresIn, expiresIn) || other.expiresIn == expiresIn)&&(identical(other.scope, scope) || other.scope == scope)&&(identical(other.expireTime, expireTime) || other.expireTime == expireTime)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.fullname, fullname) || other.fullname == fullname)&&(identical(other.firstname, firstname) || other.firstname == firstname)&&(identical(other.lastname, lastname) || other.lastname == lastname)&&(identical(other.city, city) || other.city == city)&&(identical(other.province, province) || other.province == province)&&(identical(other.nationalCode, nationalCode) || other.nationalCode == nationalCode)&&(identical(other.nationalId, nationalId) || other.nationalId == nationalId)&&(identical(other.birthday, birthday) || other.birthday == birthday)&&(identical(other.image, image) || other.image == image)&&(identical(other.baseOrder, baseOrder) || other.baseOrder == baseOrder)&&const DeepCollectionEquality().equals(other._role, _role));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,accessToken,expiresIn,scope,expireTime,mobile,fullname,firstname,lastname,city,province,nationalCode,nationalId,birthday,image,baseOrder,const DeepCollectionEquality().hash(_role));
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'UserProfileModel(accessToken: $accessToken, expiresIn: $expiresIn, scope: $scope, expireTime: $expireTime, mobile: $mobile, fullname: $fullname, firstname: $firstname, lastname: $lastname, city: $city, province: $province, nationalCode: $nationalCode, nationalId: $nationalId, birthday: $birthday, image: $image, baseOrder: $baseOrder, role: $role)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$UserProfileModelCopyWith<$Res> implements $UserProfileModelCopyWith<$Res> {
|
||||
factory _$UserProfileModelCopyWith(_UserProfileModel value, $Res Function(_UserProfileModel) _then) = __$UserProfileModelCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
String? accessToken, String? expiresIn, String? scope, String? expireTime, String? mobile, String? fullname, String? firstname, String? lastname, String? city, String? province, String? nationalCode, String? nationalId, String? birthday, String? image, int? baseOrder, List<String>? role
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$UserProfileModelCopyWithImpl<$Res>
|
||||
implements _$UserProfileModelCopyWith<$Res> {
|
||||
__$UserProfileModelCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _UserProfileModel _self;
|
||||
final $Res Function(_UserProfileModel) _then;
|
||||
|
||||
/// Create a copy of UserProfileModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? accessToken = freezed,Object? expiresIn = freezed,Object? scope = freezed,Object? expireTime = freezed,Object? mobile = freezed,Object? fullname = freezed,Object? firstname = freezed,Object? lastname = freezed,Object? city = freezed,Object? province = freezed,Object? nationalCode = freezed,Object? nationalId = freezed,Object? birthday = freezed,Object? image = freezed,Object? baseOrder = freezed,Object? role = freezed,}) {
|
||||
return _then(_UserProfileModel(
|
||||
accessToken: freezed == accessToken ? _self.accessToken : accessToken // ignore: cast_nullable_to_non_nullable
|
||||
as String?,expiresIn: freezed == expiresIn ? _self.expiresIn : expiresIn // ignore: cast_nullable_to_non_nullable
|
||||
as String?,scope: freezed == scope ? _self.scope : scope // ignore: cast_nullable_to_non_nullable
|
||||
as String?,expireTime: freezed == expireTime ? _self.expireTime : expireTime // ignore: cast_nullable_to_non_nullable
|
||||
as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable
|
||||
as String?,fullname: freezed == fullname ? _self.fullname : fullname // ignore: cast_nullable_to_non_nullable
|
||||
as String?,firstname: freezed == firstname ? _self.firstname : firstname // ignore: cast_nullable_to_non_nullable
|
||||
as String?,lastname: freezed == lastname ? _self.lastname : lastname // ignore: cast_nullable_to_non_nullable
|
||||
as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable
|
||||
as String?,province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable
|
||||
as String?,nationalCode: freezed == nationalCode ? _self.nationalCode : nationalCode // ignore: cast_nullable_to_non_nullable
|
||||
as String?,nationalId: freezed == nationalId ? _self.nationalId : nationalId // ignore: cast_nullable_to_non_nullable
|
||||
as String?,birthday: freezed == birthday ? _self.birthday : birthday // ignore: cast_nullable_to_non_nullable
|
||||
as String?,image: freezed == image ? _self.image : image // ignore: cast_nullable_to_non_nullable
|
||||
as String?,baseOrder: freezed == baseOrder ? _self.baseOrder : baseOrder // ignore: cast_nullable_to_non_nullable
|
||||
as int?,role: freezed == role ? _self._role : role // ignore: cast_nullable_to_non_nullable
|
||||
as List<String>?,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// dart format on
|
||||
@@ -0,0 +1,47 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'user_profile_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_UserProfileModel _$UserProfileModelFromJson(Map<String, dynamic> json) =>
|
||||
_UserProfileModel(
|
||||
accessToken: json['access_token'] as String?,
|
||||
expiresIn: json['expires_in'] as String?,
|
||||
scope: json['scope'] as String?,
|
||||
expireTime: json['expire_time'] as String?,
|
||||
mobile: json['mobile'] as String?,
|
||||
fullname: json['fullname'] as String?,
|
||||
firstname: json['firstname'] as String?,
|
||||
lastname: json['lastname'] as String?,
|
||||
city: json['city'] as String?,
|
||||
province: json['province'] as String?,
|
||||
nationalCode: json['national_code'] as String?,
|
||||
nationalId: json['national_id'] as String?,
|
||||
birthday: json['birthday'] as String?,
|
||||
image: json['image'] as String?,
|
||||
baseOrder: (json['base_order'] as num?)?.toInt(),
|
||||
role: (json['role'] as List<dynamic>?)?.map((e) => e as String).toList(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$UserProfileModelToJson(_UserProfileModel instance) =>
|
||||
<String, dynamic>{
|
||||
'access_token': instance.accessToken,
|
||||
'expires_in': instance.expiresIn,
|
||||
'scope': instance.scope,
|
||||
'expire_time': instance.expireTime,
|
||||
'mobile': instance.mobile,
|
||||
'fullname': instance.fullname,
|
||||
'firstname': instance.firstname,
|
||||
'lastname': instance.lastname,
|
||||
'city': instance.city,
|
||||
'province': instance.province,
|
||||
'national_code': instance.nationalCode,
|
||||
'national_id': instance.nationalId,
|
||||
'birthday': instance.birthday,
|
||||
'image': instance.image,
|
||||
'base_order': instance.baseOrder,
|
||||
'role': instance.role,
|
||||
};
|
||||
@@ -1,12 +1,11 @@
|
||||
|
||||
import 'package:rasadyar_auth/data/models/response/user_info/user_info_model.dart';
|
||||
|
||||
import '../models/response/auth/auth_response_model.dart';
|
||||
import '../models/response/captcha/captcha_response_model.dart';
|
||||
import '../models/response/user_profile_model/user_profile_model.dart';
|
||||
|
||||
abstract class AuthRepository {
|
||||
Future<AuthResponseModel?> login({
|
||||
required Map<String, dynamic> authRequest,
|
||||
});
|
||||
Future<UserProfileModel?> login({required Map<String, dynamic> authRequest});
|
||||
|
||||
Future<CaptchaResponseModel?> captcha();
|
||||
|
||||
@@ -14,10 +13,9 @@ abstract class AuthRepository {
|
||||
|
||||
Future<bool> hasAuthenticated();
|
||||
|
||||
|
||||
Future<AuthResponseModel?> loginWithRefreshToken({
|
||||
required Map<String, dynamic> authRequest,
|
||||
});
|
||||
|
||||
|
||||
Future<UserInfoModel?> getUserInfo(String phoneNumber);
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import 'package:rasadyar_auth/data/models/response/user_info/user_info_model.dart';
|
||||
import 'package:rasadyar_auth/data/models/response/user_profile_model/user_profile_model.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
import '../models/response/auth/auth_response_model.dart';
|
||||
@@ -11,13 +13,13 @@ class AuthRepositoryImpl implements AuthRepository {
|
||||
AuthRepositoryImpl(this._httpClient);
|
||||
|
||||
@override
|
||||
Future<AuthResponseModel?> login({
|
||||
Future<UserProfileModel?> login({
|
||||
required Map<String, dynamic> authRequest,
|
||||
}) async {
|
||||
var res = await _httpClient.post<AuthResponseModel>(
|
||||
'$_BASE_URL/login/',
|
||||
var res = await _httpClient.post<UserProfileModel?>(
|
||||
'/api/login/',
|
||||
data: authRequest,
|
||||
fromJson: AuthResponseModel.fromJson,
|
||||
fromJson: UserProfileModel.fromJson,
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
);
|
||||
return res.data;
|
||||
@@ -59,4 +61,19 @@ class AuthRepositoryImpl implements AuthRepository {
|
||||
|
||||
return response.data ?? false;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<UserInfoModel?> getUserInfo(String phoneNumber) async {
|
||||
var res = await _httpClient.post<UserInfoModel?>(
|
||||
'https://userbackend.rasadyaar.ir/api/send_otp/',
|
||||
data: {
|
||||
"mobile": phoneNumber,
|
||||
"state": ""
|
||||
},
|
||||
fromJson: UserInfoModel.fromJson,
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
);
|
||||
return res.data;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_auth/data/di/auth_di.dart';
|
||||
import 'package:rasadyar_auth/data/models/local/user_local/user_local_model.dart';
|
||||
import 'package:rasadyar_auth/data/services/token_storage_service.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
@@ -14,7 +14,7 @@ class AuthMiddleware extends GetMiddleware {
|
||||
final accessToken = tokenService.accessToken.value;
|
||||
|
||||
if (refreshToken == null || accessToken == null) {
|
||||
return RouteSettings(name: AuthPaths.moduleList);
|
||||
return RouteSettings(name: AuthPaths.auth, arguments: Module.chicken);
|
||||
}
|
||||
return super.redirect(route);
|
||||
}
|
||||
|
||||
@@ -5,9 +5,12 @@ import 'package:rasadyar_auth/hive_registrar.g.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
class TokenStorageService extends GetxService {
|
||||
static const String _boxName = 'secureBox';
|
||||
static const String _tokenBoxName = 'TokenBox';
|
||||
static const String _appBoxName = 'AppBox';
|
||||
static const String _accessTokenKey = 'accessToken';
|
||||
static const String _refreshTokenKey = 'refreshToken';
|
||||
static const String _baseUrlKey = 'baseUrl';
|
||||
static const String _apiKey = 'apiKey';
|
||||
static const String _moduleKey = 'moduleSelected';
|
||||
|
||||
final FlutterSecureStorage _secureStorage = FlutterSecureStorage();
|
||||
@@ -15,6 +18,7 @@ class TokenStorageService extends GetxService {
|
||||
|
||||
RxnString accessToken = RxnString();
|
||||
RxnString refreshToken = RxnString();
|
||||
RxnString baseurl = RxnString();
|
||||
Rxn<Module> appModule = Rxn(null);
|
||||
|
||||
Future<void> init() async {
|
||||
@@ -22,41 +26,61 @@ class TokenStorageService extends GetxService {
|
||||
Hive.registerAdapters();
|
||||
|
||||
final String? encryptedKey = await _secureStorage.read(key: 'hive_enc_key');
|
||||
final encryptionKey = encryptedKey != null ? base64Url.decode(encryptedKey) : Hive.generateSecureKey();
|
||||
final encryptionKey = encryptedKey != null
|
||||
? base64Url.decode(encryptedKey)
|
||||
: Hive.generateSecureKey();
|
||||
|
||||
if (encryptedKey == null) {
|
||||
await _secureStorage.write(key: 'hive_enc_key', value: base64UrlEncode(encryptionKey));
|
||||
}
|
||||
|
||||
await _localStorage.init();
|
||||
await _localStorage.openBox(_boxName, encryptionCipher: HiveAesCipher(encryptionKey));
|
||||
await _localStorage.openBox(_tokenBoxName, encryptionCipher: HiveAesCipher(encryptionKey));
|
||||
await _localStorage.openBox(_appBoxName);
|
||||
|
||||
accessToken.value = _localStorage.read<String?>(boxName: _boxName, key: _accessTokenKey);
|
||||
refreshToken.value = _localStorage.read<String?>(boxName: _boxName, key: _refreshTokenKey);
|
||||
appModule.value = _localStorage.read<Module?>(boxName: _boxName, key: _moduleKey);
|
||||
accessToken.value = _localStorage.read<String?>(boxName: _tokenBoxName, key: _accessTokenKey);
|
||||
refreshToken.value = _localStorage.read<String?>(boxName: _tokenBoxName, key: _refreshTokenKey);
|
||||
appModule.value = _localStorage.read<Module?>(boxName: _appBoxName, key: _moduleKey);
|
||||
baseurl.value = _localStorage.read<String?>(boxName: _appBoxName, key: _baseUrlKey);
|
||||
}
|
||||
|
||||
Future<void> saveAccessToken(String token) async {
|
||||
await _localStorage.save(boxName: _boxName, key: _accessTokenKey, value: token);
|
||||
await _localStorage.save(boxName: _tokenBoxName, key: _accessTokenKey, value: token);
|
||||
accessToken.value = token;
|
||||
accessToken.refresh();
|
||||
}
|
||||
|
||||
Future<void> saveRefreshToken(String token) async {
|
||||
await _localStorage.save(boxName: _boxName, key: _refreshTokenKey, value: token);
|
||||
await _localStorage.save(boxName: _tokenBoxName, key: _refreshTokenKey, value: token);
|
||||
refreshToken.value = token;
|
||||
refreshToken.refresh();
|
||||
}
|
||||
|
||||
Future<void> saveModule(Module input) async {
|
||||
await _localStorage.save(boxName: _boxName, key: _moduleKey, value: input);
|
||||
await _localStorage.save(boxName: _tokenBoxName, key: _moduleKey, value: input);
|
||||
appModule.value = input;
|
||||
appModule.refresh();
|
||||
}
|
||||
|
||||
Future<void> deleteTokens() async {
|
||||
await _localStorage.clear(_boxName);
|
||||
await _localStorage.clear(_tokenBoxName);
|
||||
accessToken.value = null;
|
||||
refreshToken.value = null;
|
||||
}
|
||||
|
||||
Future<void> saveBaseUrl(String url) async {
|
||||
await _localStorage.save(boxName: _appBoxName, key: _baseUrlKey, value: url);
|
||||
baseurl.value = url;
|
||||
baseurl.refresh();
|
||||
}
|
||||
|
||||
void getBaseUrl() {
|
||||
var url = _localStorage.read(boxName: _appBoxName, key: _baseUrlKey);
|
||||
baseurl.value = url;
|
||||
baseurl.refresh();
|
||||
}
|
||||
|
||||
Future<void> saveApiKey(String key) async {
|
||||
await _localStorage.save(boxName: _tokenBoxName, key: _apiKey, value: key);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,12 +1,6 @@
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:rasadyar_auth/auth.dart';
|
||||
import 'package:rasadyar_auth/data/repositories/auth_repository_imp.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
import '../models/response/auth/auth_response_model.dart';
|
||||
import '../services/token_storage_service.dart';
|
||||
|
||||
Future<void> safeCall<T>({
|
||||
Future<T?> safeCall<T>({
|
||||
required AppAsyncCallback<T> call,
|
||||
Function(T result)? onSuccess,
|
||||
ErrorCallback? onError,
|
||||
@@ -18,13 +12,8 @@ Future<void> safeCall<T>({
|
||||
bool showSnackBar = false,
|
||||
Function()? onShowLoading,
|
||||
Function()? onHideLoading,
|
||||
Function()? onShowSuccessMessage,
|
||||
Function()? onShowErrorMessage,
|
||||
}) {
|
||||
final authRepository = diAuth.get<AuthRepositoryImpl>();
|
||||
TokenStorageService tokenStorageService = Get.find<TokenStorageService>();
|
||||
|
||||
return gSafeCall(
|
||||
return gSafeCall<T>(
|
||||
call: call,
|
||||
onSuccess: onSuccess,
|
||||
onError: onError,
|
||||
@@ -32,30 +21,7 @@ Future<void> safeCall<T>({
|
||||
showLoading: showLoading,
|
||||
showError: showError,
|
||||
showSuccess: showSuccess,
|
||||
showToast: showToast,
|
||||
showSnackBar: showSnackBar,
|
||||
onShowLoading: onShowLoading,
|
||||
onHideLoading: onHideLoading,
|
||||
onShowSuccessMessage: onShowSuccessMessage,
|
||||
onShowErrorMessage: onShowErrorMessage,
|
||||
retryOnAuthError: true,
|
||||
onTokenRefresh: () {
|
||||
var token = tokenStorageService.refreshToken.value;
|
||||
authRepository
|
||||
.loginWithRefreshToken(authRequest: {"refresh_token": token})
|
||||
.then((value) async {
|
||||
if (value is AuthResponseModel) {
|
||||
await tokenStorageService.saveAccessToken(value.access!);
|
||||
} else {
|
||||
throw Exception("Failed to refresh token");
|
||||
}
|
||||
})
|
||||
.catchError((error) {
|
||||
if (kDebugMode) {
|
||||
print('Error during token refresh: $error');
|
||||
}
|
||||
throw error;
|
||||
});
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -7,9 +7,8 @@ import 'package:rasadyar_auth/data/models/local/user_local/user_local_model.dart
|
||||
|
||||
extension HiveRegistrar on HiveInterface {
|
||||
void registerAdapters() {
|
||||
registerAdapter(UserLocalModelAdapter());
|
||||
registerAdapter(ModuleAdapter());
|
||||
|
||||
registerAdapter(UserLocalModelAdapter());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -4,7 +4,8 @@ import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_auth/auth.dart';
|
||||
import 'package:rasadyar_auth/data/common/dio_error_handler.dart';
|
||||
import 'package:rasadyar_auth/data/models/request/login_request/login_request_model.dart';
|
||||
import 'package:rasadyar_auth/data/models/response/auth/auth_response_model.dart';
|
||||
import 'package:rasadyar_auth/data/models/response/user_info/user_info_model.dart';
|
||||
import 'package:rasadyar_auth/data/models/response/user_profile_model/user_profile_model.dart';
|
||||
import 'package:rasadyar_auth/data/repositories/auth_repository_imp.dart';
|
||||
import 'package:rasadyar_auth/data/services/token_storage_service.dart';
|
||||
import 'package:rasadyar_auth/data/utils/safe_call.dart';
|
||||
@@ -26,14 +27,14 @@ class AuthLogic extends GetxController {
|
||||
Rx<GlobalKey<FormState>> formKeySentOtp = GlobalKey<FormState>().obs;
|
||||
Rx<TextEditingController> usernameController = TextEditingController().obs;
|
||||
Rx<TextEditingController> passwordController = TextEditingController().obs;
|
||||
Rx<TextEditingController> phoneOtpNumberController =
|
||||
TextEditingController().obs;
|
||||
Rx<TextEditingController> phoneOtpNumberController = TextEditingController().obs;
|
||||
Rx<TextEditingController> otpCodeController = TextEditingController().obs;
|
||||
|
||||
var captchaController = Get.find<CaptchaWidgetLogic>();
|
||||
|
||||
RxnString phoneNumber = RxnString(null);
|
||||
RxBool isLoading = false.obs;
|
||||
RxBool isDisabled = true.obs;
|
||||
TokenStorageService tokenStorageService = Get.find<TokenStorageService>();
|
||||
|
||||
Rx<AuthType> authType = AuthType.useAndPass.obs;
|
||||
@@ -70,15 +71,11 @@ class AuthLogic extends GetxController {
|
||||
return '${minutes.toString().padLeft(2, '0')}:${seconds.toString().padLeft(2, '0')}';
|
||||
}
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
}
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
super.onReady();
|
||||
iLog('module111 : ${_module.toString()}');
|
||||
iLog('module selected : ${_module.toString()}');
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -88,8 +85,7 @@ class AuthLogic extends GetxController {
|
||||
}
|
||||
|
||||
bool _isFormValid() {
|
||||
final isCaptchaValid =
|
||||
captchaController.formKey.currentState?.validate() ?? false;
|
||||
final isCaptchaValid = captchaController.formKey.currentState?.validate() ?? false;
|
||||
final isFormValid = formKey.currentState?.validate() ?? false;
|
||||
return isCaptchaValid && isFormValid;
|
||||
}
|
||||
@@ -108,7 +104,7 @@ class AuthLogic extends GetxController {
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> submitLoginForm() async {
|
||||
/*Future<void> submitLoginForm() async {
|
||||
if (!_isFormValid()) return;
|
||||
iLog('module222 : ${_module.toString()}');
|
||||
final loginRequestModel = _buildLoginRequest();
|
||||
@@ -128,5 +124,52 @@ class AuthLogic extends GetxController {
|
||||
},
|
||||
);
|
||||
isLoading.value = false;
|
||||
}*/
|
||||
|
||||
Future<void> submitLoginForm2() async {
|
||||
if (!_isFormValid()) return;
|
||||
AuthRepositoryImpl authTmp = diAuth.get<AuthRepositoryImpl>(instanceName: 'newUrl');
|
||||
isLoading.value = true;
|
||||
await safeCall<UserProfileModel?>(
|
||||
call: () => authTmp.login(
|
||||
authRequest: {
|
||||
"username": phoneNumberController.value.text,
|
||||
"password": passwordController.value.text,
|
||||
},
|
||||
),
|
||||
onSuccess: (result) async {
|
||||
await tokenStorageService.saveModule(_module);
|
||||
await tokenStorageService.saveAccessToken(result?.accessToken ?? '');
|
||||
await tokenStorageService.saveRefreshToken(result?.accessToken ?? '');
|
||||
},
|
||||
onError: (error, stackTrace) {
|
||||
if (error is DioException) {
|
||||
diAuth.get<DioErrorHandler>().handle(error);
|
||||
}
|
||||
captchaController.getCaptcha();
|
||||
},
|
||||
);
|
||||
isLoading.value = false;
|
||||
}
|
||||
|
||||
Future<void> getUserInfo(String value) async {
|
||||
isLoading.value = true;
|
||||
await safeCall<UserInfoModel?>(
|
||||
call: () async => await authRepository.getUserInfo(value),
|
||||
onSuccess: (result) async {
|
||||
if (result != null) {
|
||||
await newSetupAuthDI(result.backend ?? '');
|
||||
await tokenStorageService.saveApiKey(result.apiKey ?? '');
|
||||
await tokenStorageService.saveBaseUrl(result.backend ?? '');
|
||||
}
|
||||
},
|
||||
onError: (error, stackTrace) {
|
||||
if (error is DioException) {
|
||||
diAuth.get<DioErrorHandler>().handle(error);
|
||||
}
|
||||
captchaController.getCaptcha();
|
||||
},
|
||||
);
|
||||
isLoading.value = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,28 +27,31 @@ class AuthPage extends GetView<AuthLogic> {
|
||||
}
|
||||
}, controller.authType),
|
||||
|
||||
SizedBox(height: 50),
|
||||
SizedBox(height: 20),
|
||||
RichText(
|
||||
text: TextSpan(
|
||||
children: [
|
||||
TextSpan(
|
||||
text: 'مطالعه بیانیه ',
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDark,
|
||||
),
|
||||
style: AppFonts.yekan16.copyWith(color: AppColor.darkGreyDark),
|
||||
),
|
||||
TextSpan(
|
||||
recognizer: TapGestureRecognizer()
|
||||
..onTap = () {},
|
||||
..onTap = () {
|
||||
Get.bottomSheet(
|
||||
privacyPolicyWidget(),
|
||||
isScrollControlled: true,
|
||||
enableDrag: true,
|
||||
ignoreSafeArea: false,
|
||||
);
|
||||
},
|
||||
text: 'حریم خصوصی',
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
style: AppFonts.yekan16.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(height: 18),
|
||||
/* SizedBox(height: 18),
|
||||
|
||||
ObxValue((types) {
|
||||
return RichText(
|
||||
@@ -80,7 +83,7 @@ class AuthPage extends GetView<AuthLogic> {
|
||||
],
|
||||
),
|
||||
);
|
||||
}, controller.authType),
|
||||
}, controller.authType),*/
|
||||
],
|
||||
),
|
||||
),
|
||||
@@ -92,120 +95,201 @@ class AuthPage extends GetView<AuthLogic> {
|
||||
padding: EdgeInsets.symmetric(horizontal: 30, vertical: 50),
|
||||
child: Form(
|
||||
key: controller.formKey,
|
||||
child: Column(
|
||||
children: [
|
||||
ObxValue(
|
||||
(phoneController) =>
|
||||
RTextField(
|
||||
label: 'نام کاربری',
|
||||
maxLength: 11,
|
||||
maxLines: 1,
|
||||
controller: phoneController.value,
|
||||
keyboardType: TextInputType.text,
|
||||
initText: phoneController.value.text,
|
||||
onChanged: (value) {
|
||||
phoneController.value.text = value;
|
||||
phoneController.refresh();
|
||||
},
|
||||
prefixIcon: Padding(
|
||||
padding: const EdgeInsets.fromLTRB(0, 8, 6, 8),
|
||||
child: Assets.vec.callSvg.svg(
|
||||
width: 12,
|
||||
height: 12,
|
||||
),
|
||||
),
|
||||
suffixIcon:
|
||||
phoneController.value.text
|
||||
.trim()
|
||||
.isNotEmpty
|
||||
? clearButton(() {
|
||||
phoneController.value.clear();
|
||||
phoneController.refresh();
|
||||
})
|
||||
: null,
|
||||
validator: (value) {
|
||||
if (value == null || value.isEmpty) {
|
||||
return '⚠️ شماره موبایل را وارد کنید';
|
||||
}
|
||||
/*else if (value.length < 11) {
|
||||
return '⚠️ شماره موبایل باید 11 رقم باشد';
|
||||
}*/
|
||||
return null;
|
||||
},
|
||||
style: AppFonts.yekan13,
|
||||
errorStyle: AppFonts.yekan13.copyWith(
|
||||
color: AppColor.redNormal,
|
||||
),
|
||||
labelStyle: AppFonts.yekan13,
|
||||
boxConstraints: const BoxConstraints(
|
||||
maxHeight: 40,
|
||||
minHeight: 40,
|
||||
maxWidth: 40,
|
||||
minWidth: 40,
|
||||
),
|
||||
),
|
||||
controller.usernameController,
|
||||
),
|
||||
const SizedBox(height: 26),
|
||||
ObxValue(
|
||||
(passwordController) =>
|
||||
RTextField(
|
||||
label: 'رمز عبور',
|
||||
filled: false,
|
||||
controller: passwordController.value,
|
||||
variant: RTextFieldVariant.password,
|
||||
initText: passwordController.value.text,
|
||||
onChanged: (value) {
|
||||
passwordController.refresh();
|
||||
},
|
||||
validator: (value) {
|
||||
if (value == null || value.isEmpty) {
|
||||
return '⚠️ رمز عبور را وارد کنید';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
style: AppFonts.yekan13,
|
||||
errorStyle: AppFonts.yekan13.copyWith(
|
||||
color: AppColor.redNormal,
|
||||
),
|
||||
labelStyle: AppFonts.yekan13,
|
||||
prefixIcon: Padding(
|
||||
padding: const EdgeInsets.fromLTRB(0, 8, 8, 8),
|
||||
child: Assets.vec.keySvg.svg(
|
||||
width: 12,
|
||||
height: 12,
|
||||
),
|
||||
),
|
||||
boxConstraints: const BoxConstraints(
|
||||
maxHeight: 34,
|
||||
minHeight: 34,
|
||||
maxWidth: 34,
|
||||
minWidth: 34,
|
||||
),
|
||||
),
|
||||
controller.passwordController,
|
||||
),
|
||||
SizedBox(height: 26),
|
||||
CaptchaWidget(),
|
||||
SizedBox(height: 23),
|
||||
ObxValue((data) {
|
||||
return RElevated(
|
||||
text: 'ورود',
|
||||
isLoading: data.value,
|
||||
onPressed: () async {
|
||||
await controller.submitLoginForm();
|
||||
child: AutofillGroup(
|
||||
child: Column(
|
||||
children: [
|
||||
RTextField(
|
||||
label: 'نام کاربری',
|
||||
maxLength: 11,
|
||||
maxLines: 1,
|
||||
controller: controller.phoneNumberController.value,
|
||||
keyboardType: TextInputType.number,
|
||||
initText: controller.phoneNumberController.value.text,
|
||||
autofillHints: [AutofillHints.username],
|
||||
onChanged: (value) async {
|
||||
controller.phoneNumberController.value.text = value;
|
||||
controller.phoneNumberController.refresh();
|
||||
if (value.length == 11) {
|
||||
await controller.getUserInfo(value);
|
||||
}
|
||||
},
|
||||
width: Get.width,
|
||||
height: 48,
|
||||
);
|
||||
}, controller.isLoading),
|
||||
],
|
||||
prefixIcon: Padding(
|
||||
padding: const EdgeInsets.fromLTRB(0, 8, 6, 8),
|
||||
child: Assets.vec.callSvg.svg(width: 12, height: 12),
|
||||
),
|
||||
suffixIcon: controller.phoneNumberController.value.text.trim().isNotEmpty
|
||||
? clearButton(() {
|
||||
controller.phoneNumberController.value.clear();
|
||||
controller.phoneNumberController.refresh();
|
||||
})
|
||||
: null,
|
||||
validator: (value) {
|
||||
if (value == null || value.isEmpty) {
|
||||
return '⚠️ شماره موبایل را وارد کنید';
|
||||
} else if (value.length < 11) {
|
||||
return '⚠️ شماره موبایل باید 11 رقم باشد';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
style: AppFonts.yekan13,
|
||||
errorStyle: AppFonts.yekan13.copyWith(color: AppColor.redNormal),
|
||||
labelStyle: AppFonts.yekan13,
|
||||
boxConstraints: const BoxConstraints(
|
||||
maxHeight: 40,
|
||||
minHeight: 40,
|
||||
maxWidth: 40,
|
||||
minWidth: 40,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 26),
|
||||
ObxValue(
|
||||
(passwordController) => RTextField(
|
||||
label: 'رمز عبور',
|
||||
filled: false,
|
||||
obscure: true,
|
||||
controller: passwordController.value,
|
||||
autofillHints: [AutofillHints.password],
|
||||
variant: RTextFieldVariant.password,
|
||||
initText: passwordController.value.text,
|
||||
onChanged: (value) {
|
||||
passwordController.refresh();
|
||||
},
|
||||
validator: (value) {
|
||||
if (value == null || value.isEmpty) {
|
||||
return '⚠️ رمز عبور را وارد کنید';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
style: AppFonts.yekan13,
|
||||
errorStyle: AppFonts.yekan13.copyWith(color: AppColor.redNormal),
|
||||
labelStyle: AppFonts.yekan13,
|
||||
prefixIcon: Padding(
|
||||
padding: const EdgeInsets.fromLTRB(0, 8, 8, 8),
|
||||
child: Assets.vec.keySvg.svg(width: 12, height: 12),
|
||||
),
|
||||
boxConstraints: const BoxConstraints(
|
||||
maxHeight: 34,
|
||||
minHeight: 34,
|
||||
maxWidth: 34,
|
||||
minWidth: 34,
|
||||
),
|
||||
),
|
||||
controller.passwordController,
|
||||
),
|
||||
SizedBox(height: 26),
|
||||
CaptchaWidget(),
|
||||
SizedBox(height: 23),
|
||||
|
||||
Obx(() {
|
||||
return RElevated(
|
||||
text: 'ورود',
|
||||
isLoading: controller.isLoading.value,
|
||||
onPressed: controller.isDisabled.value
|
||||
? null
|
||||
: () async {
|
||||
await controller.submitLoginForm2();
|
||||
},
|
||||
width: Get.width,
|
||||
height: 48,
|
||||
);
|
||||
}),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/*
|
||||
Widget privacyPolicyWidget() {
|
||||
return BaseBottomSheet(
|
||||
child: Column(
|
||||
spacing: 5,
|
||||
children: [
|
||||
Container(
|
||||
padding: EdgeInsets.all(8.w),
|
||||
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(color: AppColor.darkGreyLight, width: 1),
|
||||
),
|
||||
child: Column(
|
||||
spacing: 3,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'بيانيه حريم خصوصی',
|
||||
style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
Text(
|
||||
'اطلاعات مربوط به هر شخص، حریم خصوصی وی محسوب میشود. حفاظت و حراست از اطلاعات شخصی در سامانه رصد یار، نه تنها موجب حفظ امنیت کاربران میشود، بلکه باعث اعتماد بیشتر و مشارکت آنها در فعالیتهای جاری میگردد. هدف از این بیانیه، آگاه ساختن شما درباره ی نوع و نحوه ی استفاده از اطلاعاتی است که در هنگام استفاده از سامانه رصد یار ، از جانب شما دریافت میگردد. شرکت هوشمند سازان خود را ملزم به رعایت حریم خصوصی همه شهروندان و کاربران سامانه دانسته و آن دسته از اطلاعات کاربران را که فقط به منظور ارائه خدمات کفایت میکند، دریافت کرده و از انتشار آن یا در اختیار قرار دادن آن به دیگران خودداری مینماید.',
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.bgDark, height: 1.8),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
padding: EdgeInsets.all(8.w),
|
||||
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(color: AppColor.darkGreyLight, width: 1),
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
spacing: 4,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'چگونگی جمع آوری و استفاده از اطلاعات کاربران',
|
||||
style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
Text(
|
||||
'''الف: اطلاعاتی که شما خود در اختيار این سامانه قرار میدهيد، شامل موارد زيرهستند:
|
||||
اقلام اطلاعاتی شامل شماره تلفن همراه، تاریخ تولد، کد پستی و کد ملی کاربران را دریافت مینماییم که از این اقلام، صرفا جهت احراز هویت کاربران استفاده خواهد شد.
|
||||
ب: برخی اطلاعات ديگر که به صورت خودکار از شما دريافت میشود شامل موارد زير میباشد:
|
||||
⦁ دستگاهی که از طریق آن سامانه رصد یار را مشاهده مینمایید( تلفن همراه، تبلت، رایانه).
|
||||
⦁ نام و نسخه سیستم عامل و browser کامپیوتر شما.
|
||||
⦁ اطلاعات صفحات بازدید شده.
|
||||
⦁ تعداد بازدیدهای روزانه در درگاه.
|
||||
⦁ هدف ما از دریافت این اطلاعات استفاده از آنها در تحلیل عملکرد کاربران درگاه می باشد تا بتوانیم در خدمت رسانی بهتر عمل کنیم.
|
||||
''',
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.bgDark, height: 1.8),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
padding: EdgeInsets.all(8.w),
|
||||
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(color: AppColor.darkGreyLight, width: 1),
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
spacing: 4,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'امنیت اطلاعات',
|
||||
style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
Text(
|
||||
'متعهدیم که امنیت اطلاعات شما را تضمین نماییم و برای جلوگیری از هر نوع دسترسی غیرمجاز و افشای اطلاعات شما از همه شیوههای لازم استفاده میکنیم تا امنیت اطلاعاتی را که به صورت آنلاین گردآوری میکنیم، حفظ شود. لازم به ذکر است در سامانه ما، ممکن است به سایت های دیگری لینک شوید، وقتی که شما از طریق این لینکها از سامانه ما خارج میشوید، توجه داشته باشید که ما بر دیگر سایت ها کنترل نداریم و سازمان تعهدی بر حفظ حریم شخصی آنان در سایت مقصد نخواهد داشت و مراجعه کنندگان میبایست به بیانیه حریم شخصی آن سایت ها مراجعه نمایند.',
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.bgDark, height: 1.8),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/*
|
||||
Widget sendCodeForm() {
|
||||
return ObxValue((data) {
|
||||
return Form(
|
||||
|
||||
@@ -7,6 +7,7 @@ class ModulesLogic extends GetxController {
|
||||
List<ModuleModel> moduleList=[
|
||||
ModuleModel(title: 'بازرسی', icon: Assets.icons.inspection.path, module: Module.inspection),
|
||||
ModuleModel(title: 'دام', icon: Assets.icons.liveStock.path, module: Module.liveStocks),
|
||||
ModuleModel(title: 'مرغ', icon: Assets.icons.liveStock.path, module: Module.chicken),
|
||||
];
|
||||
|
||||
|
||||
|
||||
@@ -1,15 +1,17 @@
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_auth/data/di/auth_di.dart';
|
||||
import 'package:rasadyar_auth/data/models/response/captcha/captcha_response_model.dart';
|
||||
import 'package:rasadyar_auth/data/repositories/auth_repository_imp.dart';
|
||||
import 'package:rasadyar_auth/data/utils/safe_call.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
class CaptchaWidgetLogic extends GetxController with StateMixin<CaptchaResponseModel> {
|
||||
Rx<TextEditingController> textController = TextEditingController().obs;
|
||||
TextEditingController textController = TextEditingController();
|
||||
RxnString captchaKey = RxnString();
|
||||
GlobalKey<FormState> formKey = GlobalKey<FormState>();
|
||||
AuthRepositoryImpl authRepository = diAuth.get<AuthRepositoryImpl>();
|
||||
final Random random = Random();
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
@@ -20,22 +22,17 @@ class CaptchaWidgetLogic extends GetxController with StateMixin<CaptchaResponseM
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
textController.value.dispose();
|
||||
textController.clear();
|
||||
textController.dispose();
|
||||
super.onClose();
|
||||
}
|
||||
|
||||
Future<void> getCaptcha() async {
|
||||
change(null, status: RxStatus.loading());
|
||||
textController.value.clear();
|
||||
safeCall(
|
||||
call: () async => await authRepository.captcha(),
|
||||
onSuccess: (value) {
|
||||
captchaKey.value = value?.captchaKey;
|
||||
change(value, status: RxStatus.success());
|
||||
},
|
||||
onError: (error, stackTrace) {
|
||||
change(null, status: RxStatus.error(error.toString()));
|
||||
},
|
||||
);
|
||||
textController.clear();
|
||||
await Future.delayed(Duration(milliseconds: 800));
|
||||
captchaKey.value = (random.nextInt(900000)+100000).toString();
|
||||
change(value, status: RxStatus.success());
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import 'dart:convert';
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_auth/presentation/pages/auth/logic.dart';
|
||||
import 'package:rasadyar_auth/presentation/widget/clear_button.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
@@ -16,73 +17,93 @@ class CaptchaWidget extends GetView<CaptchaWidgetLogic> {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: controller.getCaptcha,
|
||||
child: Container(
|
||||
width: 135,
|
||||
height: 50,
|
||||
clipBehavior: Clip.antiAliasWithSaveLayer,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.whiteNormalHover,
|
||||
border: Border.all(color: Colors.grey.shade300),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: controller.obx(
|
||||
(state) =>
|
||||
Image.memory(
|
||||
base64Decode(state?.captchaImage ?? ''),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
onLoading: const Center(
|
||||
child: CupertinoActivityIndicator(color: AppColor.blueNormal),
|
||||
onTap: controller.getCaptcha,
|
||||
child: Container(
|
||||
width: 135,
|
||||
height: 50,
|
||||
clipBehavior: Clip.antiAliasWithSaveLayer,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.whiteNormalHover,
|
||||
border: Border.all(color: Colors.grey.shade300),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: controller.obx(
|
||||
(state) => Center(
|
||||
child: Text(
|
||||
controller.captchaKey.value ?? 'دوباره سعی کنید',
|
||||
style: AppFonts.yekan24Bold,
|
||||
),
|
||||
onError: (error) {
|
||||
return const Center(
|
||||
child: Text(
|
||||
'خطا در بارگذاری کد امنیتی',
|
||||
style: AppFonts.yekan13,
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
)),
|
||||
onLoading: const Center(
|
||||
child: CupertinoActivityIndicator(color: AppColor.blueNormal),
|
||||
),
|
||||
onError: (error) {
|
||||
return Center(
|
||||
child: Text('خطا ', style: AppFonts.yekan13.copyWith(color: Colors.red)),
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
const SizedBox(width: 8),
|
||||
Expanded(
|
||||
child: Form(
|
||||
key: controller.formKey,
|
||||
autovalidateMode: AutovalidateMode.disabled,
|
||||
child: ObxValue((data) {
|
||||
return RTextField(
|
||||
label: 'کد امنیتی',
|
||||
controller: data.value,
|
||||
keyboardType: TextInputType.numberWithOptions(
|
||||
decimal: false,
|
||||
signed: false,
|
||||
),
|
||||
maxLines: 1,
|
||||
maxLength: 6,
|
||||
suffixIcon:
|
||||
(data.value.text
|
||||
.trim()
|
||||
.isNotEmpty ?? false)
|
||||
? clearButton(
|
||||
() => controller.textController.value.clear(),
|
||||
)
|
||||
: null,
|
||||
child: RTextField(
|
||||
label: 'کد امنیتی',
|
||||
controller: controller.textController,
|
||||
keyboardType: TextInputType.numberWithOptions(decimal: false, signed: false),
|
||||
maxLines: 1,
|
||||
maxLength: 6,
|
||||
suffixIcon: (controller.textController.text.trim().isNotEmpty ?? false)
|
||||
? clearButton(() => controller.textController.clear())
|
||||
: null,
|
||||
|
||||
onSubmitted: (data) {},
|
||||
validator: (value) {
|
||||
if (value == null || value.isEmpty) {
|
||||
return 'کد امنیتی را وارد کنید';
|
||||
validator: (value) {
|
||||
if (value == null || value.isEmpty) {
|
||||
return 'کد امنیتی را وارد کنید';
|
||||
} else if (controller.captchaKey.value != null &&
|
||||
controller.captchaKey.value != value) {
|
||||
return 'کد امنیتی اشتباه است';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
onChanged: (pass) {
|
||||
if (pass.length == 6) {
|
||||
if (controller.formKey.currentState?.validate() ?? false) {
|
||||
Get.find<AuthLogic>().isDisabled.value = false;
|
||||
}
|
||||
return null;
|
||||
},
|
||||
style: AppFonts.yekan13,
|
||||
);
|
||||
}, controller.textController),
|
||||
}
|
||||
},
|
||||
style: AppFonts.yekan13,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _CaptchaLinePainter extends CustomPainter {
|
||||
@override
|
||||
void paint(Canvas canvas, Size size) {
|
||||
final random = Random();
|
||||
final paint1 = Paint()
|
||||
..color = Colors.deepOrange
|
||||
..strokeWidth = 2;
|
||||
final paint2 = Paint()
|
||||
..color = Colors.blue
|
||||
..strokeWidth = 2;
|
||||
|
||||
// First line: top-left to bottom-right
|
||||
canvas.drawLine(Offset(0, 0), Offset(size.width, size.height), paint1);
|
||||
|
||||
// Second line: bottom-left to top-right
|
||||
canvas.drawLine(Offset(0, size.height), Offset(size.width, 0), paint2);
|
||||
}
|
||||
|
||||
@override
|
||||
bool shouldRepaint(covariant CustomPainter oldDelegate) => false;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
name: rasadyar_auth
|
||||
description: "A new Flutter project."
|
||||
version: 1.0.2
|
||||
version: 1.0.3
|
||||
publish_to: 'none'
|
||||
|
||||
|
||||
@@ -15,17 +15,17 @@ dependencies:
|
||||
rasadyar_core:
|
||||
path: ../core
|
||||
##code generation
|
||||
freezed_annotation: ^3.0.0
|
||||
freezed_annotation: ^3.1.0
|
||||
json_annotation: ^4.9.0
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
flutter_lints: ^5.0.0
|
||||
flutter_lints: ^6.0.0
|
||||
##code generation
|
||||
build_runner: ^2.4.15
|
||||
hive_ce_generator: ^1.9.1
|
||||
freezed: ^3.0.6
|
||||
json_serializable: ^6.9.4
|
||||
build_runner: ^2.6.0
|
||||
hive_ce_generator: ^1.9.3
|
||||
freezed: ^3.2.0
|
||||
json_serializable: ^6.10.0
|
||||
|
||||
##test
|
||||
mocktail: ^1.0.4
|
||||
|
||||
7
packages/chicken/.gitignore
vendored
Normal file
7
packages/chicken/.gitignore
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
# https://dart.dev/guides/libraries/private-files
|
||||
# Created by `dart pub`
|
||||
.dart_tool/
|
||||
|
||||
# Avoid committing pubspec.lock for library packages; see
|
||||
# https://dart.dev/guides/libraries/private-files#pubspeclock.
|
||||
pubspec.lock
|
||||
3
packages/chicken/CHANGELOG.md
Normal file
3
packages/chicken/CHANGELOG.md
Normal file
@@ -0,0 +1,3 @@
|
||||
## 1.0.0
|
||||
|
||||
- Initial version.
|
||||
39
packages/chicken/README.md
Normal file
39
packages/chicken/README.md
Normal file
@@ -0,0 +1,39 @@
|
||||
<!--
|
||||
This README describes the package. If you publish this package to pub.dev,
|
||||
this README's contents appear on the landing page for your package.
|
||||
|
||||
For information about how to write a good package README, see the guide for
|
||||
[writing package pages](https://dart.dev/tools/pub/writing-package-pages).
|
||||
|
||||
For general information about developing packages, see the Dart guide for
|
||||
[creating packages](https://dart.dev/guides/libraries/create-packages)
|
||||
and the Flutter guide for
|
||||
[developing packages and plugins](https://flutter.dev/to/develop-packages).
|
||||
-->
|
||||
|
||||
TODO: Put a short description of the package here that helps potential users
|
||||
know whether this package might be useful for them.
|
||||
|
||||
## Features
|
||||
|
||||
TODO: List what your package can do. Maybe include images, gifs, or videos.
|
||||
|
||||
## Getting started
|
||||
|
||||
TODO: List prerequisites and provide or point to information on how to
|
||||
start using the package.
|
||||
|
||||
## Usage
|
||||
|
||||
TODO: Include short and useful examples for package users. Add longer examples
|
||||
to `/example` folder.
|
||||
|
||||
```dart
|
||||
const like = 'sample';
|
||||
```
|
||||
|
||||
## Additional information
|
||||
|
||||
TODO: Tell users more about the package: where to find more information, how to
|
||||
contribute to the package, how to file issues, what response they can expect
|
||||
from the package authors, and more.
|
||||
30
packages/chicken/analysis_options.yaml
Normal file
30
packages/chicken/analysis_options.yaml
Normal file
@@ -0,0 +1,30 @@
|
||||
# This file configures the static analysis results for your project (errors,
|
||||
# warnings, and lints).
|
||||
#
|
||||
# This enables the 'recommended' set of lints from `package:lints`.
|
||||
# This set helps identify many issues that may lead to problems when running
|
||||
# or consuming Dart code, and enforces writing Dart using a single, idiomatic
|
||||
# style and format.
|
||||
#
|
||||
# If you want a smaller set of lints you can change this to specify
|
||||
# 'package:lints/core.yaml'. These are just the most critical lints
|
||||
# (the recommended set includes the core lints).
|
||||
# The core lints are also what is used by pub.dev for scoring packages.
|
||||
|
||||
include: package:lints/recommended.yaml
|
||||
|
||||
# Uncomment the following section to specify additional rules.
|
||||
|
||||
# linter:
|
||||
# rules:
|
||||
# - camel_case_types
|
||||
|
||||
# analyzer:
|
||||
# exclude:
|
||||
# - path/to/excluded/files/**
|
||||
|
||||
# For more information about the core and recommended set of lints, see
|
||||
# https://dart.dev/go/core-lints
|
||||
|
||||
# For additional information about configuring this file, see
|
||||
# https://dart.dev/guides/language/analysis-options
|
||||
6
packages/chicken/build.yaml
Normal file
6
packages/chicken/build.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
targets:
|
||||
$default:
|
||||
builders:
|
||||
json_serializable:
|
||||
options:
|
||||
field_rename: snake
|
||||
9
packages/chicken/lib/chicken.dart
Normal file
9
packages/chicken/lib/chicken.dart
Normal file
@@ -0,0 +1,9 @@
|
||||
/// Support for doing something awesome.
|
||||
///
|
||||
/// More dartdocs go here.
|
||||
library;
|
||||
|
||||
export 'presentation/routes/pages.dart';
|
||||
export 'presentation/routes/routes.dart';
|
||||
export 'presentation/pages/root/view.dart';
|
||||
export 'presentation/pages/root/logic.dart';
|
||||
14
packages/chicken/lib/data/common/constant.dart
Normal file
14
packages/chicken/lib/data/common/constant.dart
Normal file
@@ -0,0 +1,14 @@
|
||||
enum ApiEnvironment {
|
||||
dam(url: 'https://api.dam.rasadyar.net/');
|
||||
|
||||
const ApiEnvironment({required this.url});
|
||||
|
||||
final String url;
|
||||
|
||||
String get baseUrl {
|
||||
switch (this) {
|
||||
case ApiEnvironment.dam:
|
||||
return url;
|
||||
}
|
||||
}
|
||||
}
|
||||
58
packages/chicken/lib/data/common/dio_error_handler.dart
Normal file
58
packages/chicken/lib/data/common/dio_error_handler.dart
Normal file
@@ -0,0 +1,58 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
class DioErrorHandler {
|
||||
void handle(DioException error) {
|
||||
switch (error.response?.statusCode) {
|
||||
case 401:
|
||||
_handleGeneric(error);
|
||||
break;
|
||||
case 403:
|
||||
_handleGeneric(error);
|
||||
break;
|
||||
|
||||
case 410:
|
||||
_handle410();
|
||||
break;
|
||||
default:
|
||||
_handleGeneric(error);
|
||||
}
|
||||
}
|
||||
|
||||
//wrong password/user name => "detail": "No active account found with the given credentials" - 401
|
||||
void _handle410() {
|
||||
Get.showSnackbar(_errorSnackBar('نام کاربری یا رمز عبور اشتباه است'));
|
||||
}
|
||||
|
||||
//wrong captcha => "detail": "Captcha code is incorrect" - 403
|
||||
void _handle403() {}
|
||||
|
||||
void _handleGeneric(DioException error) {
|
||||
Get.showSnackbar(
|
||||
_errorSnackBar(
|
||||
error.response?.data.keys.first == 'is_user'
|
||||
? 'کاربر با این شماره تلفن وجود ندارد'
|
||||
: error.response?.data[error.response?.data.keys.first] ??
|
||||
'خطا در برقراری ارتباط با سرور',
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
GetSnackBar _errorSnackBar(String message) {
|
||||
return GetSnackBar(
|
||||
titleText: Text(
|
||||
'خطا',
|
||||
style: AppFonts.yekan14.copyWith(color: Colors.white),
|
||||
),
|
||||
messageText: Text(
|
||||
message,
|
||||
style: AppFonts.yekan12.copyWith(color: Colors.white),
|
||||
),
|
||||
backgroundColor: AppColor.error,
|
||||
margin: EdgeInsets.symmetric(horizontal: 12, vertical: 8),
|
||||
borderRadius: 12,
|
||||
duration: Duration(milliseconds: 3500),
|
||||
snackPosition: SnackPosition.TOP,
|
||||
);
|
||||
}
|
||||
}
|
||||
33
packages/chicken/lib/data/common/dio_manager.dart
Normal file
33
packages/chicken/lib/data/common/dio_manager.dart
Normal file
@@ -0,0 +1,33 @@
|
||||
import 'package:rasadyar_auth/data/repositories/auth_repository_imp.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
import '../di/chicken_di.dart';
|
||||
import 'constant.dart';
|
||||
|
||||
/*class DioRemoteManager {
|
||||
DioRemote? _currentClient;
|
||||
ApiEnvironment? _currentEnv;
|
||||
|
||||
Future<DioRemote> setEnvironment([
|
||||
ApiEnvironment env = ApiEnvironment.dam,
|
||||
]) async {
|
||||
if (_currentEnv != env) {
|
||||
_currentClient = DioRemote(baseUrl: env.baseUrl);
|
||||
await _currentClient?.init();
|
||||
_currentEnv = env;
|
||||
}
|
||||
return _currentClient!;
|
||||
}
|
||||
|
||||
DioRemote get currentClient {
|
||||
if (_currentClient == null) {
|
||||
throw Exception('Call setEnvironment() before accessing DioRemote.');
|
||||
}
|
||||
|
||||
return _currentClient!;
|
||||
}
|
||||
|
||||
ApiEnvironment? get currentEnv => _currentEnv;
|
||||
}*/
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
import 'package:rasadyar_chicken/data/models/local/widely_used_local_model.dart';
|
||||
|
||||
abstract class ChickenLocalDataSource {
|
||||
Future<void> openBox();
|
||||
Future<void> initWidleyUsed();
|
||||
|
||||
WidelyUsedLocalModel? getAllWidely();
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
import 'package:rasadyar_chicken/chicken.dart';
|
||||
import 'package:rasadyar_chicken/data/datasource/local/chicken_local.dart';
|
||||
import 'package:rasadyar_chicken/data/models/local/widely_used_local_model.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
class ChickenLocalDataSourceImp implements ChickenLocalDataSource {
|
||||
HiveLocalStorage local = diCore.get<HiveLocalStorage>();
|
||||
final String boxName = 'Chicken_Widley_Box';
|
||||
|
||||
@override
|
||||
Future<void> openBox() async {
|
||||
await local.openBox<WidelyUsedLocalModel>(boxName);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> initWidleyUsed() async {
|
||||
List<WidelyUsedLocalItem> tmpList = [
|
||||
WidelyUsedLocalItem(
|
||||
index: 0,
|
||||
pathId: 0,
|
||||
title: 'خرید داخل استان',
|
||||
color: AppColor.greenLightActive.toARGB32(),
|
||||
iconColor: AppColor.greenNormal.toARGB32(),
|
||||
iconPath: Assets.vec.cubeSearchSvg.path,
|
||||
path: ChickenRoutes.buysInProvince,
|
||||
),
|
||||
WidelyUsedLocalItem(
|
||||
index: 1,
|
||||
pathId: 1,
|
||||
title: 'فروش داخل استان',
|
||||
color: AppColor.blueLightActive.toARGB32(),
|
||||
iconColor: AppColor.blueNormal.toARGB32(),
|
||||
iconPath: Assets.vec.cubeSvg.path,
|
||||
path: ChickenRoutes.salesInProvince,
|
||||
),
|
||||
|
||||
WidelyUsedLocalItem(
|
||||
index: 2,
|
||||
title: 'قطعهبندی',
|
||||
color: AppColor.blueLightActive.toARGB32(),
|
||||
iconColor: AppColor.blueNormal.toARGB32(),
|
||||
iconPath: Assets.vec.cubeRotateSvg.path,
|
||||
path: ChickenRoutes.buysInProvince,
|
||||
),
|
||||
];
|
||||
await local.add(
|
||||
boxName: boxName,
|
||||
value: WidelyUsedLocalModel(hasInit: true, items: tmpList),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
WidelyUsedLocalModel? getAllWidely() {
|
||||
var res = local.readBox<WidelyUsedLocalModel>(boxName: boxName);
|
||||
return res?.first;
|
||||
}
|
||||
}
|
||||
155
packages/chicken/lib/data/datasource/remote/chicken_remote.dart
Normal file
155
packages/chicken/lib/data/datasource/remote/chicken_remote.dart
Normal file
@@ -0,0 +1,155 @@
|
||||
import 'package:rasadyar_chicken/data/models/request/change_password/change_password_request_model.dart';
|
||||
import 'package:rasadyar_chicken/data/models/request/conform_allocation/conform_allocation.dart';
|
||||
import 'package:rasadyar_chicken/data/models/request/create_steward_free_bar/create_steward_free_bar.dart';
|
||||
import 'package:rasadyar_chicken/data/models/request/steward_free_sale_bar/steward_free_sale_bar_request.dart';
|
||||
import 'package:rasadyar_chicken/data/models/request/submit_steward_allocation/submit_steward_allocation.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/allocated_made/allocated_made.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/bar_information/bar_information.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/dashboard_kill_house_free_bar/dashboard_kill_house_free_bar.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/guild/guild_model.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/guild_profile/guild_profile.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/imported_loads_model/imported_loads_model.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/inventory/inventory_model.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/iran_province_city/iran_province_city_model.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/kill_house_distribution_info/kill_house_distribution_info.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/out_province_carcasses_buyer/out_province_carcasses_buyer.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/roles_products/roles_products.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/segmentation_model/segmentation_model.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/steward_free_bar/steward_free_bar.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/steward_free_bar_dashboard/steward_free_bar_dashboard.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/steward_free_sale_bar/steward_free_sale_bar.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/user_profile/user_profile.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/waiting_arrival/waiting_arrival.dart'
|
||||
hide ProductModel;
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
abstract class ChickenRemoteDatasource {
|
||||
Future<List<InventoryModel>?> getInventory({required String token, CancelToken? cancelToken});
|
||||
|
||||
Future<KillHouseDistributionInfo?> getKillHouseDistributionInfo({required String token});
|
||||
|
||||
Future<BarInformation?> getGeneralBarInformation({
|
||||
required String token,
|
||||
Map<String, dynamic>? queryParameters,
|
||||
});
|
||||
|
||||
Future<PaginationModel<WaitingArrivalModel>?> getWaitingArrivals({
|
||||
required String token,
|
||||
Map<String, dynamic>? queryParameters,
|
||||
});
|
||||
|
||||
Future<void> setSateForArrivals({required String token, required Map<String, dynamic> request});
|
||||
|
||||
Future<PaginationModel<ImportedLoadsModel>?> getImportedLoadsModel({
|
||||
required String token,
|
||||
Map<String, dynamic>? queryParameters,
|
||||
});
|
||||
|
||||
Future<PaginationModel<AllocatedMadeModel>?> getAllocatedMade({
|
||||
required String token,
|
||||
Map<String, dynamic>? queryParameters,
|
||||
});
|
||||
|
||||
Future<void> confirmAllocation({required String token, required Map<String, dynamic> allocation});
|
||||
|
||||
Future<void> denyAllocation({required String token, required String allocationToken});
|
||||
|
||||
Future<void> confirmAllAllocation({
|
||||
required String token,
|
||||
required List<String> allocationTokens,
|
||||
});
|
||||
|
||||
Future<List<ProductModel>?> getRolesProducts({required String token});
|
||||
|
||||
Future<List<GuildModel>?> getGuilds({
|
||||
required String token,
|
||||
Map<String, dynamic>? queryParameters,
|
||||
});
|
||||
|
||||
Future<GuildProfile?> getProfile({required String token});
|
||||
|
||||
Future<void> postSubmitStewardAllocation({
|
||||
required String token,
|
||||
required SubmitStewardAllocation request,
|
||||
});
|
||||
|
||||
Future<void> deleteStewardAllocation({
|
||||
required String token,
|
||||
Map<String, dynamic>? queryParameters,
|
||||
});
|
||||
|
||||
Future<void> updateStewardAllocation({required String token, required ConformAllocation request});
|
||||
|
||||
Future<StewardFreeBarDashboard?> getStewardDashboard({
|
||||
required String token,
|
||||
required String stratDate,
|
||||
required String endDate,
|
||||
});
|
||||
|
||||
Future<DashboardKillHouseFreeBar?> getDashboardKillHouseFreeBar({
|
||||
required String token,
|
||||
required String stratDate,
|
||||
required String endDate,
|
||||
});
|
||||
|
||||
Future<PaginationModel<StewardFreeBar>?> getStewardPurchasesOutSideOfTheProvince({
|
||||
required String token,
|
||||
Map<String, dynamic>? queryParameters,
|
||||
});
|
||||
|
||||
Future<void> createStewardPurchasesOutSideOfTheProvince({
|
||||
required String token,
|
||||
required CreateStewardFreeBar body,
|
||||
});
|
||||
|
||||
Future<void> deleteStewardPurchasesOutSideOfTheProvince({
|
||||
required String token,
|
||||
required String stewardFreeBarKey,
|
||||
});
|
||||
|
||||
Future<PaginationModel<OutProvinceCarcassesBuyer>?> getOutProvinceCarcassesBuyer({
|
||||
required String token,
|
||||
Map<String, dynamic>? queryParameters,
|
||||
});
|
||||
|
||||
Future<void> createOutProvinceCarcassesBuyer({
|
||||
required String token,
|
||||
required OutProvinceCarcassesBuyer body,
|
||||
});
|
||||
|
||||
Future<List<IranProvinceCityModel>?> getProvince({CancelToken? cancelToken});
|
||||
|
||||
Future<List<IranProvinceCityModel>?> getCity({required String provinceName});
|
||||
|
||||
Future<PaginationModel<StewardFreeSaleBar>?> getStewardFreeSaleBar({
|
||||
required String token,
|
||||
Map<String, dynamic>? queryParameters,
|
||||
});
|
||||
|
||||
Future<void> createOutProvinceStewardFreeBar({
|
||||
required String token,
|
||||
required StewardFreeSaleBarRequest body,
|
||||
});
|
||||
|
||||
Future<void> updateOutProvinceStewardFreeBar({
|
||||
required String token,
|
||||
required StewardFreeSaleBarRequest body,
|
||||
});
|
||||
|
||||
Future<UserProfile?> getUserProfile({required String token});
|
||||
|
||||
Future<void> updateUserProfile({required String token, required UserProfile userProfile});
|
||||
|
||||
Future<void> updatePassword({required String token, required ChangePasswordRequestModel model});
|
||||
|
||||
Future<PaginationModel<SegmentationModel>?> getSegmentation({
|
||||
required String token,
|
||||
Map<String, dynamic>? queryParameters,
|
||||
});
|
||||
|
||||
Future<void> createSegmentation({required String token, required SegmentationModel model});
|
||||
|
||||
Future<void> editSegmentation({required String token, required SegmentationModel model});
|
||||
|
||||
Future<SegmentationModel?> deleteSegmentation({required String token, required String key});
|
||||
}
|
||||
@@ -0,0 +1,484 @@
|
||||
import 'package:rasadyar_chicken/data/datasource/remote/chicken_remote.dart';
|
||||
import 'package:rasadyar_chicken/data/models/request/change_password/change_password_request_model.dart';
|
||||
import 'package:rasadyar_chicken/data/models/request/conform_allocation/conform_allocation.dart';
|
||||
import 'package:rasadyar_chicken/data/models/request/create_steward_free_bar/create_steward_free_bar.dart';
|
||||
import 'package:rasadyar_chicken/data/models/request/steward_free_sale_bar/steward_free_sale_bar_request.dart';
|
||||
import 'package:rasadyar_chicken/data/models/request/submit_steward_allocation/submit_steward_allocation.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/allocated_made/allocated_made.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/bar_information/bar_information.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/dashboard_kill_house_free_bar/dashboard_kill_house_free_bar.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/guild/guild_model.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/guild_profile/guild_profile.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/imported_loads_model/imported_loads_model.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/inventory/inventory_model.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/iran_province_city/iran_province_city_model.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/kill_house_distribution_info/kill_house_distribution_info.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/out_province_carcasses_buyer/out_province_carcasses_buyer.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/roles_products/roles_products.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/segmentation_model/segmentation_model.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/steward_free_bar/steward_free_bar.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/steward_free_bar_dashboard/steward_free_bar_dashboard.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/steward_free_sale_bar/steward_free_sale_bar.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/user_profile/user_profile.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/waiting_arrival/waiting_arrival.dart'
|
||||
hide ProductModel;
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
class ChickenRemoteDatasourceImp implements ChickenRemoteDatasource {
|
||||
final DioRemote _httpClient;
|
||||
|
||||
ChickenRemoteDatasourceImp(this._httpClient);
|
||||
|
||||
@override
|
||||
Future<List<InventoryModel>?> getInventory({
|
||||
required String token,
|
||||
CancelToken? cancelToken,
|
||||
}) async {
|
||||
eLog(_httpClient.baseUrl);
|
||||
var res = await _httpClient.get(
|
||||
'/roles-products/?role=Steward',
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
|
||||
fromJsonList: (json) =>
|
||||
(json).map((item) => InventoryModel.fromJson(item as Map<String, dynamic>)).toList(),
|
||||
);
|
||||
|
||||
return res.data;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<KillHouseDistributionInfo?> getKillHouseDistributionInfo({required String token}) async {
|
||||
var res = await _httpClient.get(
|
||||
'/kill-house-distribution-info/?role=Steward',
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
fromJson: KillHouseDistributionInfo.fromJson,
|
||||
);
|
||||
|
||||
return res.data;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<BarInformation?> getGeneralBarInformation({
|
||||
required String token,
|
||||
Map<String, dynamic>? queryParameters,
|
||||
}) async {
|
||||
var res = await _httpClient.get(
|
||||
'/bars_for_kill_house_dashboard/',
|
||||
queryParameters: queryParameters,
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
fromJson: BarInformation.fromJson,
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<PaginationModel<WaitingArrivalModel>?> getWaitingArrivals({
|
||||
required String token,
|
||||
Map<String, dynamic>? queryParameters,
|
||||
}) async {
|
||||
var res = await _httpClient.get(
|
||||
'/steward-allocation/',
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
queryParameters: queryParameters,
|
||||
fromJson: (json) => PaginationModel<WaitingArrivalModel>.fromJson(
|
||||
json,
|
||||
(json) => WaitingArrivalModel.fromJson(json as Map<String, dynamic>),
|
||||
),
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> setSateForArrivals({
|
||||
required String token,
|
||||
required Map<String, dynamic> request,
|
||||
}) async {
|
||||
await _httpClient.put(
|
||||
'/steward-allocation/0/',
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
data: request,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<PaginationModel<ImportedLoadsModel>?> getImportedLoadsModel({
|
||||
required String token,
|
||||
Map<String, dynamic>? queryParameters,
|
||||
}) async {
|
||||
var res = await _httpClient.get(
|
||||
'/steward-allocation/',
|
||||
queryParameters: queryParameters,
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
fromJson: (json) => PaginationModel.fromJson(
|
||||
json,
|
||||
(data) => ImportedLoadsModel.fromJson(data as Map<String, dynamic>),
|
||||
),
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<PaginationModel<AllocatedMadeModel>?> getAllocatedMade({
|
||||
required String token,
|
||||
Map<String, dynamic>? queryParameters,
|
||||
}) async {
|
||||
var res = await _httpClient.get(
|
||||
'/steward-allocation/',
|
||||
queryParameters: queryParameters,
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
fromJson: (json) => PaginationModel<AllocatedMadeModel>.fromJson(
|
||||
json,
|
||||
(json) => AllocatedMadeModel.fromJson(json as Map<String, dynamic>),
|
||||
),
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> confirmAllocation({
|
||||
required String token,
|
||||
required Map<String, dynamic> allocation,
|
||||
}) async {
|
||||
var res = await _httpClient.put(
|
||||
'/steward-allocation/0/',
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
data: allocation,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> denyAllocation({required String token, required String allocationToken}) async {
|
||||
await _httpClient.delete(
|
||||
'/steward-allocation/0/?steward_allocation_key=$allocationToken',
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> confirmAllAllocation({
|
||||
required String token,
|
||||
required List<String> allocationTokens,
|
||||
}) async {
|
||||
await _httpClient.put(
|
||||
'/steward-allocation/0/',
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
data: {'steward_allocation_list': allocationTokens},
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<ProductModel>?> getRolesProducts({required String token}) async {
|
||||
var res = await _httpClient.get(
|
||||
'/roles-products/?role=Steward',
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
fromJsonList: (json) =>
|
||||
json.map((item) => ProductModel.fromJson(item as Map<String, dynamic>)).toList(),
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<GuildModel>?> getGuilds({
|
||||
required String token,
|
||||
Map<String, dynamic>? queryParameters,
|
||||
}) async {
|
||||
var res = await _httpClient.get(
|
||||
'/guilds/',
|
||||
queryParameters: queryParameters,
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
fromJsonList: (json) =>
|
||||
json.map((item) => GuildModel.fromJson(item as Map<String, dynamic>)).toList(),
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<GuildProfile?> getProfile({required String token}) async {
|
||||
var res = await _httpClient.get(
|
||||
'/guilds/0/?profile',
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
fromJson: GuildProfile.fromJson,
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> postSubmitStewardAllocation({
|
||||
required String token,
|
||||
required SubmitStewardAllocation request,
|
||||
}) async {
|
||||
await _httpClient.post(
|
||||
'/steward-allocation/',
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
data: request.toJson(),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> deleteStewardAllocation({
|
||||
required String token,
|
||||
Map<String, dynamic>? queryParameters,
|
||||
}) async {
|
||||
await _httpClient.delete(
|
||||
'/steward-allocation/0/',
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
queryParameters: queryParameters,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> updateStewardAllocation({
|
||||
required String token,
|
||||
required ConformAllocation request,
|
||||
}) async {
|
||||
await _httpClient.put(
|
||||
'/steward-allocation/0/',
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
queryParameters: request.toJson(),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<StewardFreeBarDashboard?> getStewardDashboard({
|
||||
required String token,
|
||||
required String stratDate,
|
||||
required String endDate,
|
||||
}) async {
|
||||
var res = await _httpClient.get(
|
||||
'/steward_free_bar_dashboard/?date1=$stratDate&date2=$endDate&search=filter',
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
fromJson: StewardFreeBarDashboard.fromJson,
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<DashboardKillHouseFreeBar?> getDashboardKillHouseFreeBar({
|
||||
required String token,
|
||||
required String stratDate,
|
||||
required String endDate,
|
||||
}) async {
|
||||
var res = await _httpClient.get(
|
||||
'/dashboard_kill_house_free_bar/?date1=$stratDate&date2=$endDate&search=filter',
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
fromJson: DashboardKillHouseFreeBar.fromJson,
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<PaginationModel<StewardFreeBar>?> getStewardPurchasesOutSideOfTheProvince({
|
||||
required String token,
|
||||
Map<String, dynamic>? queryParameters,
|
||||
}) async {
|
||||
var res = await _httpClient.get(
|
||||
'/steward_free_bar/',
|
||||
queryParameters: queryParameters,
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
fromJson: (json) => PaginationModel<StewardFreeBar>.fromJson(
|
||||
json,
|
||||
(json) => StewardFreeBar.fromJson(json as Map<String, dynamic>),
|
||||
),
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<IranProvinceCityModel>?> getCity({required String provinceName}) async {
|
||||
var res = await _httpClient.get(
|
||||
'/iran_city/',
|
||||
queryParameters: {'name': provinceName},
|
||||
fromJsonList: (json) =>
|
||||
json.map((item) => IranProvinceCityModel.fromJson(item as Map<String, dynamic>)).toList(),
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<IranProvinceCityModel>?> getProvince({CancelToken? cancelToken}) async {
|
||||
var res = await _httpClient.get(
|
||||
'/iran_province/',
|
||||
fromJsonList: (json) =>
|
||||
json.map((item) => IranProvinceCityModel.fromJson(item as Map<String, dynamic>)).toList(),
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> createStewardPurchasesOutSideOfTheProvince({
|
||||
required String token,
|
||||
required CreateStewardFreeBar body,
|
||||
}) async {
|
||||
var res = await _httpClient.post(
|
||||
'/steward_free_bar/',
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
data: body.toJson(),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> deleteStewardPurchasesOutSideOfTheProvince({
|
||||
required String token,
|
||||
required String stewardFreeBarKey,
|
||||
}) async {
|
||||
await _httpClient.delete(
|
||||
'/steward_free_bar/0/',
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
queryParameters: {'key': stewardFreeBarKey},
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<PaginationModel<OutProvinceCarcassesBuyer>?> getOutProvinceCarcassesBuyer({
|
||||
required String token,
|
||||
Map<String, dynamic>? queryParameters,
|
||||
}) async {
|
||||
var res = await _httpClient.get(
|
||||
'/out-province-carcasses-buyer/',
|
||||
queryParameters: queryParameters,
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
fromJson: (json) => PaginationModel<OutProvinceCarcassesBuyer>.fromJson(
|
||||
json,
|
||||
(json) => OutProvinceCarcassesBuyer.fromJson(json as Map<String, dynamic>),
|
||||
),
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> createOutProvinceCarcassesBuyer({
|
||||
required String token,
|
||||
required OutProvinceCarcassesBuyer body,
|
||||
}) async {
|
||||
await _httpClient.post(
|
||||
'/out-province-carcasses-buyer/',
|
||||
data: body.toJson()..removeWhere((key, value) => value == null),
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<PaginationModel<StewardFreeSaleBar>?> getStewardFreeSaleBar({
|
||||
required String token,
|
||||
Map<String, dynamic>? queryParameters,
|
||||
}) async {
|
||||
var res = await _httpClient.get(
|
||||
'/steward_free_sale_bar/',
|
||||
queryParameters: queryParameters,
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
fromJson: (json) => PaginationModel<StewardFreeSaleBar>.fromJson(
|
||||
json,
|
||||
(json) => StewardFreeSaleBar.fromJson(json as Map<String, dynamic>),
|
||||
),
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> createOutProvinceStewardFreeBar({
|
||||
required String token,
|
||||
required StewardFreeSaleBarRequest body,
|
||||
}) async {
|
||||
await _httpClient.post(
|
||||
'/steward_free_sale_bar/',
|
||||
data: body.toJson()..removeWhere((key, value) => value == null),
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> updateOutProvinceStewardFreeBar({
|
||||
required String token,
|
||||
required StewardFreeSaleBarRequest body,
|
||||
}) async {
|
||||
await _httpClient.put(
|
||||
'/steward_free_sale_bar/0/',
|
||||
data: body.toJson()
|
||||
..removeWhere((key, value) => value == null)
|
||||
..addAll({'carcassWeight': body.weightOfCarcasses, 'carcassCount': body.numberOfCarcasses}),
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<UserProfile?> getUserProfile({required String token}) async {
|
||||
var res = await _httpClient.get(
|
||||
'/system_user_profile/?self-profile',
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
fromJson: (json) => UserProfile.fromJson(json),
|
||||
);
|
||||
|
||||
return res.data;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> updateUserProfile({required String token, required UserProfile userProfile}) async {
|
||||
await _httpClient.put(
|
||||
'/system_user_profile/0/',
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
data: userProfile.toJson()..removeWhere((key, value) => value == null),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> updatePassword({
|
||||
required String token,
|
||||
required ChangePasswordRequestModel model,
|
||||
}) async {
|
||||
await _httpClient.post(
|
||||
'/api/change_password/',
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
data: model.toJson()..removeWhere((key, value) => value == null),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<PaginationModel<SegmentationModel>?> getSegmentation({
|
||||
required String token,
|
||||
Map<String, dynamic>? queryParameters,
|
||||
}) async {
|
||||
var res = await _httpClient.get(
|
||||
'/app-segmentation/',
|
||||
queryParameters: queryParameters,
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
fromJson: (json) => PaginationModel<SegmentationModel>.fromJson(
|
||||
json,
|
||||
(json) => SegmentationModel.fromJson(json as Map<String, dynamic>),
|
||||
),
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> createSegmentation({required String token, required SegmentationModel model}) async {
|
||||
await _httpClient.post(
|
||||
'/app-segmentation/',
|
||||
data: model.toJson()..removeWhere((key, value) => value == null),
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> editSegmentation({required String token, required SegmentationModel model}) async {
|
||||
await _httpClient.put(
|
||||
'/app-segmentation/0/',
|
||||
data: model.toJson()..removeWhere((key, value) => value == null),
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<SegmentationModel?> deleteSegmentation({
|
||||
required String token,
|
||||
required String key,
|
||||
}) async {
|
||||
var res = await _httpClient.delete<SegmentationModel?>(
|
||||
'/app-segmentation/0/',
|
||||
queryParameters: {'key': key},
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
fromJson: (json) => SegmentationModel.fromJson(json),
|
||||
);
|
||||
|
||||
return res.data;
|
||||
}
|
||||
}
|
||||
57
packages/chicken/lib/data/di/chicken_di.dart
Normal file
57
packages/chicken/lib/data/di/chicken_di.dart
Normal file
@@ -0,0 +1,57 @@
|
||||
import 'package:rasadyar_auth/data/models/local/user_local/user_local_model.dart';
|
||||
import 'package:rasadyar_auth/data/services/token_storage_service.dart';
|
||||
import 'package:rasadyar_auth/presentation/routes/pages.dart';
|
||||
import 'package:rasadyar_chicken/data/datasource/local/chicken_local_imp.dart';
|
||||
import 'package:rasadyar_chicken/data/datasource/remote/chicken_remote_imp.dart';
|
||||
import 'package:rasadyar_chicken/data/repositories/chicken_repository_imp.dart';
|
||||
import 'package:rasadyar_chicken/hive_registrar.g.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
GetIt diChicken = GetIt.instance;
|
||||
|
||||
Future<void> setupChickenDI() async {
|
||||
var tokenService = Get.find<TokenStorageService>();
|
||||
Hive.registerAdapters();
|
||||
diChicken.registerLazySingleton<ChickenLocalDataSourceImp>(() => ChickenLocalDataSourceImp());
|
||||
diChicken.get<ChickenLocalDataSourceImp>().openBox();
|
||||
|
||||
diChicken.registerLazySingleton<AppInterceptor>(
|
||||
() => AppInterceptor(
|
||||
//فعلا سامانه مرغ برای رفرش توکن چیزی ندارد
|
||||
refreshTokenCallback: () async => null,
|
||||
saveTokenCallback: (String newToken) async {
|
||||
await tokenService.saveAccessToken(newToken);
|
||||
},
|
||||
clearTokenCallback: () async {
|
||||
await tokenService.deleteTokens();
|
||||
Get.offAllNamed(AuthPaths.auth, arguments: Module.chicken);
|
||||
},
|
||||
authArguments: Module.chicken,
|
||||
),
|
||||
instanceName: 'chickenInterceptor',
|
||||
);
|
||||
|
||||
tokenService.getBaseUrl();
|
||||
|
||||
diChicken.registerLazySingleton<DioRemote>(() {
|
||||
return DioRemote(
|
||||
baseUrl: tokenService.baseurl.value,
|
||||
interceptors: diChicken.get<AppInterceptor>(instanceName: 'chickenInterceptor'),
|
||||
);
|
||||
}, instanceName: 'chickenDioRemote');
|
||||
|
||||
final dioRemote = diChicken.get<DioRemote>(instanceName: 'chickenDioRemote');
|
||||
|
||||
await dioRemote.init();
|
||||
|
||||
diChicken.registerLazySingleton(() => ChickenRemoteDatasourceImp(dioRemote));
|
||||
|
||||
diChicken.registerLazySingleton<ChickenRepositoryImp>(
|
||||
() => ChickenRepositoryImp(
|
||||
local: diChicken.get<ChickenLocalDataSourceImp>(),
|
||||
remote: diChicken.get<ChickenRemoteDatasourceImp>(),
|
||||
),
|
||||
);
|
||||
|
||||
diChicken.registerSingleton(ImagePicker());
|
||||
}
|
||||
@@ -0,0 +1,73 @@
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
import 'package:rasadyar_core/utils/utils.dart';
|
||||
|
||||
part 'widely_used_local_model.g.dart';
|
||||
|
||||
@HiveType(typeId: chickenWidelyUsedLocalModelTypeId)
|
||||
class WidelyUsedLocalModel extends HiveObject {
|
||||
@HiveField(0)
|
||||
bool? hasInit;
|
||||
|
||||
@HiveField(1)
|
||||
List<WidelyUsedLocalItem>? items;
|
||||
|
||||
WidelyUsedLocalModel({this.hasInit, this.items});
|
||||
|
||||
WidelyUsedLocalModel copyWith({bool? hasInit, List<WidelyUsedLocalItem>? items}) {
|
||||
return WidelyUsedLocalModel(hasInit: hasInit ?? this.hasInit, items: items ?? this.items);
|
||||
}
|
||||
}
|
||||
|
||||
@HiveType(typeId: chickenWidelyUsedLocalItemTypeId)
|
||||
class WidelyUsedLocalItem extends HiveObject {
|
||||
@HiveField(0)
|
||||
String? title;
|
||||
|
||||
@HiveField(1)
|
||||
String? iconPath;
|
||||
|
||||
@HiveField(2)
|
||||
int? iconColor;
|
||||
|
||||
@HiveField(3)
|
||||
int? color;
|
||||
|
||||
@HiveField(4)
|
||||
String? path;
|
||||
|
||||
@HiveField(5)
|
||||
int? pathId;
|
||||
|
||||
@HiveField(6)
|
||||
int? index;
|
||||
|
||||
WidelyUsedLocalItem({
|
||||
this.title,
|
||||
this.iconPath,
|
||||
this.iconColor,
|
||||
this.color,
|
||||
this.path,
|
||||
this.pathId,
|
||||
this.index,
|
||||
});
|
||||
|
||||
WidelyUsedLocalItem copyWith({
|
||||
String? title,
|
||||
String? iconPath,
|
||||
int? iconColor,
|
||||
int? color,
|
||||
int? pathId,
|
||||
int? index,
|
||||
String? path,
|
||||
}) {
|
||||
return WidelyUsedLocalItem(
|
||||
title: title ?? this.title,
|
||||
iconPath: iconPath ?? this.iconPath,
|
||||
iconColor: iconColor ?? this.iconColor,
|
||||
color: color ?? this.color,
|
||||
path: path ?? this.path,
|
||||
pathId: pathId ?? this.pathId,
|
||||
index: index ?? this.index,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'widely_used_local_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// TypeAdapterGenerator
|
||||
// **************************************************************************
|
||||
|
||||
class WidelyUsedLocalModelAdapter extends TypeAdapter<WidelyUsedLocalModel> {
|
||||
@override
|
||||
final typeId = 2;
|
||||
|
||||
@override
|
||||
WidelyUsedLocalModel read(BinaryReader reader) {
|
||||
final numOfFields = reader.readByte();
|
||||
final fields = <int, dynamic>{
|
||||
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
||||
};
|
||||
return WidelyUsedLocalModel(
|
||||
hasInit: fields[0] as bool?,
|
||||
items: (fields[1] as List?)?.cast<WidelyUsedLocalItem>(),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void write(BinaryWriter writer, WidelyUsedLocalModel obj) {
|
||||
writer
|
||||
..writeByte(2)
|
||||
..writeByte(0)
|
||||
..write(obj.hasInit)
|
||||
..writeByte(1)
|
||||
..write(obj.items);
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => typeId.hashCode;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
identical(this, other) ||
|
||||
other is WidelyUsedLocalModelAdapter &&
|
||||
runtimeType == other.runtimeType &&
|
||||
typeId == other.typeId;
|
||||
}
|
||||
|
||||
class WidelyUsedLocalItemAdapter extends TypeAdapter<WidelyUsedLocalItem> {
|
||||
@override
|
||||
final typeId = 3;
|
||||
|
||||
@override
|
||||
WidelyUsedLocalItem read(BinaryReader reader) {
|
||||
final numOfFields = reader.readByte();
|
||||
final fields = <int, dynamic>{
|
||||
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
||||
};
|
||||
return WidelyUsedLocalItem(
|
||||
title: fields[0] as String?,
|
||||
iconPath: fields[1] as String?,
|
||||
iconColor: (fields[2] as num?)?.toInt(),
|
||||
color: (fields[3] as num?)?.toInt(),
|
||||
path: fields[4] as String?,
|
||||
pathId: (fields[5] as num?)?.toInt(),
|
||||
index: (fields[6] as num?)?.toInt(),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void write(BinaryWriter writer, WidelyUsedLocalItem obj) {
|
||||
writer
|
||||
..writeByte(7)
|
||||
..writeByte(0)
|
||||
..write(obj.title)
|
||||
..writeByte(1)
|
||||
..write(obj.iconPath)
|
||||
..writeByte(2)
|
||||
..write(obj.iconColor)
|
||||
..writeByte(3)
|
||||
..write(obj.color)
|
||||
..writeByte(4)
|
||||
..write(obj.path)
|
||||
..writeByte(5)
|
||||
..write(obj.pathId)
|
||||
..writeByte(6)
|
||||
..write(obj.index);
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => typeId.hashCode;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
identical(this, other) ||
|
||||
other is WidelyUsedLocalItemAdapter &&
|
||||
runtimeType == other.runtimeType &&
|
||||
typeId == other.typeId;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'change_password_request_model.freezed.dart';
|
||||
part 'change_password_request_model.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class ChangePasswordRequestModel with _$ChangePasswordRequestModel {
|
||||
const factory ChangePasswordRequestModel({
|
||||
String? username,
|
||||
String? password,
|
||||
}) = _ChangePasswordRequestModel;
|
||||
|
||||
factory ChangePasswordRequestModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$ChangePasswordRequestModelFromJson(json);
|
||||
}
|
||||
@@ -0,0 +1,280 @@
|
||||
// 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 'change_password_request_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
/// @nodoc
|
||||
mixin _$ChangePasswordRequestModel {
|
||||
|
||||
String? get username; String? get password;
|
||||
/// Create a copy of ChangePasswordRequestModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$ChangePasswordRequestModelCopyWith<ChangePasswordRequestModel> get copyWith => _$ChangePasswordRequestModelCopyWithImpl<ChangePasswordRequestModel>(this as ChangePasswordRequestModel, _$identity);
|
||||
|
||||
/// Serializes this ChangePasswordRequestModel to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is ChangePasswordRequestModel&&(identical(other.username, username) || other.username == username)&&(identical(other.password, password) || other.password == password));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,username,password);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ChangePasswordRequestModel(username: $username, password: $password)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $ChangePasswordRequestModelCopyWith<$Res> {
|
||||
factory $ChangePasswordRequestModelCopyWith(ChangePasswordRequestModel value, $Res Function(ChangePasswordRequestModel) _then) = _$ChangePasswordRequestModelCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
String? username, String? password
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$ChangePasswordRequestModelCopyWithImpl<$Res>
|
||||
implements $ChangePasswordRequestModelCopyWith<$Res> {
|
||||
_$ChangePasswordRequestModelCopyWithImpl(this._self, this._then);
|
||||
|
||||
final ChangePasswordRequestModel _self;
|
||||
final $Res Function(ChangePasswordRequestModel) _then;
|
||||
|
||||
/// Create a copy of ChangePasswordRequestModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? username = freezed,Object? password = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
username: freezed == username ? _self.username : username // ignore: cast_nullable_to_non_nullable
|
||||
as String?,password: freezed == password ? _self.password : password // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [ChangePasswordRequestModel].
|
||||
extension ChangePasswordRequestModelPatterns on ChangePasswordRequestModel {
|
||||
/// 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( _ChangePasswordRequestModel value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _ChangePasswordRequestModel() 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( _ChangePasswordRequestModel value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _ChangePasswordRequestModel():
|
||||
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( _ChangePasswordRequestModel value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _ChangePasswordRequestModel() 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? username, String? password)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _ChangePasswordRequestModel() when $default != null:
|
||||
return $default(_that.username,_that.password);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? username, String? password) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _ChangePasswordRequestModel():
|
||||
return $default(_that.username,_that.password);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? username, String? password)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _ChangePasswordRequestModel() when $default != null:
|
||||
return $default(_that.username,_that.password);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
|
||||
class _ChangePasswordRequestModel implements ChangePasswordRequestModel {
|
||||
const _ChangePasswordRequestModel({this.username, this.password});
|
||||
factory _ChangePasswordRequestModel.fromJson(Map<String, dynamic> json) => _$ChangePasswordRequestModelFromJson(json);
|
||||
|
||||
@override final String? username;
|
||||
@override final String? password;
|
||||
|
||||
/// Create a copy of ChangePasswordRequestModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$ChangePasswordRequestModelCopyWith<_ChangePasswordRequestModel> get copyWith => __$ChangePasswordRequestModelCopyWithImpl<_ChangePasswordRequestModel>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$ChangePasswordRequestModelToJson(this, );
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _ChangePasswordRequestModel&&(identical(other.username, username) || other.username == username)&&(identical(other.password, password) || other.password == password));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,username,password);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ChangePasswordRequestModel(username: $username, password: $password)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$ChangePasswordRequestModelCopyWith<$Res> implements $ChangePasswordRequestModelCopyWith<$Res> {
|
||||
factory _$ChangePasswordRequestModelCopyWith(_ChangePasswordRequestModel value, $Res Function(_ChangePasswordRequestModel) _then) = __$ChangePasswordRequestModelCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
String? username, String? password
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$ChangePasswordRequestModelCopyWithImpl<$Res>
|
||||
implements _$ChangePasswordRequestModelCopyWith<$Res> {
|
||||
__$ChangePasswordRequestModelCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _ChangePasswordRequestModel _self;
|
||||
final $Res Function(_ChangePasswordRequestModel) _then;
|
||||
|
||||
/// Create a copy of ChangePasswordRequestModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? username = freezed,Object? password = freezed,}) {
|
||||
return _then(_ChangePasswordRequestModel(
|
||||
username: freezed == username ? _self.username : username // ignore: cast_nullable_to_non_nullable
|
||||
as String?,password: freezed == password ? _self.password : password // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// dart format on
|
||||
@@ -0,0 +1,21 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'change_password_request_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_ChangePasswordRequestModel _$ChangePasswordRequestModelFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _ChangePasswordRequestModel(
|
||||
username: json['username'] as String?,
|
||||
password: json['password'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ChangePasswordRequestModelToJson(
|
||||
_ChangePasswordRequestModel instance,
|
||||
) => <String, dynamic>{
|
||||
'username': instance.username,
|
||||
'password': instance.password,
|
||||
};
|
||||
@@ -0,0 +1,18 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'conform_allocation.freezed.dart';
|
||||
part 'conform_allocation.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class ConformAllocation with _$ConformAllocation {
|
||||
factory ConformAllocation({
|
||||
String? allocation_key,
|
||||
int? number_of_carcasses,
|
||||
int? weight_of_carcasses,
|
||||
int? amount,
|
||||
int? total_amount,
|
||||
}) = _ConformAllocation;
|
||||
|
||||
factory ConformAllocation.fromJson(Map<String, dynamic> json) =>
|
||||
_$ConformAllocationFromJson(json);
|
||||
}
|
||||
@@ -0,0 +1,289 @@
|
||||
// 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 'conform_allocation.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
/// @nodoc
|
||||
mixin _$ConformAllocation {
|
||||
|
||||
String? get allocation_key; int? get number_of_carcasses; int? get weight_of_carcasses; int? get amount; int? get total_amount;
|
||||
/// Create a copy of ConformAllocation
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$ConformAllocationCopyWith<ConformAllocation> get copyWith => _$ConformAllocationCopyWithImpl<ConformAllocation>(this as ConformAllocation, _$identity);
|
||||
|
||||
/// Serializes this ConformAllocation to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is ConformAllocation&&(identical(other.allocation_key, allocation_key) || other.allocation_key == allocation_key)&&(identical(other.number_of_carcasses, number_of_carcasses) || other.number_of_carcasses == number_of_carcasses)&&(identical(other.weight_of_carcasses, weight_of_carcasses) || other.weight_of_carcasses == weight_of_carcasses)&&(identical(other.amount, amount) || other.amount == amount)&&(identical(other.total_amount, total_amount) || other.total_amount == total_amount));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,allocation_key,number_of_carcasses,weight_of_carcasses,amount,total_amount);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ConformAllocation(allocation_key: $allocation_key, number_of_carcasses: $number_of_carcasses, weight_of_carcasses: $weight_of_carcasses, amount: $amount, total_amount: $total_amount)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $ConformAllocationCopyWith<$Res> {
|
||||
factory $ConformAllocationCopyWith(ConformAllocation value, $Res Function(ConformAllocation) _then) = _$ConformAllocationCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
String? allocation_key, int? number_of_carcasses, int? weight_of_carcasses, int? amount, int? total_amount
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$ConformAllocationCopyWithImpl<$Res>
|
||||
implements $ConformAllocationCopyWith<$Res> {
|
||||
_$ConformAllocationCopyWithImpl(this._self, this._then);
|
||||
|
||||
final ConformAllocation _self;
|
||||
final $Res Function(ConformAllocation) _then;
|
||||
|
||||
/// Create a copy of ConformAllocation
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? allocation_key = freezed,Object? number_of_carcasses = freezed,Object? weight_of_carcasses = freezed,Object? amount = freezed,Object? total_amount = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
allocation_key: freezed == allocation_key ? _self.allocation_key : allocation_key // ignore: cast_nullable_to_non_nullable
|
||||
as String?,number_of_carcasses: freezed == number_of_carcasses ? _self.number_of_carcasses : number_of_carcasses // ignore: cast_nullable_to_non_nullable
|
||||
as int?,weight_of_carcasses: freezed == weight_of_carcasses ? _self.weight_of_carcasses : weight_of_carcasses // ignore: cast_nullable_to_non_nullable
|
||||
as int?,amount: freezed == amount ? _self.amount : amount // ignore: cast_nullable_to_non_nullable
|
||||
as int?,total_amount: freezed == total_amount ? _self.total_amount : total_amount // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [ConformAllocation].
|
||||
extension ConformAllocationPatterns on ConformAllocation {
|
||||
/// 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( _ConformAllocation value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _ConformAllocation() 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( _ConformAllocation value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _ConformAllocation():
|
||||
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( _ConformAllocation value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _ConformAllocation() 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? allocation_key, int? number_of_carcasses, int? weight_of_carcasses, int? amount, int? total_amount)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _ConformAllocation() when $default != null:
|
||||
return $default(_that.allocation_key,_that.number_of_carcasses,_that.weight_of_carcasses,_that.amount,_that.total_amount);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? allocation_key, int? number_of_carcasses, int? weight_of_carcasses, int? amount, int? total_amount) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _ConformAllocation():
|
||||
return $default(_that.allocation_key,_that.number_of_carcasses,_that.weight_of_carcasses,_that.amount,_that.total_amount);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? allocation_key, int? number_of_carcasses, int? weight_of_carcasses, int? amount, int? total_amount)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _ConformAllocation() when $default != null:
|
||||
return $default(_that.allocation_key,_that.number_of_carcasses,_that.weight_of_carcasses,_that.amount,_that.total_amount);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
|
||||
class _ConformAllocation implements ConformAllocation {
|
||||
_ConformAllocation({this.allocation_key, this.number_of_carcasses, this.weight_of_carcasses, this.amount, this.total_amount});
|
||||
factory _ConformAllocation.fromJson(Map<String, dynamic> json) => _$ConformAllocationFromJson(json);
|
||||
|
||||
@override final String? allocation_key;
|
||||
@override final int? number_of_carcasses;
|
||||
@override final int? weight_of_carcasses;
|
||||
@override final int? amount;
|
||||
@override final int? total_amount;
|
||||
|
||||
/// Create a copy of ConformAllocation
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$ConformAllocationCopyWith<_ConformAllocation> get copyWith => __$ConformAllocationCopyWithImpl<_ConformAllocation>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$ConformAllocationToJson(this, );
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _ConformAllocation&&(identical(other.allocation_key, allocation_key) || other.allocation_key == allocation_key)&&(identical(other.number_of_carcasses, number_of_carcasses) || other.number_of_carcasses == number_of_carcasses)&&(identical(other.weight_of_carcasses, weight_of_carcasses) || other.weight_of_carcasses == weight_of_carcasses)&&(identical(other.amount, amount) || other.amount == amount)&&(identical(other.total_amount, total_amount) || other.total_amount == total_amount));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,allocation_key,number_of_carcasses,weight_of_carcasses,amount,total_amount);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ConformAllocation(allocation_key: $allocation_key, number_of_carcasses: $number_of_carcasses, weight_of_carcasses: $weight_of_carcasses, amount: $amount, total_amount: $total_amount)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$ConformAllocationCopyWith<$Res> implements $ConformAllocationCopyWith<$Res> {
|
||||
factory _$ConformAllocationCopyWith(_ConformAllocation value, $Res Function(_ConformAllocation) _then) = __$ConformAllocationCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
String? allocation_key, int? number_of_carcasses, int? weight_of_carcasses, int? amount, int? total_amount
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$ConformAllocationCopyWithImpl<$Res>
|
||||
implements _$ConformAllocationCopyWith<$Res> {
|
||||
__$ConformAllocationCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _ConformAllocation _self;
|
||||
final $Res Function(_ConformAllocation) _then;
|
||||
|
||||
/// Create a copy of ConformAllocation
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? allocation_key = freezed,Object? number_of_carcasses = freezed,Object? weight_of_carcasses = freezed,Object? amount = freezed,Object? total_amount = freezed,}) {
|
||||
return _then(_ConformAllocation(
|
||||
allocation_key: freezed == allocation_key ? _self.allocation_key : allocation_key // ignore: cast_nullable_to_non_nullable
|
||||
as String?,number_of_carcasses: freezed == number_of_carcasses ? _self.number_of_carcasses : number_of_carcasses // ignore: cast_nullable_to_non_nullable
|
||||
as int?,weight_of_carcasses: freezed == weight_of_carcasses ? _self.weight_of_carcasses : weight_of_carcasses // ignore: cast_nullable_to_non_nullable
|
||||
as int?,amount: freezed == amount ? _self.amount : amount // ignore: cast_nullable_to_non_nullable
|
||||
as int?,total_amount: freezed == total_amount ? _self.total_amount : total_amount // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// dart format on
|
||||
@@ -0,0 +1,25 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'conform_allocation.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_ConformAllocation _$ConformAllocationFromJson(Map<String, dynamic> json) =>
|
||||
_ConformAllocation(
|
||||
allocation_key: json['allocation_key'] as String?,
|
||||
number_of_carcasses: (json['number_of_carcasses'] as num?)?.toInt(),
|
||||
weight_of_carcasses: (json['weight_of_carcasses'] as num?)?.toInt(),
|
||||
amount: (json['amount'] as num?)?.toInt(),
|
||||
total_amount: (json['total_amount'] as num?)?.toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ConformAllocationToJson(_ConformAllocation instance) =>
|
||||
<String, dynamic>{
|
||||
'allocation_key': instance.allocation_key,
|
||||
'number_of_carcasses': instance.number_of_carcasses,
|
||||
'weight_of_carcasses': instance.weight_of_carcasses,
|
||||
'amount': instance.amount,
|
||||
'total_amount': instance.total_amount,
|
||||
};
|
||||
@@ -0,0 +1,21 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'create_steward_free_bar.freezed.dart';
|
||||
part 'create_steward_free_bar.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class CreateStewardFreeBar with _$CreateStewardFreeBar {
|
||||
const factory CreateStewardFreeBar({
|
||||
String? productKey,
|
||||
String? killHouseName,
|
||||
String? killHouseMobile,
|
||||
String? province,
|
||||
String? city,
|
||||
int? weightOfCarcasses,
|
||||
String? date,
|
||||
String? barImage,
|
||||
}) = _CreateStewardFreeBar;
|
||||
|
||||
factory CreateStewardFreeBar.fromJson(Map<String, dynamic> json) =>
|
||||
_$CreateStewardFreeBarFromJson(json);
|
||||
}
|
||||
@@ -0,0 +1,298 @@
|
||||
// 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 'create_steward_free_bar.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
/// @nodoc
|
||||
mixin _$CreateStewardFreeBar {
|
||||
|
||||
String? get productKey; String? get killHouseName; String? get killHouseMobile; String? get province; String? get city; int? get weightOfCarcasses; String? get date; String? get barImage;
|
||||
/// Create a copy of CreateStewardFreeBar
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$CreateStewardFreeBarCopyWith<CreateStewardFreeBar> get copyWith => _$CreateStewardFreeBarCopyWithImpl<CreateStewardFreeBar>(this as CreateStewardFreeBar, _$identity);
|
||||
|
||||
/// Serializes this CreateStewardFreeBar to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is CreateStewardFreeBar&&(identical(other.productKey, productKey) || other.productKey == productKey)&&(identical(other.killHouseName, killHouseName) || other.killHouseName == killHouseName)&&(identical(other.killHouseMobile, killHouseMobile) || other.killHouseMobile == killHouseMobile)&&(identical(other.province, province) || other.province == province)&&(identical(other.city, city) || other.city == city)&&(identical(other.weightOfCarcasses, weightOfCarcasses) || other.weightOfCarcasses == weightOfCarcasses)&&(identical(other.date, date) || other.date == date)&&(identical(other.barImage, barImage) || other.barImage == barImage));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,productKey,killHouseName,killHouseMobile,province,city,weightOfCarcasses,date,barImage);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'CreateStewardFreeBar(productKey: $productKey, killHouseName: $killHouseName, killHouseMobile: $killHouseMobile, province: $province, city: $city, weightOfCarcasses: $weightOfCarcasses, date: $date, barImage: $barImage)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $CreateStewardFreeBarCopyWith<$Res> {
|
||||
factory $CreateStewardFreeBarCopyWith(CreateStewardFreeBar value, $Res Function(CreateStewardFreeBar) _then) = _$CreateStewardFreeBarCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
String? productKey, String? killHouseName, String? killHouseMobile, String? province, String? city, int? weightOfCarcasses, String? date, String? barImage
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$CreateStewardFreeBarCopyWithImpl<$Res>
|
||||
implements $CreateStewardFreeBarCopyWith<$Res> {
|
||||
_$CreateStewardFreeBarCopyWithImpl(this._self, this._then);
|
||||
|
||||
final CreateStewardFreeBar _self;
|
||||
final $Res Function(CreateStewardFreeBar) _then;
|
||||
|
||||
/// Create a copy of CreateStewardFreeBar
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? productKey = freezed,Object? killHouseName = freezed,Object? killHouseMobile = freezed,Object? province = freezed,Object? city = freezed,Object? weightOfCarcasses = freezed,Object? date = freezed,Object? barImage = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
productKey: freezed == productKey ? _self.productKey : productKey // ignore: cast_nullable_to_non_nullable
|
||||
as String?,killHouseName: freezed == killHouseName ? _self.killHouseName : killHouseName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,killHouseMobile: freezed == killHouseMobile ? _self.killHouseMobile : killHouseMobile // ignore: cast_nullable_to_non_nullable
|
||||
as String?,province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable
|
||||
as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable
|
||||
as String?,weightOfCarcasses: freezed == weightOfCarcasses ? _self.weightOfCarcasses : weightOfCarcasses // ignore: cast_nullable_to_non_nullable
|
||||
as int?,date: freezed == date ? _self.date : date // ignore: cast_nullable_to_non_nullable
|
||||
as String?,barImage: freezed == barImage ? _self.barImage : barImage // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [CreateStewardFreeBar].
|
||||
extension CreateStewardFreeBarPatterns on CreateStewardFreeBar {
|
||||
/// 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( _CreateStewardFreeBar value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _CreateStewardFreeBar() 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( _CreateStewardFreeBar value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _CreateStewardFreeBar():
|
||||
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( _CreateStewardFreeBar value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _CreateStewardFreeBar() 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? productKey, String? killHouseName, String? killHouseMobile, String? province, String? city, int? weightOfCarcasses, String? date, String? barImage)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _CreateStewardFreeBar() when $default != null:
|
||||
return $default(_that.productKey,_that.killHouseName,_that.killHouseMobile,_that.province,_that.city,_that.weightOfCarcasses,_that.date,_that.barImage);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? productKey, String? killHouseName, String? killHouseMobile, String? province, String? city, int? weightOfCarcasses, String? date, String? barImage) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _CreateStewardFreeBar():
|
||||
return $default(_that.productKey,_that.killHouseName,_that.killHouseMobile,_that.province,_that.city,_that.weightOfCarcasses,_that.date,_that.barImage);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? productKey, String? killHouseName, String? killHouseMobile, String? province, String? city, int? weightOfCarcasses, String? date, String? barImage)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _CreateStewardFreeBar() when $default != null:
|
||||
return $default(_that.productKey,_that.killHouseName,_that.killHouseMobile,_that.province,_that.city,_that.weightOfCarcasses,_that.date,_that.barImage);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
|
||||
class _CreateStewardFreeBar implements CreateStewardFreeBar {
|
||||
const _CreateStewardFreeBar({this.productKey, this.killHouseName, this.killHouseMobile, this.province, this.city, this.weightOfCarcasses, this.date, this.barImage});
|
||||
factory _CreateStewardFreeBar.fromJson(Map<String, dynamic> json) => _$CreateStewardFreeBarFromJson(json);
|
||||
|
||||
@override final String? productKey;
|
||||
@override final String? killHouseName;
|
||||
@override final String? killHouseMobile;
|
||||
@override final String? province;
|
||||
@override final String? city;
|
||||
@override final int? weightOfCarcasses;
|
||||
@override final String? date;
|
||||
@override final String? barImage;
|
||||
|
||||
/// Create a copy of CreateStewardFreeBar
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$CreateStewardFreeBarCopyWith<_CreateStewardFreeBar> get copyWith => __$CreateStewardFreeBarCopyWithImpl<_CreateStewardFreeBar>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$CreateStewardFreeBarToJson(this, );
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _CreateStewardFreeBar&&(identical(other.productKey, productKey) || other.productKey == productKey)&&(identical(other.killHouseName, killHouseName) || other.killHouseName == killHouseName)&&(identical(other.killHouseMobile, killHouseMobile) || other.killHouseMobile == killHouseMobile)&&(identical(other.province, province) || other.province == province)&&(identical(other.city, city) || other.city == city)&&(identical(other.weightOfCarcasses, weightOfCarcasses) || other.weightOfCarcasses == weightOfCarcasses)&&(identical(other.date, date) || other.date == date)&&(identical(other.barImage, barImage) || other.barImage == barImage));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,productKey,killHouseName,killHouseMobile,province,city,weightOfCarcasses,date,barImage);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'CreateStewardFreeBar(productKey: $productKey, killHouseName: $killHouseName, killHouseMobile: $killHouseMobile, province: $province, city: $city, weightOfCarcasses: $weightOfCarcasses, date: $date, barImage: $barImage)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$CreateStewardFreeBarCopyWith<$Res> implements $CreateStewardFreeBarCopyWith<$Res> {
|
||||
factory _$CreateStewardFreeBarCopyWith(_CreateStewardFreeBar value, $Res Function(_CreateStewardFreeBar) _then) = __$CreateStewardFreeBarCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
String? productKey, String? killHouseName, String? killHouseMobile, String? province, String? city, int? weightOfCarcasses, String? date, String? barImage
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$CreateStewardFreeBarCopyWithImpl<$Res>
|
||||
implements _$CreateStewardFreeBarCopyWith<$Res> {
|
||||
__$CreateStewardFreeBarCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _CreateStewardFreeBar _self;
|
||||
final $Res Function(_CreateStewardFreeBar) _then;
|
||||
|
||||
/// Create a copy of CreateStewardFreeBar
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? productKey = freezed,Object? killHouseName = freezed,Object? killHouseMobile = freezed,Object? province = freezed,Object? city = freezed,Object? weightOfCarcasses = freezed,Object? date = freezed,Object? barImage = freezed,}) {
|
||||
return _then(_CreateStewardFreeBar(
|
||||
productKey: freezed == productKey ? _self.productKey : productKey // ignore: cast_nullable_to_non_nullable
|
||||
as String?,killHouseName: freezed == killHouseName ? _self.killHouseName : killHouseName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,killHouseMobile: freezed == killHouseMobile ? _self.killHouseMobile : killHouseMobile // ignore: cast_nullable_to_non_nullable
|
||||
as String?,province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable
|
||||
as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable
|
||||
as String?,weightOfCarcasses: freezed == weightOfCarcasses ? _self.weightOfCarcasses : weightOfCarcasses // ignore: cast_nullable_to_non_nullable
|
||||
as int?,date: freezed == date ? _self.date : date // ignore: cast_nullable_to_non_nullable
|
||||
as String?,barImage: freezed == barImage ? _self.barImage : barImage // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// dart format on
|
||||
@@ -0,0 +1,33 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'create_steward_free_bar.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_CreateStewardFreeBar _$CreateStewardFreeBarFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _CreateStewardFreeBar(
|
||||
productKey: json['product_key'] as String?,
|
||||
killHouseName: json['kill_house_name'] as String?,
|
||||
killHouseMobile: json['kill_house_mobile'] as String?,
|
||||
province: json['province'] as String?,
|
||||
city: json['city'] as String?,
|
||||
weightOfCarcasses: (json['weight_of_carcasses'] as num?)?.toInt(),
|
||||
date: json['date'] as String?,
|
||||
barImage: json['bar_image'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$CreateStewardFreeBarToJson(
|
||||
_CreateStewardFreeBar instance,
|
||||
) => <String, dynamic>{
|
||||
'product_key': instance.productKey,
|
||||
'kill_house_name': instance.killHouseName,
|
||||
'kill_house_mobile': instance.killHouseMobile,
|
||||
'province': instance.province,
|
||||
'city': instance.city,
|
||||
'weight_of_carcasses': instance.weightOfCarcasses,
|
||||
'date': instance.date,
|
||||
'bar_image': instance.barImage,
|
||||
};
|
||||
@@ -0,0 +1,20 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'steward_allocation_request.freezed.dart';
|
||||
part 'steward_allocation_request.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class StewardAllocationRequest with _$StewardAllocationRequest {
|
||||
const factory StewardAllocationRequest({
|
||||
bool? checkAllocation,
|
||||
String? allocationKey,
|
||||
String? state,
|
||||
int? registrationCode,
|
||||
int? receiverRealNumberOfCarcasses,
|
||||
int? receiverRealWeightOfCarcasses,
|
||||
int? weightLossOfCarcasses,
|
||||
}) = _StewardAllocationRequest;
|
||||
|
||||
factory StewardAllocationRequest.fromJson(Map<String, dynamic> json) =>
|
||||
_$StewardAllocationRequestFromJson(json);
|
||||
}
|
||||
@@ -0,0 +1,295 @@
|
||||
// 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 'steward_allocation_request.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
/// @nodoc
|
||||
mixin _$StewardAllocationRequest {
|
||||
|
||||
bool? get checkAllocation; String? get allocationKey; String? get state; int? get registrationCode; int? get receiverRealNumberOfCarcasses; int? get receiverRealWeightOfCarcasses; int? get weightLossOfCarcasses;
|
||||
/// Create a copy of StewardAllocationRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$StewardAllocationRequestCopyWith<StewardAllocationRequest> get copyWith => _$StewardAllocationRequestCopyWithImpl<StewardAllocationRequest>(this as StewardAllocationRequest, _$identity);
|
||||
|
||||
/// Serializes this StewardAllocationRequest to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is StewardAllocationRequest&&(identical(other.checkAllocation, checkAllocation) || other.checkAllocation == checkAllocation)&&(identical(other.allocationKey, allocationKey) || other.allocationKey == allocationKey)&&(identical(other.state, state) || other.state == state)&&(identical(other.registrationCode, registrationCode) || other.registrationCode == registrationCode)&&(identical(other.receiverRealNumberOfCarcasses, receiverRealNumberOfCarcasses) || other.receiverRealNumberOfCarcasses == receiverRealNumberOfCarcasses)&&(identical(other.receiverRealWeightOfCarcasses, receiverRealWeightOfCarcasses) || other.receiverRealWeightOfCarcasses == receiverRealWeightOfCarcasses)&&(identical(other.weightLossOfCarcasses, weightLossOfCarcasses) || other.weightLossOfCarcasses == weightLossOfCarcasses));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,checkAllocation,allocationKey,state,registrationCode,receiverRealNumberOfCarcasses,receiverRealWeightOfCarcasses,weightLossOfCarcasses);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'StewardAllocationRequest(checkAllocation: $checkAllocation, allocationKey: $allocationKey, state: $state, registrationCode: $registrationCode, receiverRealNumberOfCarcasses: $receiverRealNumberOfCarcasses, receiverRealWeightOfCarcasses: $receiverRealWeightOfCarcasses, weightLossOfCarcasses: $weightLossOfCarcasses)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $StewardAllocationRequestCopyWith<$Res> {
|
||||
factory $StewardAllocationRequestCopyWith(StewardAllocationRequest value, $Res Function(StewardAllocationRequest) _then) = _$StewardAllocationRequestCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
bool? checkAllocation, String? allocationKey, String? state, int? registrationCode, int? receiverRealNumberOfCarcasses, int? receiverRealWeightOfCarcasses, int? weightLossOfCarcasses
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$StewardAllocationRequestCopyWithImpl<$Res>
|
||||
implements $StewardAllocationRequestCopyWith<$Res> {
|
||||
_$StewardAllocationRequestCopyWithImpl(this._self, this._then);
|
||||
|
||||
final StewardAllocationRequest _self;
|
||||
final $Res Function(StewardAllocationRequest) _then;
|
||||
|
||||
/// Create a copy of StewardAllocationRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? checkAllocation = freezed,Object? allocationKey = freezed,Object? state = freezed,Object? registrationCode = freezed,Object? receiverRealNumberOfCarcasses = freezed,Object? receiverRealWeightOfCarcasses = freezed,Object? weightLossOfCarcasses = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
checkAllocation: freezed == checkAllocation ? _self.checkAllocation : checkAllocation // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,allocationKey: freezed == allocationKey ? _self.allocationKey : allocationKey // ignore: cast_nullable_to_non_nullable
|
||||
as String?,state: freezed == state ? _self.state : state // ignore: cast_nullable_to_non_nullable
|
||||
as String?,registrationCode: freezed == registrationCode ? _self.registrationCode : registrationCode // ignore: cast_nullable_to_non_nullable
|
||||
as int?,receiverRealNumberOfCarcasses: freezed == receiverRealNumberOfCarcasses ? _self.receiverRealNumberOfCarcasses : receiverRealNumberOfCarcasses // ignore: cast_nullable_to_non_nullable
|
||||
as int?,receiverRealWeightOfCarcasses: freezed == receiverRealWeightOfCarcasses ? _self.receiverRealWeightOfCarcasses : receiverRealWeightOfCarcasses // ignore: cast_nullable_to_non_nullable
|
||||
as int?,weightLossOfCarcasses: freezed == weightLossOfCarcasses ? _self.weightLossOfCarcasses : weightLossOfCarcasses // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [StewardAllocationRequest].
|
||||
extension StewardAllocationRequestPatterns on StewardAllocationRequest {
|
||||
/// 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( _StewardAllocationRequest value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _StewardAllocationRequest() 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( _StewardAllocationRequest value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _StewardAllocationRequest():
|
||||
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( _StewardAllocationRequest value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _StewardAllocationRequest() 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( bool? checkAllocation, String? allocationKey, String? state, int? registrationCode, int? receiverRealNumberOfCarcasses, int? receiverRealWeightOfCarcasses, int? weightLossOfCarcasses)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _StewardAllocationRequest() when $default != null:
|
||||
return $default(_that.checkAllocation,_that.allocationKey,_that.state,_that.registrationCode,_that.receiverRealNumberOfCarcasses,_that.receiverRealWeightOfCarcasses,_that.weightLossOfCarcasses);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( bool? checkAllocation, String? allocationKey, String? state, int? registrationCode, int? receiverRealNumberOfCarcasses, int? receiverRealWeightOfCarcasses, int? weightLossOfCarcasses) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _StewardAllocationRequest():
|
||||
return $default(_that.checkAllocation,_that.allocationKey,_that.state,_that.registrationCode,_that.receiverRealNumberOfCarcasses,_that.receiverRealWeightOfCarcasses,_that.weightLossOfCarcasses);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( bool? checkAllocation, String? allocationKey, String? state, int? registrationCode, int? receiverRealNumberOfCarcasses, int? receiverRealWeightOfCarcasses, int? weightLossOfCarcasses)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _StewardAllocationRequest() when $default != null:
|
||||
return $default(_that.checkAllocation,_that.allocationKey,_that.state,_that.registrationCode,_that.receiverRealNumberOfCarcasses,_that.receiverRealWeightOfCarcasses,_that.weightLossOfCarcasses);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
|
||||
class _StewardAllocationRequest implements StewardAllocationRequest {
|
||||
const _StewardAllocationRequest({this.checkAllocation, this.allocationKey, this.state, this.registrationCode, this.receiverRealNumberOfCarcasses, this.receiverRealWeightOfCarcasses, this.weightLossOfCarcasses});
|
||||
factory _StewardAllocationRequest.fromJson(Map<String, dynamic> json) => _$StewardAllocationRequestFromJson(json);
|
||||
|
||||
@override final bool? checkAllocation;
|
||||
@override final String? allocationKey;
|
||||
@override final String? state;
|
||||
@override final int? registrationCode;
|
||||
@override final int? receiverRealNumberOfCarcasses;
|
||||
@override final int? receiverRealWeightOfCarcasses;
|
||||
@override final int? weightLossOfCarcasses;
|
||||
|
||||
/// Create a copy of StewardAllocationRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$StewardAllocationRequestCopyWith<_StewardAllocationRequest> get copyWith => __$StewardAllocationRequestCopyWithImpl<_StewardAllocationRequest>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$StewardAllocationRequestToJson(this, );
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _StewardAllocationRequest&&(identical(other.checkAllocation, checkAllocation) || other.checkAllocation == checkAllocation)&&(identical(other.allocationKey, allocationKey) || other.allocationKey == allocationKey)&&(identical(other.state, state) || other.state == state)&&(identical(other.registrationCode, registrationCode) || other.registrationCode == registrationCode)&&(identical(other.receiverRealNumberOfCarcasses, receiverRealNumberOfCarcasses) || other.receiverRealNumberOfCarcasses == receiverRealNumberOfCarcasses)&&(identical(other.receiverRealWeightOfCarcasses, receiverRealWeightOfCarcasses) || other.receiverRealWeightOfCarcasses == receiverRealWeightOfCarcasses)&&(identical(other.weightLossOfCarcasses, weightLossOfCarcasses) || other.weightLossOfCarcasses == weightLossOfCarcasses));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,checkAllocation,allocationKey,state,registrationCode,receiverRealNumberOfCarcasses,receiverRealWeightOfCarcasses,weightLossOfCarcasses);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'StewardAllocationRequest(checkAllocation: $checkAllocation, allocationKey: $allocationKey, state: $state, registrationCode: $registrationCode, receiverRealNumberOfCarcasses: $receiverRealNumberOfCarcasses, receiverRealWeightOfCarcasses: $receiverRealWeightOfCarcasses, weightLossOfCarcasses: $weightLossOfCarcasses)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$StewardAllocationRequestCopyWith<$Res> implements $StewardAllocationRequestCopyWith<$Res> {
|
||||
factory _$StewardAllocationRequestCopyWith(_StewardAllocationRequest value, $Res Function(_StewardAllocationRequest) _then) = __$StewardAllocationRequestCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
bool? checkAllocation, String? allocationKey, String? state, int? registrationCode, int? receiverRealNumberOfCarcasses, int? receiverRealWeightOfCarcasses, int? weightLossOfCarcasses
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$StewardAllocationRequestCopyWithImpl<$Res>
|
||||
implements _$StewardAllocationRequestCopyWith<$Res> {
|
||||
__$StewardAllocationRequestCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _StewardAllocationRequest _self;
|
||||
final $Res Function(_StewardAllocationRequest) _then;
|
||||
|
||||
/// Create a copy of StewardAllocationRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? checkAllocation = freezed,Object? allocationKey = freezed,Object? state = freezed,Object? registrationCode = freezed,Object? receiverRealNumberOfCarcasses = freezed,Object? receiverRealWeightOfCarcasses = freezed,Object? weightLossOfCarcasses = freezed,}) {
|
||||
return _then(_StewardAllocationRequest(
|
||||
checkAllocation: freezed == checkAllocation ? _self.checkAllocation : checkAllocation // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,allocationKey: freezed == allocationKey ? _self.allocationKey : allocationKey // ignore: cast_nullable_to_non_nullable
|
||||
as String?,state: freezed == state ? _self.state : state // ignore: cast_nullable_to_non_nullable
|
||||
as String?,registrationCode: freezed == registrationCode ? _self.registrationCode : registrationCode // ignore: cast_nullable_to_non_nullable
|
||||
as int?,receiverRealNumberOfCarcasses: freezed == receiverRealNumberOfCarcasses ? _self.receiverRealNumberOfCarcasses : receiverRealNumberOfCarcasses // ignore: cast_nullable_to_non_nullable
|
||||
as int?,receiverRealWeightOfCarcasses: freezed == receiverRealWeightOfCarcasses ? _self.receiverRealWeightOfCarcasses : receiverRealWeightOfCarcasses // ignore: cast_nullable_to_non_nullable
|
||||
as int?,weightLossOfCarcasses: freezed == weightLossOfCarcasses ? _self.weightLossOfCarcasses : weightLossOfCarcasses // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// dart format on
|
||||
@@ -0,0 +1,33 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'steward_allocation_request.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_StewardAllocationRequest _$StewardAllocationRequestFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _StewardAllocationRequest(
|
||||
checkAllocation: json['check_allocation'] as bool?,
|
||||
allocationKey: json['allocation_key'] as String?,
|
||||
state: json['state'] as String?,
|
||||
registrationCode: (json['registration_code'] as num?)?.toInt(),
|
||||
receiverRealNumberOfCarcasses:
|
||||
(json['receiver_real_number_of_carcasses'] as num?)?.toInt(),
|
||||
receiverRealWeightOfCarcasses:
|
||||
(json['receiver_real_weight_of_carcasses'] as num?)?.toInt(),
|
||||
weightLossOfCarcasses: (json['weight_loss_of_carcasses'] as num?)?.toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$StewardAllocationRequestToJson(
|
||||
_StewardAllocationRequest instance,
|
||||
) => <String, dynamic>{
|
||||
'check_allocation': instance.checkAllocation,
|
||||
'allocation_key': instance.allocationKey,
|
||||
'state': instance.state,
|
||||
'registration_code': instance.registrationCode,
|
||||
'receiver_real_number_of_carcasses': instance.receiverRealNumberOfCarcasses,
|
||||
'receiver_real_weight_of_carcasses': instance.receiverRealWeightOfCarcasses,
|
||||
'weight_loss_of_carcasses': instance.weightLossOfCarcasses,
|
||||
};
|
||||
@@ -0,0 +1,20 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'steward_free_sale_bar_request.freezed.dart';
|
||||
part 'steward_free_sale_bar_request.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class StewardFreeSaleBarRequest with _$StewardFreeSaleBarRequest {
|
||||
const factory StewardFreeSaleBarRequest({
|
||||
String? buyerKey,
|
||||
int? numberOfCarcasses,
|
||||
int? weightOfCarcasses,
|
||||
String? date,
|
||||
String? clearanceCode,
|
||||
String? productKey,
|
||||
String? key,
|
||||
}) = _StewardFreeSaleBarRequest;
|
||||
|
||||
factory StewardFreeSaleBarRequest.fromJson(Map<String, dynamic> json) =>
|
||||
_$StewardFreeSaleBarRequestFromJson(json);
|
||||
}
|
||||
@@ -0,0 +1,295 @@
|
||||
// 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 'steward_free_sale_bar_request.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
/// @nodoc
|
||||
mixin _$StewardFreeSaleBarRequest {
|
||||
|
||||
String? get buyerKey; int? get numberOfCarcasses; int? get weightOfCarcasses; String? get date; String? get clearanceCode; String? get productKey; String? get key;
|
||||
/// Create a copy of StewardFreeSaleBarRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$StewardFreeSaleBarRequestCopyWith<StewardFreeSaleBarRequest> get copyWith => _$StewardFreeSaleBarRequestCopyWithImpl<StewardFreeSaleBarRequest>(this as StewardFreeSaleBarRequest, _$identity);
|
||||
|
||||
/// Serializes this StewardFreeSaleBarRequest to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is StewardFreeSaleBarRequest&&(identical(other.buyerKey, buyerKey) || other.buyerKey == buyerKey)&&(identical(other.numberOfCarcasses, numberOfCarcasses) || other.numberOfCarcasses == numberOfCarcasses)&&(identical(other.weightOfCarcasses, weightOfCarcasses) || other.weightOfCarcasses == weightOfCarcasses)&&(identical(other.date, date) || other.date == date)&&(identical(other.clearanceCode, clearanceCode) || other.clearanceCode == clearanceCode)&&(identical(other.productKey, productKey) || other.productKey == productKey)&&(identical(other.key, key) || other.key == key));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,buyerKey,numberOfCarcasses,weightOfCarcasses,date,clearanceCode,productKey,key);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'StewardFreeSaleBarRequest(buyerKey: $buyerKey, numberOfCarcasses: $numberOfCarcasses, weightOfCarcasses: $weightOfCarcasses, date: $date, clearanceCode: $clearanceCode, productKey: $productKey, key: $key)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $StewardFreeSaleBarRequestCopyWith<$Res> {
|
||||
factory $StewardFreeSaleBarRequestCopyWith(StewardFreeSaleBarRequest value, $Res Function(StewardFreeSaleBarRequest) _then) = _$StewardFreeSaleBarRequestCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
String? buyerKey, int? numberOfCarcasses, int? weightOfCarcasses, String? date, String? clearanceCode, String? productKey, String? key
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$StewardFreeSaleBarRequestCopyWithImpl<$Res>
|
||||
implements $StewardFreeSaleBarRequestCopyWith<$Res> {
|
||||
_$StewardFreeSaleBarRequestCopyWithImpl(this._self, this._then);
|
||||
|
||||
final StewardFreeSaleBarRequest _self;
|
||||
final $Res Function(StewardFreeSaleBarRequest) _then;
|
||||
|
||||
/// Create a copy of StewardFreeSaleBarRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? buyerKey = freezed,Object? numberOfCarcasses = freezed,Object? weightOfCarcasses = freezed,Object? date = freezed,Object? clearanceCode = freezed,Object? productKey = freezed,Object? key = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
buyerKey: freezed == buyerKey ? _self.buyerKey : buyerKey // ignore: cast_nullable_to_non_nullable
|
||||
as String?,numberOfCarcasses: freezed == numberOfCarcasses ? _self.numberOfCarcasses : numberOfCarcasses // ignore: cast_nullable_to_non_nullable
|
||||
as int?,weightOfCarcasses: freezed == weightOfCarcasses ? _self.weightOfCarcasses : weightOfCarcasses // ignore: cast_nullable_to_non_nullable
|
||||
as int?,date: freezed == date ? _self.date : date // ignore: cast_nullable_to_non_nullable
|
||||
as String?,clearanceCode: freezed == clearanceCode ? _self.clearanceCode : clearanceCode // ignore: cast_nullable_to_non_nullable
|
||||
as String?,productKey: freezed == productKey ? _self.productKey : productKey // ignore: cast_nullable_to_non_nullable
|
||||
as String?,key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [StewardFreeSaleBarRequest].
|
||||
extension StewardFreeSaleBarRequestPatterns on StewardFreeSaleBarRequest {
|
||||
/// 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( _StewardFreeSaleBarRequest value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _StewardFreeSaleBarRequest() 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( _StewardFreeSaleBarRequest value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _StewardFreeSaleBarRequest():
|
||||
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( _StewardFreeSaleBarRequest value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _StewardFreeSaleBarRequest() 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? buyerKey, int? numberOfCarcasses, int? weightOfCarcasses, String? date, String? clearanceCode, String? productKey, String? key)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _StewardFreeSaleBarRequest() when $default != null:
|
||||
return $default(_that.buyerKey,_that.numberOfCarcasses,_that.weightOfCarcasses,_that.date,_that.clearanceCode,_that.productKey,_that.key);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? buyerKey, int? numberOfCarcasses, int? weightOfCarcasses, String? date, String? clearanceCode, String? productKey, String? key) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _StewardFreeSaleBarRequest():
|
||||
return $default(_that.buyerKey,_that.numberOfCarcasses,_that.weightOfCarcasses,_that.date,_that.clearanceCode,_that.productKey,_that.key);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? buyerKey, int? numberOfCarcasses, int? weightOfCarcasses, String? date, String? clearanceCode, String? productKey, String? key)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _StewardFreeSaleBarRequest() when $default != null:
|
||||
return $default(_that.buyerKey,_that.numberOfCarcasses,_that.weightOfCarcasses,_that.date,_that.clearanceCode,_that.productKey,_that.key);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
|
||||
class _StewardFreeSaleBarRequest implements StewardFreeSaleBarRequest {
|
||||
const _StewardFreeSaleBarRequest({this.buyerKey, this.numberOfCarcasses, this.weightOfCarcasses, this.date, this.clearanceCode, this.productKey, this.key});
|
||||
factory _StewardFreeSaleBarRequest.fromJson(Map<String, dynamic> json) => _$StewardFreeSaleBarRequestFromJson(json);
|
||||
|
||||
@override final String? buyerKey;
|
||||
@override final int? numberOfCarcasses;
|
||||
@override final int? weightOfCarcasses;
|
||||
@override final String? date;
|
||||
@override final String? clearanceCode;
|
||||
@override final String? productKey;
|
||||
@override final String? key;
|
||||
|
||||
/// Create a copy of StewardFreeSaleBarRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$StewardFreeSaleBarRequestCopyWith<_StewardFreeSaleBarRequest> get copyWith => __$StewardFreeSaleBarRequestCopyWithImpl<_StewardFreeSaleBarRequest>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$StewardFreeSaleBarRequestToJson(this, );
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _StewardFreeSaleBarRequest&&(identical(other.buyerKey, buyerKey) || other.buyerKey == buyerKey)&&(identical(other.numberOfCarcasses, numberOfCarcasses) || other.numberOfCarcasses == numberOfCarcasses)&&(identical(other.weightOfCarcasses, weightOfCarcasses) || other.weightOfCarcasses == weightOfCarcasses)&&(identical(other.date, date) || other.date == date)&&(identical(other.clearanceCode, clearanceCode) || other.clearanceCode == clearanceCode)&&(identical(other.productKey, productKey) || other.productKey == productKey)&&(identical(other.key, key) || other.key == key));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,buyerKey,numberOfCarcasses,weightOfCarcasses,date,clearanceCode,productKey,key);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'StewardFreeSaleBarRequest(buyerKey: $buyerKey, numberOfCarcasses: $numberOfCarcasses, weightOfCarcasses: $weightOfCarcasses, date: $date, clearanceCode: $clearanceCode, productKey: $productKey, key: $key)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$StewardFreeSaleBarRequestCopyWith<$Res> implements $StewardFreeSaleBarRequestCopyWith<$Res> {
|
||||
factory _$StewardFreeSaleBarRequestCopyWith(_StewardFreeSaleBarRequest value, $Res Function(_StewardFreeSaleBarRequest) _then) = __$StewardFreeSaleBarRequestCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
String? buyerKey, int? numberOfCarcasses, int? weightOfCarcasses, String? date, String? clearanceCode, String? productKey, String? key
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$StewardFreeSaleBarRequestCopyWithImpl<$Res>
|
||||
implements _$StewardFreeSaleBarRequestCopyWith<$Res> {
|
||||
__$StewardFreeSaleBarRequestCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _StewardFreeSaleBarRequest _self;
|
||||
final $Res Function(_StewardFreeSaleBarRequest) _then;
|
||||
|
||||
/// Create a copy of StewardFreeSaleBarRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? buyerKey = freezed,Object? numberOfCarcasses = freezed,Object? weightOfCarcasses = freezed,Object? date = freezed,Object? clearanceCode = freezed,Object? productKey = freezed,Object? key = freezed,}) {
|
||||
return _then(_StewardFreeSaleBarRequest(
|
||||
buyerKey: freezed == buyerKey ? _self.buyerKey : buyerKey // ignore: cast_nullable_to_non_nullable
|
||||
as String?,numberOfCarcasses: freezed == numberOfCarcasses ? _self.numberOfCarcasses : numberOfCarcasses // ignore: cast_nullable_to_non_nullable
|
||||
as int?,weightOfCarcasses: freezed == weightOfCarcasses ? _self.weightOfCarcasses : weightOfCarcasses // ignore: cast_nullable_to_non_nullable
|
||||
as int?,date: freezed == date ? _self.date : date // ignore: cast_nullable_to_non_nullable
|
||||
as String?,clearanceCode: freezed == clearanceCode ? _self.clearanceCode : clearanceCode // ignore: cast_nullable_to_non_nullable
|
||||
as String?,productKey: freezed == productKey ? _self.productKey : productKey // ignore: cast_nullable_to_non_nullable
|
||||
as String?,key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// dart format on
|
||||
@@ -0,0 +1,31 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'steward_free_sale_bar_request.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_StewardFreeSaleBarRequest _$StewardFreeSaleBarRequestFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _StewardFreeSaleBarRequest(
|
||||
buyerKey: json['buyer_key'] as String?,
|
||||
numberOfCarcasses: (json['number_of_carcasses'] as num?)?.toInt(),
|
||||
weightOfCarcasses: (json['weight_of_carcasses'] as num?)?.toInt(),
|
||||
date: json['date'] as String?,
|
||||
clearanceCode: json['clearance_code'] as String?,
|
||||
productKey: json['product_key'] as String?,
|
||||
key: json['key'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$StewardFreeSaleBarRequestToJson(
|
||||
_StewardFreeSaleBarRequest instance,
|
||||
) => <String, dynamic>{
|
||||
'buyer_key': instance.buyerKey,
|
||||
'number_of_carcasses': instance.numberOfCarcasses,
|
||||
'weight_of_carcasses': instance.weightOfCarcasses,
|
||||
'date': instance.date,
|
||||
'clearance_code': instance.clearanceCode,
|
||||
'product_key': instance.productKey,
|
||||
'key': instance.key,
|
||||
};
|
||||
@@ -0,0 +1,29 @@
|
||||
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'submit_kill_house_free_bar.freezed.dart';
|
||||
part 'submit_kill_house_free_bar.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class SubmitKillHouseFreeBar with _$SubmitKillHouseFreeBar {
|
||||
const factory SubmitKillHouseFreeBar({
|
||||
String? driverName,
|
||||
String? driverMobile,
|
||||
String? poultryName,
|
||||
String? poultryMobile,
|
||||
String? province,
|
||||
String? city,
|
||||
String? barClearanceCode,
|
||||
String? barImage,
|
||||
String? killerKey,
|
||||
String? date,
|
||||
String? buyType,
|
||||
String? productKey,
|
||||
String? car,
|
||||
String? numberOfCarcasses,
|
||||
String? weightOfCarcasses,
|
||||
}) = _SubmitKillHouseFreeBar;
|
||||
|
||||
factory SubmitKillHouseFreeBar.fromJson(Map<String, dynamic> json) =>
|
||||
_$SubmitKillHouseFreeBarFromJson(json);
|
||||
}
|
||||
@@ -0,0 +1,319 @@
|
||||
// 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 'submit_kill_house_free_bar.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
/// @nodoc
|
||||
mixin _$SubmitKillHouseFreeBar {
|
||||
|
||||
String? get driverName; String? get driverMobile; String? get poultryName; String? get poultryMobile; String? get province; String? get city; String? get barClearanceCode; String? get barImage; String? get killerKey; String? get date; String? get buyType; String? get productKey; String? get car; String? get numberOfCarcasses; String? get weightOfCarcasses;
|
||||
/// Create a copy of SubmitKillHouseFreeBar
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$SubmitKillHouseFreeBarCopyWith<SubmitKillHouseFreeBar> get copyWith => _$SubmitKillHouseFreeBarCopyWithImpl<SubmitKillHouseFreeBar>(this as SubmitKillHouseFreeBar, _$identity);
|
||||
|
||||
/// Serializes this SubmitKillHouseFreeBar to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is SubmitKillHouseFreeBar&&(identical(other.driverName, driverName) || other.driverName == driverName)&&(identical(other.driverMobile, driverMobile) || other.driverMobile == driverMobile)&&(identical(other.poultryName, poultryName) || other.poultryName == poultryName)&&(identical(other.poultryMobile, poultryMobile) || other.poultryMobile == poultryMobile)&&(identical(other.province, province) || other.province == province)&&(identical(other.city, city) || other.city == city)&&(identical(other.barClearanceCode, barClearanceCode) || other.barClearanceCode == barClearanceCode)&&(identical(other.barImage, barImage) || other.barImage == barImage)&&(identical(other.killerKey, killerKey) || other.killerKey == killerKey)&&(identical(other.date, date) || other.date == date)&&(identical(other.buyType, buyType) || other.buyType == buyType)&&(identical(other.productKey, productKey) || other.productKey == productKey)&&(identical(other.car, car) || other.car == car)&&(identical(other.numberOfCarcasses, numberOfCarcasses) || other.numberOfCarcasses == numberOfCarcasses)&&(identical(other.weightOfCarcasses, weightOfCarcasses) || other.weightOfCarcasses == weightOfCarcasses));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,driverName,driverMobile,poultryName,poultryMobile,province,city,barClearanceCode,barImage,killerKey,date,buyType,productKey,car,numberOfCarcasses,weightOfCarcasses);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'SubmitKillHouseFreeBar(driverName: $driverName, driverMobile: $driverMobile, poultryName: $poultryName, poultryMobile: $poultryMobile, province: $province, city: $city, barClearanceCode: $barClearanceCode, barImage: $barImage, killerKey: $killerKey, date: $date, buyType: $buyType, productKey: $productKey, car: $car, numberOfCarcasses: $numberOfCarcasses, weightOfCarcasses: $weightOfCarcasses)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $SubmitKillHouseFreeBarCopyWith<$Res> {
|
||||
factory $SubmitKillHouseFreeBarCopyWith(SubmitKillHouseFreeBar value, $Res Function(SubmitKillHouseFreeBar) _then) = _$SubmitKillHouseFreeBarCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
String? driverName, String? driverMobile, String? poultryName, String? poultryMobile, String? province, String? city, String? barClearanceCode, String? barImage, String? killerKey, String? date, String? buyType, String? productKey, String? car, String? numberOfCarcasses, String? weightOfCarcasses
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$SubmitKillHouseFreeBarCopyWithImpl<$Res>
|
||||
implements $SubmitKillHouseFreeBarCopyWith<$Res> {
|
||||
_$SubmitKillHouseFreeBarCopyWithImpl(this._self, this._then);
|
||||
|
||||
final SubmitKillHouseFreeBar _self;
|
||||
final $Res Function(SubmitKillHouseFreeBar) _then;
|
||||
|
||||
/// Create a copy of SubmitKillHouseFreeBar
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? driverName = freezed,Object? driverMobile = freezed,Object? poultryName = freezed,Object? poultryMobile = freezed,Object? province = freezed,Object? city = freezed,Object? barClearanceCode = freezed,Object? barImage = freezed,Object? killerKey = freezed,Object? date = freezed,Object? buyType = freezed,Object? productKey = freezed,Object? car = freezed,Object? numberOfCarcasses = freezed,Object? weightOfCarcasses = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
driverName: freezed == driverName ? _self.driverName : driverName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,driverMobile: freezed == driverMobile ? _self.driverMobile : driverMobile // ignore: cast_nullable_to_non_nullable
|
||||
as String?,poultryName: freezed == poultryName ? _self.poultryName : poultryName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,poultryMobile: freezed == poultryMobile ? _self.poultryMobile : poultryMobile // ignore: cast_nullable_to_non_nullable
|
||||
as String?,province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable
|
||||
as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable
|
||||
as String?,barClearanceCode: freezed == barClearanceCode ? _self.barClearanceCode : barClearanceCode // ignore: cast_nullable_to_non_nullable
|
||||
as String?,barImage: freezed == barImage ? _self.barImage : barImage // ignore: cast_nullable_to_non_nullable
|
||||
as String?,killerKey: freezed == killerKey ? _self.killerKey : killerKey // ignore: cast_nullable_to_non_nullable
|
||||
as String?,date: freezed == date ? _self.date : date // ignore: cast_nullable_to_non_nullable
|
||||
as String?,buyType: freezed == buyType ? _self.buyType : buyType // ignore: cast_nullable_to_non_nullable
|
||||
as String?,productKey: freezed == productKey ? _self.productKey : productKey // ignore: cast_nullable_to_non_nullable
|
||||
as String?,car: freezed == car ? _self.car : car // ignore: cast_nullable_to_non_nullable
|
||||
as String?,numberOfCarcasses: freezed == numberOfCarcasses ? _self.numberOfCarcasses : numberOfCarcasses // ignore: cast_nullable_to_non_nullable
|
||||
as String?,weightOfCarcasses: freezed == weightOfCarcasses ? _self.weightOfCarcasses : weightOfCarcasses // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [SubmitKillHouseFreeBar].
|
||||
extension SubmitKillHouseFreeBarPatterns on SubmitKillHouseFreeBar {
|
||||
/// 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( _SubmitKillHouseFreeBar value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _SubmitKillHouseFreeBar() 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( _SubmitKillHouseFreeBar value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _SubmitKillHouseFreeBar():
|
||||
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( _SubmitKillHouseFreeBar value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _SubmitKillHouseFreeBar() 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? driverName, String? driverMobile, String? poultryName, String? poultryMobile, String? province, String? city, String? barClearanceCode, String? barImage, String? killerKey, String? date, String? buyType, String? productKey, String? car, String? numberOfCarcasses, String? weightOfCarcasses)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _SubmitKillHouseFreeBar() when $default != null:
|
||||
return $default(_that.driverName,_that.driverMobile,_that.poultryName,_that.poultryMobile,_that.province,_that.city,_that.barClearanceCode,_that.barImage,_that.killerKey,_that.date,_that.buyType,_that.productKey,_that.car,_that.numberOfCarcasses,_that.weightOfCarcasses);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? driverName, String? driverMobile, String? poultryName, String? poultryMobile, String? province, String? city, String? barClearanceCode, String? barImage, String? killerKey, String? date, String? buyType, String? productKey, String? car, String? numberOfCarcasses, String? weightOfCarcasses) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _SubmitKillHouseFreeBar():
|
||||
return $default(_that.driverName,_that.driverMobile,_that.poultryName,_that.poultryMobile,_that.province,_that.city,_that.barClearanceCode,_that.barImage,_that.killerKey,_that.date,_that.buyType,_that.productKey,_that.car,_that.numberOfCarcasses,_that.weightOfCarcasses);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? driverName, String? driverMobile, String? poultryName, String? poultryMobile, String? province, String? city, String? barClearanceCode, String? barImage, String? killerKey, String? date, String? buyType, String? productKey, String? car, String? numberOfCarcasses, String? weightOfCarcasses)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _SubmitKillHouseFreeBar() when $default != null:
|
||||
return $default(_that.driverName,_that.driverMobile,_that.poultryName,_that.poultryMobile,_that.province,_that.city,_that.barClearanceCode,_that.barImage,_that.killerKey,_that.date,_that.buyType,_that.productKey,_that.car,_that.numberOfCarcasses,_that.weightOfCarcasses);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
|
||||
class _SubmitKillHouseFreeBar implements SubmitKillHouseFreeBar {
|
||||
const _SubmitKillHouseFreeBar({this.driverName, this.driverMobile, this.poultryName, this.poultryMobile, this.province, this.city, this.barClearanceCode, this.barImage, this.killerKey, this.date, this.buyType, this.productKey, this.car, this.numberOfCarcasses, this.weightOfCarcasses});
|
||||
factory _SubmitKillHouseFreeBar.fromJson(Map<String, dynamic> json) => _$SubmitKillHouseFreeBarFromJson(json);
|
||||
|
||||
@override final String? driverName;
|
||||
@override final String? driverMobile;
|
||||
@override final String? poultryName;
|
||||
@override final String? poultryMobile;
|
||||
@override final String? province;
|
||||
@override final String? city;
|
||||
@override final String? barClearanceCode;
|
||||
@override final String? barImage;
|
||||
@override final String? killerKey;
|
||||
@override final String? date;
|
||||
@override final String? buyType;
|
||||
@override final String? productKey;
|
||||
@override final String? car;
|
||||
@override final String? numberOfCarcasses;
|
||||
@override final String? weightOfCarcasses;
|
||||
|
||||
/// Create a copy of SubmitKillHouseFreeBar
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$SubmitKillHouseFreeBarCopyWith<_SubmitKillHouseFreeBar> get copyWith => __$SubmitKillHouseFreeBarCopyWithImpl<_SubmitKillHouseFreeBar>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$SubmitKillHouseFreeBarToJson(this, );
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _SubmitKillHouseFreeBar&&(identical(other.driverName, driverName) || other.driverName == driverName)&&(identical(other.driverMobile, driverMobile) || other.driverMobile == driverMobile)&&(identical(other.poultryName, poultryName) || other.poultryName == poultryName)&&(identical(other.poultryMobile, poultryMobile) || other.poultryMobile == poultryMobile)&&(identical(other.province, province) || other.province == province)&&(identical(other.city, city) || other.city == city)&&(identical(other.barClearanceCode, barClearanceCode) || other.barClearanceCode == barClearanceCode)&&(identical(other.barImage, barImage) || other.barImage == barImage)&&(identical(other.killerKey, killerKey) || other.killerKey == killerKey)&&(identical(other.date, date) || other.date == date)&&(identical(other.buyType, buyType) || other.buyType == buyType)&&(identical(other.productKey, productKey) || other.productKey == productKey)&&(identical(other.car, car) || other.car == car)&&(identical(other.numberOfCarcasses, numberOfCarcasses) || other.numberOfCarcasses == numberOfCarcasses)&&(identical(other.weightOfCarcasses, weightOfCarcasses) || other.weightOfCarcasses == weightOfCarcasses));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,driverName,driverMobile,poultryName,poultryMobile,province,city,barClearanceCode,barImage,killerKey,date,buyType,productKey,car,numberOfCarcasses,weightOfCarcasses);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'SubmitKillHouseFreeBar(driverName: $driverName, driverMobile: $driverMobile, poultryName: $poultryName, poultryMobile: $poultryMobile, province: $province, city: $city, barClearanceCode: $barClearanceCode, barImage: $barImage, killerKey: $killerKey, date: $date, buyType: $buyType, productKey: $productKey, car: $car, numberOfCarcasses: $numberOfCarcasses, weightOfCarcasses: $weightOfCarcasses)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$SubmitKillHouseFreeBarCopyWith<$Res> implements $SubmitKillHouseFreeBarCopyWith<$Res> {
|
||||
factory _$SubmitKillHouseFreeBarCopyWith(_SubmitKillHouseFreeBar value, $Res Function(_SubmitKillHouseFreeBar) _then) = __$SubmitKillHouseFreeBarCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
String? driverName, String? driverMobile, String? poultryName, String? poultryMobile, String? province, String? city, String? barClearanceCode, String? barImage, String? killerKey, String? date, String? buyType, String? productKey, String? car, String? numberOfCarcasses, String? weightOfCarcasses
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$SubmitKillHouseFreeBarCopyWithImpl<$Res>
|
||||
implements _$SubmitKillHouseFreeBarCopyWith<$Res> {
|
||||
__$SubmitKillHouseFreeBarCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _SubmitKillHouseFreeBar _self;
|
||||
final $Res Function(_SubmitKillHouseFreeBar) _then;
|
||||
|
||||
/// Create a copy of SubmitKillHouseFreeBar
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? driverName = freezed,Object? driverMobile = freezed,Object? poultryName = freezed,Object? poultryMobile = freezed,Object? province = freezed,Object? city = freezed,Object? barClearanceCode = freezed,Object? barImage = freezed,Object? killerKey = freezed,Object? date = freezed,Object? buyType = freezed,Object? productKey = freezed,Object? car = freezed,Object? numberOfCarcasses = freezed,Object? weightOfCarcasses = freezed,}) {
|
||||
return _then(_SubmitKillHouseFreeBar(
|
||||
driverName: freezed == driverName ? _self.driverName : driverName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,driverMobile: freezed == driverMobile ? _self.driverMobile : driverMobile // ignore: cast_nullable_to_non_nullable
|
||||
as String?,poultryName: freezed == poultryName ? _self.poultryName : poultryName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,poultryMobile: freezed == poultryMobile ? _self.poultryMobile : poultryMobile // ignore: cast_nullable_to_non_nullable
|
||||
as String?,province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable
|
||||
as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable
|
||||
as String?,barClearanceCode: freezed == barClearanceCode ? _self.barClearanceCode : barClearanceCode // ignore: cast_nullable_to_non_nullable
|
||||
as String?,barImage: freezed == barImage ? _self.barImage : barImage // ignore: cast_nullable_to_non_nullable
|
||||
as String?,killerKey: freezed == killerKey ? _self.killerKey : killerKey // ignore: cast_nullable_to_non_nullable
|
||||
as String?,date: freezed == date ? _self.date : date // ignore: cast_nullable_to_non_nullable
|
||||
as String?,buyType: freezed == buyType ? _self.buyType : buyType // ignore: cast_nullable_to_non_nullable
|
||||
as String?,productKey: freezed == productKey ? _self.productKey : productKey // ignore: cast_nullable_to_non_nullable
|
||||
as String?,car: freezed == car ? _self.car : car // ignore: cast_nullable_to_non_nullable
|
||||
as String?,numberOfCarcasses: freezed == numberOfCarcasses ? _self.numberOfCarcasses : numberOfCarcasses // ignore: cast_nullable_to_non_nullable
|
||||
as String?,weightOfCarcasses: freezed == weightOfCarcasses ? _self.weightOfCarcasses : weightOfCarcasses // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// dart format on
|
||||
@@ -0,0 +1,47 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'submit_kill_house_free_bar.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_SubmitKillHouseFreeBar _$SubmitKillHouseFreeBarFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _SubmitKillHouseFreeBar(
|
||||
driverName: json['driver_name'] as String?,
|
||||
driverMobile: json['driver_mobile'] as String?,
|
||||
poultryName: json['poultry_name'] as String?,
|
||||
poultryMobile: json['poultry_mobile'] as String?,
|
||||
province: json['province'] as String?,
|
||||
city: json['city'] as String?,
|
||||
barClearanceCode: json['bar_clearance_code'] as String?,
|
||||
barImage: json['bar_image'] as String?,
|
||||
killerKey: json['killer_key'] as String?,
|
||||
date: json['date'] as String?,
|
||||
buyType: json['buy_type'] as String?,
|
||||
productKey: json['product_key'] as String?,
|
||||
car: json['car'] as String?,
|
||||
numberOfCarcasses: json['number_of_carcasses'] as String?,
|
||||
weightOfCarcasses: json['weight_of_carcasses'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$SubmitKillHouseFreeBarToJson(
|
||||
_SubmitKillHouseFreeBar instance,
|
||||
) => <String, dynamic>{
|
||||
'driver_name': instance.driverName,
|
||||
'driver_mobile': instance.driverMobile,
|
||||
'poultry_name': instance.poultryName,
|
||||
'poultry_mobile': instance.poultryMobile,
|
||||
'province': instance.province,
|
||||
'city': instance.city,
|
||||
'bar_clearance_code': instance.barClearanceCode,
|
||||
'bar_image': instance.barImage,
|
||||
'killer_key': instance.killerKey,
|
||||
'date': instance.date,
|
||||
'buy_type': instance.buyType,
|
||||
'product_key': instance.productKey,
|
||||
'car': instance.car,
|
||||
'number_of_carcasses': instance.numberOfCarcasses,
|
||||
'weight_of_carcasses': instance.weightOfCarcasses,
|
||||
};
|
||||
@@ -0,0 +1,26 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'submit_steward_allocation.freezed.dart';
|
||||
part 'submit_steward_allocation.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class SubmitStewardAllocation with _$SubmitStewardAllocation {
|
||||
const factory SubmitStewardAllocation({
|
||||
String? sellerType,
|
||||
String? buyerType,
|
||||
String? guildKey,
|
||||
String? productKey,
|
||||
String? type,
|
||||
String? allocationType,
|
||||
int? numberOfCarcasses,
|
||||
int? weightOfCarcasses,
|
||||
String? sellType,
|
||||
int? amount,
|
||||
int? totalAmount,
|
||||
bool? approvedPriceStatus,
|
||||
String? date,
|
||||
}) = _SubmitStewardAllocation;
|
||||
|
||||
factory SubmitStewardAllocation.fromJson(Map<String, dynamic> json) =>
|
||||
_$SubmitStewardAllocationFromJson(json);
|
||||
}
|
||||
@@ -0,0 +1,313 @@
|
||||
// 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 'submit_steward_allocation.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
/// @nodoc
|
||||
mixin _$SubmitStewardAllocation {
|
||||
|
||||
String? get sellerType; String? get buyerType; String? get guildKey; String? get productKey; String? get type; String? get allocationType; int? get numberOfCarcasses; int? get weightOfCarcasses; String? get sellType; int? get amount; int? get totalAmount; bool? get approvedPriceStatus; String? get date;
|
||||
/// Create a copy of SubmitStewardAllocation
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$SubmitStewardAllocationCopyWith<SubmitStewardAllocation> get copyWith => _$SubmitStewardAllocationCopyWithImpl<SubmitStewardAllocation>(this as SubmitStewardAllocation, _$identity);
|
||||
|
||||
/// Serializes this SubmitStewardAllocation to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is SubmitStewardAllocation&&(identical(other.sellerType, sellerType) || other.sellerType == sellerType)&&(identical(other.buyerType, buyerType) || other.buyerType == buyerType)&&(identical(other.guildKey, guildKey) || other.guildKey == guildKey)&&(identical(other.productKey, productKey) || other.productKey == productKey)&&(identical(other.type, type) || other.type == type)&&(identical(other.allocationType, allocationType) || other.allocationType == allocationType)&&(identical(other.numberOfCarcasses, numberOfCarcasses) || other.numberOfCarcasses == numberOfCarcasses)&&(identical(other.weightOfCarcasses, weightOfCarcasses) || other.weightOfCarcasses == weightOfCarcasses)&&(identical(other.sellType, sellType) || other.sellType == sellType)&&(identical(other.amount, amount) || other.amount == amount)&&(identical(other.totalAmount, totalAmount) || other.totalAmount == totalAmount)&&(identical(other.approvedPriceStatus, approvedPriceStatus) || other.approvedPriceStatus == approvedPriceStatus)&&(identical(other.date, date) || other.date == date));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,sellerType,buyerType,guildKey,productKey,type,allocationType,numberOfCarcasses,weightOfCarcasses,sellType,amount,totalAmount,approvedPriceStatus,date);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'SubmitStewardAllocation(sellerType: $sellerType, buyerType: $buyerType, guildKey: $guildKey, productKey: $productKey, type: $type, allocationType: $allocationType, numberOfCarcasses: $numberOfCarcasses, weightOfCarcasses: $weightOfCarcasses, sellType: $sellType, amount: $amount, totalAmount: $totalAmount, approvedPriceStatus: $approvedPriceStatus, date: $date)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $SubmitStewardAllocationCopyWith<$Res> {
|
||||
factory $SubmitStewardAllocationCopyWith(SubmitStewardAllocation value, $Res Function(SubmitStewardAllocation) _then) = _$SubmitStewardAllocationCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
String? sellerType, String? buyerType, String? guildKey, String? productKey, String? type, String? allocationType, int? numberOfCarcasses, int? weightOfCarcasses, String? sellType, int? amount, int? totalAmount, bool? approvedPriceStatus, String? date
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$SubmitStewardAllocationCopyWithImpl<$Res>
|
||||
implements $SubmitStewardAllocationCopyWith<$Res> {
|
||||
_$SubmitStewardAllocationCopyWithImpl(this._self, this._then);
|
||||
|
||||
final SubmitStewardAllocation _self;
|
||||
final $Res Function(SubmitStewardAllocation) _then;
|
||||
|
||||
/// Create a copy of SubmitStewardAllocation
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? sellerType = freezed,Object? buyerType = freezed,Object? guildKey = freezed,Object? productKey = freezed,Object? type = freezed,Object? allocationType = freezed,Object? numberOfCarcasses = freezed,Object? weightOfCarcasses = freezed,Object? sellType = freezed,Object? amount = freezed,Object? totalAmount = freezed,Object? approvedPriceStatus = freezed,Object? date = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
sellerType: freezed == sellerType ? _self.sellerType : sellerType // ignore: cast_nullable_to_non_nullable
|
||||
as String?,buyerType: freezed == buyerType ? _self.buyerType : buyerType // ignore: cast_nullable_to_non_nullable
|
||||
as String?,guildKey: freezed == guildKey ? _self.guildKey : guildKey // ignore: cast_nullable_to_non_nullable
|
||||
as String?,productKey: freezed == productKey ? _self.productKey : productKey // ignore: cast_nullable_to_non_nullable
|
||||
as String?,type: freezed == type ? _self.type : type // ignore: cast_nullable_to_non_nullable
|
||||
as String?,allocationType: freezed == allocationType ? _self.allocationType : allocationType // ignore: cast_nullable_to_non_nullable
|
||||
as String?,numberOfCarcasses: freezed == numberOfCarcasses ? _self.numberOfCarcasses : numberOfCarcasses // ignore: cast_nullable_to_non_nullable
|
||||
as int?,weightOfCarcasses: freezed == weightOfCarcasses ? _self.weightOfCarcasses : weightOfCarcasses // ignore: cast_nullable_to_non_nullable
|
||||
as int?,sellType: freezed == sellType ? _self.sellType : sellType // ignore: cast_nullable_to_non_nullable
|
||||
as String?,amount: freezed == amount ? _self.amount : amount // ignore: cast_nullable_to_non_nullable
|
||||
as int?,totalAmount: freezed == totalAmount ? _self.totalAmount : totalAmount // ignore: cast_nullable_to_non_nullable
|
||||
as int?,approvedPriceStatus: freezed == approvedPriceStatus ? _self.approvedPriceStatus : approvedPriceStatus // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,date: freezed == date ? _self.date : date // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [SubmitStewardAllocation].
|
||||
extension SubmitStewardAllocationPatterns on SubmitStewardAllocation {
|
||||
/// 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( _SubmitStewardAllocation value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _SubmitStewardAllocation() 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( _SubmitStewardAllocation value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _SubmitStewardAllocation():
|
||||
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( _SubmitStewardAllocation value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _SubmitStewardAllocation() 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? sellerType, String? buyerType, String? guildKey, String? productKey, String? type, String? allocationType, int? numberOfCarcasses, int? weightOfCarcasses, String? sellType, int? amount, int? totalAmount, bool? approvedPriceStatus, String? date)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _SubmitStewardAllocation() when $default != null:
|
||||
return $default(_that.sellerType,_that.buyerType,_that.guildKey,_that.productKey,_that.type,_that.allocationType,_that.numberOfCarcasses,_that.weightOfCarcasses,_that.sellType,_that.amount,_that.totalAmount,_that.approvedPriceStatus,_that.date);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? sellerType, String? buyerType, String? guildKey, String? productKey, String? type, String? allocationType, int? numberOfCarcasses, int? weightOfCarcasses, String? sellType, int? amount, int? totalAmount, bool? approvedPriceStatus, String? date) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _SubmitStewardAllocation():
|
||||
return $default(_that.sellerType,_that.buyerType,_that.guildKey,_that.productKey,_that.type,_that.allocationType,_that.numberOfCarcasses,_that.weightOfCarcasses,_that.sellType,_that.amount,_that.totalAmount,_that.approvedPriceStatus,_that.date);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? sellerType, String? buyerType, String? guildKey, String? productKey, String? type, String? allocationType, int? numberOfCarcasses, int? weightOfCarcasses, String? sellType, int? amount, int? totalAmount, bool? approvedPriceStatus, String? date)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _SubmitStewardAllocation() when $default != null:
|
||||
return $default(_that.sellerType,_that.buyerType,_that.guildKey,_that.productKey,_that.type,_that.allocationType,_that.numberOfCarcasses,_that.weightOfCarcasses,_that.sellType,_that.amount,_that.totalAmount,_that.approvedPriceStatus,_that.date);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
|
||||
class _SubmitStewardAllocation implements SubmitStewardAllocation {
|
||||
const _SubmitStewardAllocation({this.sellerType, this.buyerType, this.guildKey, this.productKey, this.type, this.allocationType, this.numberOfCarcasses, this.weightOfCarcasses, this.sellType, this.amount, this.totalAmount, this.approvedPriceStatus, this.date});
|
||||
factory _SubmitStewardAllocation.fromJson(Map<String, dynamic> json) => _$SubmitStewardAllocationFromJson(json);
|
||||
|
||||
@override final String? sellerType;
|
||||
@override final String? buyerType;
|
||||
@override final String? guildKey;
|
||||
@override final String? productKey;
|
||||
@override final String? type;
|
||||
@override final String? allocationType;
|
||||
@override final int? numberOfCarcasses;
|
||||
@override final int? weightOfCarcasses;
|
||||
@override final String? sellType;
|
||||
@override final int? amount;
|
||||
@override final int? totalAmount;
|
||||
@override final bool? approvedPriceStatus;
|
||||
@override final String? date;
|
||||
|
||||
/// Create a copy of SubmitStewardAllocation
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$SubmitStewardAllocationCopyWith<_SubmitStewardAllocation> get copyWith => __$SubmitStewardAllocationCopyWithImpl<_SubmitStewardAllocation>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$SubmitStewardAllocationToJson(this, );
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _SubmitStewardAllocation&&(identical(other.sellerType, sellerType) || other.sellerType == sellerType)&&(identical(other.buyerType, buyerType) || other.buyerType == buyerType)&&(identical(other.guildKey, guildKey) || other.guildKey == guildKey)&&(identical(other.productKey, productKey) || other.productKey == productKey)&&(identical(other.type, type) || other.type == type)&&(identical(other.allocationType, allocationType) || other.allocationType == allocationType)&&(identical(other.numberOfCarcasses, numberOfCarcasses) || other.numberOfCarcasses == numberOfCarcasses)&&(identical(other.weightOfCarcasses, weightOfCarcasses) || other.weightOfCarcasses == weightOfCarcasses)&&(identical(other.sellType, sellType) || other.sellType == sellType)&&(identical(other.amount, amount) || other.amount == amount)&&(identical(other.totalAmount, totalAmount) || other.totalAmount == totalAmount)&&(identical(other.approvedPriceStatus, approvedPriceStatus) || other.approvedPriceStatus == approvedPriceStatus)&&(identical(other.date, date) || other.date == date));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,sellerType,buyerType,guildKey,productKey,type,allocationType,numberOfCarcasses,weightOfCarcasses,sellType,amount,totalAmount,approvedPriceStatus,date);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'SubmitStewardAllocation(sellerType: $sellerType, buyerType: $buyerType, guildKey: $guildKey, productKey: $productKey, type: $type, allocationType: $allocationType, numberOfCarcasses: $numberOfCarcasses, weightOfCarcasses: $weightOfCarcasses, sellType: $sellType, amount: $amount, totalAmount: $totalAmount, approvedPriceStatus: $approvedPriceStatus, date: $date)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$SubmitStewardAllocationCopyWith<$Res> implements $SubmitStewardAllocationCopyWith<$Res> {
|
||||
factory _$SubmitStewardAllocationCopyWith(_SubmitStewardAllocation value, $Res Function(_SubmitStewardAllocation) _then) = __$SubmitStewardAllocationCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
String? sellerType, String? buyerType, String? guildKey, String? productKey, String? type, String? allocationType, int? numberOfCarcasses, int? weightOfCarcasses, String? sellType, int? amount, int? totalAmount, bool? approvedPriceStatus, String? date
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$SubmitStewardAllocationCopyWithImpl<$Res>
|
||||
implements _$SubmitStewardAllocationCopyWith<$Res> {
|
||||
__$SubmitStewardAllocationCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _SubmitStewardAllocation _self;
|
||||
final $Res Function(_SubmitStewardAllocation) _then;
|
||||
|
||||
/// Create a copy of SubmitStewardAllocation
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? sellerType = freezed,Object? buyerType = freezed,Object? guildKey = freezed,Object? productKey = freezed,Object? type = freezed,Object? allocationType = freezed,Object? numberOfCarcasses = freezed,Object? weightOfCarcasses = freezed,Object? sellType = freezed,Object? amount = freezed,Object? totalAmount = freezed,Object? approvedPriceStatus = freezed,Object? date = freezed,}) {
|
||||
return _then(_SubmitStewardAllocation(
|
||||
sellerType: freezed == sellerType ? _self.sellerType : sellerType // ignore: cast_nullable_to_non_nullable
|
||||
as String?,buyerType: freezed == buyerType ? _self.buyerType : buyerType // ignore: cast_nullable_to_non_nullable
|
||||
as String?,guildKey: freezed == guildKey ? _self.guildKey : guildKey // ignore: cast_nullable_to_non_nullable
|
||||
as String?,productKey: freezed == productKey ? _self.productKey : productKey // ignore: cast_nullable_to_non_nullable
|
||||
as String?,type: freezed == type ? _self.type : type // ignore: cast_nullable_to_non_nullable
|
||||
as String?,allocationType: freezed == allocationType ? _self.allocationType : allocationType // ignore: cast_nullable_to_non_nullable
|
||||
as String?,numberOfCarcasses: freezed == numberOfCarcasses ? _self.numberOfCarcasses : numberOfCarcasses // ignore: cast_nullable_to_non_nullable
|
||||
as int?,weightOfCarcasses: freezed == weightOfCarcasses ? _self.weightOfCarcasses : weightOfCarcasses // ignore: cast_nullable_to_non_nullable
|
||||
as int?,sellType: freezed == sellType ? _self.sellType : sellType // ignore: cast_nullable_to_non_nullable
|
||||
as String?,amount: freezed == amount ? _self.amount : amount // ignore: cast_nullable_to_non_nullable
|
||||
as int?,totalAmount: freezed == totalAmount ? _self.totalAmount : totalAmount // ignore: cast_nullable_to_non_nullable
|
||||
as int?,approvedPriceStatus: freezed == approvedPriceStatus ? _self.approvedPriceStatus : approvedPriceStatus // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,date: freezed == date ? _self.date : date // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// dart format on
|
||||
@@ -0,0 +1,43 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'submit_steward_allocation.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_SubmitStewardAllocation _$SubmitStewardAllocationFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _SubmitStewardAllocation(
|
||||
sellerType: json['seller_type'] as String?,
|
||||
buyerType: json['buyer_type'] as String?,
|
||||
guildKey: json['guild_key'] as String?,
|
||||
productKey: json['product_key'] as String?,
|
||||
type: json['type'] as String?,
|
||||
allocationType: json['allocation_type'] as String?,
|
||||
numberOfCarcasses: (json['number_of_carcasses'] as num?)?.toInt(),
|
||||
weightOfCarcasses: (json['weight_of_carcasses'] as num?)?.toInt(),
|
||||
sellType: json['sell_type'] as String?,
|
||||
amount: (json['amount'] as num?)?.toInt(),
|
||||
totalAmount: (json['total_amount'] as num?)?.toInt(),
|
||||
approvedPriceStatus: json['approved_price_status'] as bool?,
|
||||
date: json['date'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$SubmitStewardAllocationToJson(
|
||||
_SubmitStewardAllocation instance,
|
||||
) => <String, dynamic>{
|
||||
'seller_type': instance.sellerType,
|
||||
'buyer_type': instance.buyerType,
|
||||
'guild_key': instance.guildKey,
|
||||
'product_key': instance.productKey,
|
||||
'type': instance.type,
|
||||
'allocation_type': instance.allocationType,
|
||||
'number_of_carcasses': instance.numberOfCarcasses,
|
||||
'weight_of_carcasses': instance.weightOfCarcasses,
|
||||
'sell_type': instance.sellType,
|
||||
'amount': instance.amount,
|
||||
'total_amount': instance.totalAmount,
|
||||
'approved_price_status': instance.approvedPriceStatus,
|
||||
'date': instance.date,
|
||||
};
|
||||
@@ -0,0 +1,215 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'allocated_made.freezed.dart';
|
||||
part 'allocated_made.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class AllocatedMadeModel with _$AllocatedMadeModel {
|
||||
factory AllocatedMadeModel({
|
||||
int? id,
|
||||
Product? product,
|
||||
dynamic killHouse,
|
||||
dynamic toKillHouse,
|
||||
Steward? steward,
|
||||
dynamic toSteward,
|
||||
dynamic guilds,
|
||||
Steward? toGuilds,
|
||||
dynamic toColdHouse,
|
||||
int? indexWeight,
|
||||
int? dateTimestamp,
|
||||
int? newState,
|
||||
int? newReceiverState,
|
||||
int? newAllocationState,
|
||||
String? key,
|
||||
String? createDate,
|
||||
String? modifyDate,
|
||||
bool? trash,
|
||||
int? numberOfCarcasses,
|
||||
int? realNumberOfCarcasses,
|
||||
int? receiverRealNumberOfCarcasses,
|
||||
int? weightOfCarcasses,
|
||||
int? realWeightOfCarcasses,
|
||||
int? receiverRealWeightOfCarcasses,
|
||||
int? weightLossOfCarcasses,
|
||||
bool? finalRegistration,
|
||||
String? sellType,
|
||||
String? productName,
|
||||
String? sellerType,
|
||||
String? type,
|
||||
String? saleType,
|
||||
String? allocationType,
|
||||
bool? systemRegistrationCode,
|
||||
int? registrationCode,
|
||||
int? amount,
|
||||
int? totalAmount,
|
||||
int? totalAmountPaid,
|
||||
int? totalAmountRemain,
|
||||
String? loggedRegistrationCode,
|
||||
String? state,
|
||||
String? receiverState,
|
||||
String? allocationState,
|
||||
String? date,
|
||||
String? role,
|
||||
String? stewardTempKey,
|
||||
bool? approvedPriceStatus,
|
||||
bool? calculateStatus,
|
||||
bool? temporaryTrash,
|
||||
bool? temporaryDeleted,
|
||||
String? createdBy,
|
||||
String? modifiedBy,
|
||||
dynamic wareHouse,
|
||||
dynamic stewardWareHouse,
|
||||
dynamic car,
|
||||
dynamic dispenser,
|
||||
}) = _AllocatedMadeModel;
|
||||
|
||||
factory AllocatedMadeModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$AllocatedMadeModelFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class Product with _$Product {
|
||||
factory Product({
|
||||
int? weightAverage,
|
||||
String? name,
|
||||
}) = _Product;
|
||||
|
||||
factory Product.fromJson(Map<String, dynamic> json) =>
|
||||
_$ProductFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class Steward with _$Steward {
|
||||
factory Steward({
|
||||
int? id,
|
||||
User? user,
|
||||
Address? address,
|
||||
Activity? guildAreaActivity,
|
||||
Activity? guildTypeActivity,
|
||||
List<dynamic>? killHouse,
|
||||
List<dynamic>? stewardKillHouse,
|
||||
List<dynamic>? stewards,
|
||||
PosStatus? getPosStatus,
|
||||
String? key,
|
||||
String? createDate,
|
||||
String? modifyDate,
|
||||
bool? trash,
|
||||
dynamic userIdForeignKey,
|
||||
dynamic addressIdForeignKey,
|
||||
dynamic userBankIdForeignKey,
|
||||
dynamic walletIdForeignKey,
|
||||
dynamic provincialGovernmentIdKey,
|
||||
dynamic identityDocuments,
|
||||
bool? active,
|
||||
int? cityNumber,
|
||||
String? cityName,
|
||||
String? guildsId,
|
||||
String? licenseNumber,
|
||||
String? guildsName,
|
||||
String? phone,
|
||||
String? typeActivity,
|
||||
String? areaActivity,
|
||||
int? provinceNumber,
|
||||
String? provinceName,
|
||||
bool? steward,
|
||||
bool? hasPos,
|
||||
dynamic centersAllocation,
|
||||
dynamic killHouseCentersAllocation,
|
||||
dynamic allocationLimit,
|
||||
bool? limitationAllocation,
|
||||
String? registerarRole,
|
||||
String? registerarFullname,
|
||||
String? registerarMobile,
|
||||
bool? killHouseRegister,
|
||||
bool? stewardRegister,
|
||||
bool? guildsRoomRegister,
|
||||
bool? posCompanyRegister,
|
||||
String? provinceAcceptState,
|
||||
String? provinceMessage,
|
||||
String? condition,
|
||||
String? descriptionCondition,
|
||||
bool? stewardActive,
|
||||
dynamic stewardAllocationLimit,
|
||||
bool? stewardLimitationAllocation,
|
||||
bool? license,
|
||||
dynamic licenseForm,
|
||||
dynamic licenseFile,
|
||||
String? reviewerRole,
|
||||
String? reviewerFullname,
|
||||
String? reviewerMobile,
|
||||
String? checkerMessage,
|
||||
bool? finalAccept,
|
||||
bool? temporaryRegistration,
|
||||
String? createdBy,
|
||||
String? modifiedBy,
|
||||
dynamic userBankInfo,
|
||||
int? wallet,
|
||||
List<dynamic>? cars,
|
||||
List<dynamic>? userLevel,
|
||||
}) = _Steward;
|
||||
|
||||
factory Steward.fromJson(Map<String, dynamic> json) =>
|
||||
_$StewardFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class User with _$User {
|
||||
factory User({
|
||||
String? fullname,
|
||||
String? firstName,
|
||||
String? lastName,
|
||||
String? mobile,
|
||||
String? nationalId,
|
||||
String? city,
|
||||
}) = _User;
|
||||
|
||||
factory User.fromJson(Map<String, dynamic> json) =>
|
||||
_$UserFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class Address with _$Address {
|
||||
factory Address({
|
||||
Province? province,
|
||||
Province? city,
|
||||
String? address,
|
||||
String? postalCode,
|
||||
}) = _Address;
|
||||
|
||||
factory Address.fromJson(Map<String, dynamic> json) =>
|
||||
_$AddressFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class Province with _$Province {
|
||||
factory Province({
|
||||
String? key,
|
||||
String? name,
|
||||
}) = _Province;
|
||||
|
||||
factory Province.fromJson(Map<String, dynamic> json) =>
|
||||
_$ProvinceFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class Activity with _$Activity {
|
||||
factory Activity({
|
||||
String? key,
|
||||
String? title,
|
||||
}) = _Activity;
|
||||
|
||||
factory Activity.fromJson(Map<String, dynamic> json) =>
|
||||
_$ActivityFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class PosStatus with _$PosStatus {
|
||||
factory PosStatus({
|
||||
int? lenActiveSessions,
|
||||
bool? hasPons,
|
||||
bool? hasActivePons,
|
||||
}) = _PosStatus;
|
||||
|
||||
factory PosStatus.fromJson(Map<String, dynamic> json) =>
|
||||
_$PosStatusFromJson(json);
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,356 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'allocated_made.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_AllocatedMadeModel _$AllocatedMadeModelFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _AllocatedMadeModel(
|
||||
id: (json['id'] as num?)?.toInt(),
|
||||
product: json['product'] == null
|
||||
? null
|
||||
: Product.fromJson(json['product'] as Map<String, dynamic>),
|
||||
killHouse: json['kill_house'],
|
||||
toKillHouse: json['to_kill_house'],
|
||||
steward: json['steward'] == null
|
||||
? null
|
||||
: Steward.fromJson(json['steward'] as Map<String, dynamic>),
|
||||
toSteward: json['to_steward'],
|
||||
guilds: json['guilds'],
|
||||
toGuilds: json['to_guilds'] == null
|
||||
? null
|
||||
: Steward.fromJson(json['to_guilds'] as Map<String, dynamic>),
|
||||
toColdHouse: json['to_cold_house'],
|
||||
indexWeight: (json['index_weight'] as num?)?.toInt(),
|
||||
dateTimestamp: (json['date_timestamp'] as num?)?.toInt(),
|
||||
newState: (json['new_state'] as num?)?.toInt(),
|
||||
newReceiverState: (json['new_receiver_state'] as num?)?.toInt(),
|
||||
newAllocationState: (json['new_allocation_state'] as num?)?.toInt(),
|
||||
key: json['key'] as String?,
|
||||
createDate: json['create_date'] as String?,
|
||||
modifyDate: json['modify_date'] as String?,
|
||||
trash: json['trash'] as bool?,
|
||||
numberOfCarcasses: (json['number_of_carcasses'] as num?)?.toInt(),
|
||||
realNumberOfCarcasses: (json['real_number_of_carcasses'] as num?)?.toInt(),
|
||||
receiverRealNumberOfCarcasses:
|
||||
(json['receiver_real_number_of_carcasses'] as num?)?.toInt(),
|
||||
weightOfCarcasses: (json['weight_of_carcasses'] as num?)?.toInt(),
|
||||
realWeightOfCarcasses: (json['real_weight_of_carcasses'] as num?)?.toInt(),
|
||||
receiverRealWeightOfCarcasses:
|
||||
(json['receiver_real_weight_of_carcasses'] as num?)?.toInt(),
|
||||
weightLossOfCarcasses: (json['weight_loss_of_carcasses'] as num?)?.toInt(),
|
||||
finalRegistration: json['final_registration'] as bool?,
|
||||
sellType: json['sell_type'] as String?,
|
||||
productName: json['product_name'] as String?,
|
||||
sellerType: json['seller_type'] as String?,
|
||||
type: json['type'] as String?,
|
||||
saleType: json['sale_type'] as String?,
|
||||
allocationType: json['allocation_type'] as String?,
|
||||
systemRegistrationCode: json['system_registration_code'] as bool?,
|
||||
registrationCode: (json['registration_code'] as num?)?.toInt(),
|
||||
amount: (json['amount'] as num?)?.toInt(),
|
||||
totalAmount: (json['total_amount'] as num?)?.toInt(),
|
||||
totalAmountPaid: (json['total_amount_paid'] as num?)?.toInt(),
|
||||
totalAmountRemain: (json['total_amount_remain'] as num?)?.toInt(),
|
||||
loggedRegistrationCode: json['logged_registration_code'] as String?,
|
||||
state: json['state'] as String?,
|
||||
receiverState: json['receiver_state'] as String?,
|
||||
allocationState: json['allocation_state'] as String?,
|
||||
date: json['date'] as String?,
|
||||
role: json['role'] as String?,
|
||||
stewardTempKey: json['steward_temp_key'] as String?,
|
||||
approvedPriceStatus: json['approved_price_status'] as bool?,
|
||||
calculateStatus: json['calculate_status'] as bool?,
|
||||
temporaryTrash: json['temporary_trash'] as bool?,
|
||||
temporaryDeleted: json['temporary_deleted'] as bool?,
|
||||
createdBy: json['created_by'] as String?,
|
||||
modifiedBy: json['modified_by'] as String?,
|
||||
wareHouse: json['ware_house'],
|
||||
stewardWareHouse: json['steward_ware_house'],
|
||||
car: json['car'],
|
||||
dispenser: json['dispenser'],
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$AllocatedMadeModelToJson(
|
||||
_AllocatedMadeModel instance,
|
||||
) => <String, dynamic>{
|
||||
'id': instance.id,
|
||||
'product': instance.product,
|
||||
'kill_house': instance.killHouse,
|
||||
'to_kill_house': instance.toKillHouse,
|
||||
'steward': instance.steward,
|
||||
'to_steward': instance.toSteward,
|
||||
'guilds': instance.guilds,
|
||||
'to_guilds': instance.toGuilds,
|
||||
'to_cold_house': instance.toColdHouse,
|
||||
'index_weight': instance.indexWeight,
|
||||
'date_timestamp': instance.dateTimestamp,
|
||||
'new_state': instance.newState,
|
||||
'new_receiver_state': instance.newReceiverState,
|
||||
'new_allocation_state': instance.newAllocationState,
|
||||
'key': instance.key,
|
||||
'create_date': instance.createDate,
|
||||
'modify_date': instance.modifyDate,
|
||||
'trash': instance.trash,
|
||||
'number_of_carcasses': instance.numberOfCarcasses,
|
||||
'real_number_of_carcasses': instance.realNumberOfCarcasses,
|
||||
'receiver_real_number_of_carcasses': instance.receiverRealNumberOfCarcasses,
|
||||
'weight_of_carcasses': instance.weightOfCarcasses,
|
||||
'real_weight_of_carcasses': instance.realWeightOfCarcasses,
|
||||
'receiver_real_weight_of_carcasses': instance.receiverRealWeightOfCarcasses,
|
||||
'weight_loss_of_carcasses': instance.weightLossOfCarcasses,
|
||||
'final_registration': instance.finalRegistration,
|
||||
'sell_type': instance.sellType,
|
||||
'product_name': instance.productName,
|
||||
'seller_type': instance.sellerType,
|
||||
'type': instance.type,
|
||||
'sale_type': instance.saleType,
|
||||
'allocation_type': instance.allocationType,
|
||||
'system_registration_code': instance.systemRegistrationCode,
|
||||
'registration_code': instance.registrationCode,
|
||||
'amount': instance.amount,
|
||||
'total_amount': instance.totalAmount,
|
||||
'total_amount_paid': instance.totalAmountPaid,
|
||||
'total_amount_remain': instance.totalAmountRemain,
|
||||
'logged_registration_code': instance.loggedRegistrationCode,
|
||||
'state': instance.state,
|
||||
'receiver_state': instance.receiverState,
|
||||
'allocation_state': instance.allocationState,
|
||||
'date': instance.date,
|
||||
'role': instance.role,
|
||||
'steward_temp_key': instance.stewardTempKey,
|
||||
'approved_price_status': instance.approvedPriceStatus,
|
||||
'calculate_status': instance.calculateStatus,
|
||||
'temporary_trash': instance.temporaryTrash,
|
||||
'temporary_deleted': instance.temporaryDeleted,
|
||||
'created_by': instance.createdBy,
|
||||
'modified_by': instance.modifiedBy,
|
||||
'ware_house': instance.wareHouse,
|
||||
'steward_ware_house': instance.stewardWareHouse,
|
||||
'car': instance.car,
|
||||
'dispenser': instance.dispenser,
|
||||
};
|
||||
|
||||
_Product _$ProductFromJson(Map<String, dynamic> json) => _Product(
|
||||
weightAverage: (json['weight_average'] as num?)?.toInt(),
|
||||
name: json['name'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ProductToJson(_Product instance) => <String, dynamic>{
|
||||
'weight_average': instance.weightAverage,
|
||||
'name': instance.name,
|
||||
};
|
||||
|
||||
_Steward _$StewardFromJson(Map<String, dynamic> json) => _Steward(
|
||||
id: (json['id'] as num?)?.toInt(),
|
||||
user: json['user'] == null
|
||||
? null
|
||||
: User.fromJson(json['user'] as Map<String, dynamic>),
|
||||
address: json['address'] == null
|
||||
? null
|
||||
: Address.fromJson(json['address'] as Map<String, dynamic>),
|
||||
guildAreaActivity: json['guild_area_activity'] == null
|
||||
? null
|
||||
: Activity.fromJson(json['guild_area_activity'] as Map<String, dynamic>),
|
||||
guildTypeActivity: json['guild_type_activity'] == null
|
||||
? null
|
||||
: Activity.fromJson(json['guild_type_activity'] as Map<String, dynamic>),
|
||||
killHouse: json['kill_house'] as List<dynamic>?,
|
||||
stewardKillHouse: json['steward_kill_house'] as List<dynamic>?,
|
||||
stewards: json['stewards'] as List<dynamic>?,
|
||||
getPosStatus: json['get_pos_status'] == null
|
||||
? null
|
||||
: PosStatus.fromJson(json['get_pos_status'] as Map<String, dynamic>),
|
||||
key: json['key'] as String?,
|
||||
createDate: json['create_date'] as String?,
|
||||
modifyDate: json['modify_date'] as String?,
|
||||
trash: json['trash'] as bool?,
|
||||
userIdForeignKey: json['user_id_foreign_key'],
|
||||
addressIdForeignKey: json['address_id_foreign_key'],
|
||||
userBankIdForeignKey: json['user_bank_id_foreign_key'],
|
||||
walletIdForeignKey: json['wallet_id_foreign_key'],
|
||||
provincialGovernmentIdKey: json['provincial_government_id_key'],
|
||||
identityDocuments: json['identity_documents'],
|
||||
active: json['active'] as bool?,
|
||||
cityNumber: (json['city_number'] as num?)?.toInt(),
|
||||
cityName: json['city_name'] as String?,
|
||||
guildsId: json['guilds_id'] as String?,
|
||||
licenseNumber: json['license_number'] as String?,
|
||||
guildsName: json['guilds_name'] as String?,
|
||||
phone: json['phone'] as String?,
|
||||
typeActivity: json['type_activity'] as String?,
|
||||
areaActivity: json['area_activity'] as String?,
|
||||
provinceNumber: (json['province_number'] as num?)?.toInt(),
|
||||
provinceName: json['province_name'] as String?,
|
||||
steward: json['steward'] as bool?,
|
||||
hasPos: json['has_pos'] as bool?,
|
||||
centersAllocation: json['centers_allocation'],
|
||||
killHouseCentersAllocation: json['kill_house_centers_allocation'],
|
||||
allocationLimit: json['allocation_limit'],
|
||||
limitationAllocation: json['limitation_allocation'] as bool?,
|
||||
registerarRole: json['registerar_role'] as String?,
|
||||
registerarFullname: json['registerar_fullname'] as String?,
|
||||
registerarMobile: json['registerar_mobile'] as String?,
|
||||
killHouseRegister: json['kill_house_register'] as bool?,
|
||||
stewardRegister: json['steward_register'] as bool?,
|
||||
guildsRoomRegister: json['guilds_room_register'] as bool?,
|
||||
posCompanyRegister: json['pos_company_register'] as bool?,
|
||||
provinceAcceptState: json['province_accept_state'] as String?,
|
||||
provinceMessage: json['province_message'] as String?,
|
||||
condition: json['condition'] as String?,
|
||||
descriptionCondition: json['description_condition'] as String?,
|
||||
stewardActive: json['steward_active'] as bool?,
|
||||
stewardAllocationLimit: json['steward_allocation_limit'],
|
||||
stewardLimitationAllocation: json['steward_limitation_allocation'] as bool?,
|
||||
license: json['license'] as bool?,
|
||||
licenseForm: json['license_form'],
|
||||
licenseFile: json['license_file'],
|
||||
reviewerRole: json['reviewer_role'] as String?,
|
||||
reviewerFullname: json['reviewer_fullname'] as String?,
|
||||
reviewerMobile: json['reviewer_mobile'] as String?,
|
||||
checkerMessage: json['checker_message'] as String?,
|
||||
finalAccept: json['final_accept'] as bool?,
|
||||
temporaryRegistration: json['temporary_registration'] as bool?,
|
||||
createdBy: json['created_by'] as String?,
|
||||
modifiedBy: json['modified_by'] as String?,
|
||||
userBankInfo: json['user_bank_info'],
|
||||
wallet: (json['wallet'] as num?)?.toInt(),
|
||||
cars: json['cars'] as List<dynamic>?,
|
||||
userLevel: json['user_level'] as List<dynamic>?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$StewardToJson(_Steward instance) => <String, dynamic>{
|
||||
'id': instance.id,
|
||||
'user': instance.user,
|
||||
'address': instance.address,
|
||||
'guild_area_activity': instance.guildAreaActivity,
|
||||
'guild_type_activity': instance.guildTypeActivity,
|
||||
'kill_house': instance.killHouse,
|
||||
'steward_kill_house': instance.stewardKillHouse,
|
||||
'stewards': instance.stewards,
|
||||
'get_pos_status': instance.getPosStatus,
|
||||
'key': instance.key,
|
||||
'create_date': instance.createDate,
|
||||
'modify_date': instance.modifyDate,
|
||||
'trash': instance.trash,
|
||||
'user_id_foreign_key': instance.userIdForeignKey,
|
||||
'address_id_foreign_key': instance.addressIdForeignKey,
|
||||
'user_bank_id_foreign_key': instance.userBankIdForeignKey,
|
||||
'wallet_id_foreign_key': instance.walletIdForeignKey,
|
||||
'provincial_government_id_key': instance.provincialGovernmentIdKey,
|
||||
'identity_documents': instance.identityDocuments,
|
||||
'active': instance.active,
|
||||
'city_number': instance.cityNumber,
|
||||
'city_name': instance.cityName,
|
||||
'guilds_id': instance.guildsId,
|
||||
'license_number': instance.licenseNumber,
|
||||
'guilds_name': instance.guildsName,
|
||||
'phone': instance.phone,
|
||||
'type_activity': instance.typeActivity,
|
||||
'area_activity': instance.areaActivity,
|
||||
'province_number': instance.provinceNumber,
|
||||
'province_name': instance.provinceName,
|
||||
'steward': instance.steward,
|
||||
'has_pos': instance.hasPos,
|
||||
'centers_allocation': instance.centersAllocation,
|
||||
'kill_house_centers_allocation': instance.killHouseCentersAllocation,
|
||||
'allocation_limit': instance.allocationLimit,
|
||||
'limitation_allocation': instance.limitationAllocation,
|
||||
'registerar_role': instance.registerarRole,
|
||||
'registerar_fullname': instance.registerarFullname,
|
||||
'registerar_mobile': instance.registerarMobile,
|
||||
'kill_house_register': instance.killHouseRegister,
|
||||
'steward_register': instance.stewardRegister,
|
||||
'guilds_room_register': instance.guildsRoomRegister,
|
||||
'pos_company_register': instance.posCompanyRegister,
|
||||
'province_accept_state': instance.provinceAcceptState,
|
||||
'province_message': instance.provinceMessage,
|
||||
'condition': instance.condition,
|
||||
'description_condition': instance.descriptionCondition,
|
||||
'steward_active': instance.stewardActive,
|
||||
'steward_allocation_limit': instance.stewardAllocationLimit,
|
||||
'steward_limitation_allocation': instance.stewardLimitationAllocation,
|
||||
'license': instance.license,
|
||||
'license_form': instance.licenseForm,
|
||||
'license_file': instance.licenseFile,
|
||||
'reviewer_role': instance.reviewerRole,
|
||||
'reviewer_fullname': instance.reviewerFullname,
|
||||
'reviewer_mobile': instance.reviewerMobile,
|
||||
'checker_message': instance.checkerMessage,
|
||||
'final_accept': instance.finalAccept,
|
||||
'temporary_registration': instance.temporaryRegistration,
|
||||
'created_by': instance.createdBy,
|
||||
'modified_by': instance.modifiedBy,
|
||||
'user_bank_info': instance.userBankInfo,
|
||||
'wallet': instance.wallet,
|
||||
'cars': instance.cars,
|
||||
'user_level': instance.userLevel,
|
||||
};
|
||||
|
||||
_User _$UserFromJson(Map<String, dynamic> json) => _User(
|
||||
fullname: json['fullname'] as String?,
|
||||
firstName: json['first_name'] as String?,
|
||||
lastName: json['last_name'] as String?,
|
||||
mobile: json['mobile'] as String?,
|
||||
nationalId: json['national_id'] as String?,
|
||||
city: json['city'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$UserToJson(_User instance) => <String, dynamic>{
|
||||
'fullname': instance.fullname,
|
||||
'first_name': instance.firstName,
|
||||
'last_name': instance.lastName,
|
||||
'mobile': instance.mobile,
|
||||
'national_id': instance.nationalId,
|
||||
'city': instance.city,
|
||||
};
|
||||
|
||||
_Address _$AddressFromJson(Map<String, dynamic> json) => _Address(
|
||||
province: json['province'] == null
|
||||
? null
|
||||
: Province.fromJson(json['province'] as Map<String, dynamic>),
|
||||
city: json['city'] == null
|
||||
? null
|
||||
: Province.fromJson(json['city'] as Map<String, dynamic>),
|
||||
address: json['address'] as String?,
|
||||
postalCode: json['postal_code'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$AddressToJson(_Address instance) => <String, dynamic>{
|
||||
'province': instance.province,
|
||||
'city': instance.city,
|
||||
'address': instance.address,
|
||||
'postal_code': instance.postalCode,
|
||||
};
|
||||
|
||||
_Province _$ProvinceFromJson(Map<String, dynamic> json) =>
|
||||
_Province(key: json['key'] as String?, name: json['name'] as String?);
|
||||
|
||||
Map<String, dynamic> _$ProvinceToJson(_Province instance) => <String, dynamic>{
|
||||
'key': instance.key,
|
||||
'name': instance.name,
|
||||
};
|
||||
|
||||
_Activity _$ActivityFromJson(Map<String, dynamic> json) =>
|
||||
_Activity(key: json['key'] as String?, title: json['title'] as String?);
|
||||
|
||||
Map<String, dynamic> _$ActivityToJson(_Activity instance) => <String, dynamic>{
|
||||
'key': instance.key,
|
||||
'title': instance.title,
|
||||
};
|
||||
|
||||
_PosStatus _$PosStatusFromJson(Map<String, dynamic> json) => _PosStatus(
|
||||
lenActiveSessions: (json['len_active_sessions'] as num?)?.toInt(),
|
||||
hasPons: json['has_pons'] as bool?,
|
||||
hasActivePons: json['has_active_pons'] as bool?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$PosStatusToJson(_PosStatus instance) =>
|
||||
<String, dynamic>{
|
||||
'len_active_sessions': instance.lenActiveSessions,
|
||||
'has_pons': instance.hasPons,
|
||||
'has_active_pons': instance.hasActivePons,
|
||||
};
|
||||
@@ -0,0 +1,25 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'bar_information.freezed.dart';
|
||||
part 'bar_information.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class BarInformation with _$BarInformation {
|
||||
const factory BarInformation({
|
||||
int? totalBars,
|
||||
int? totalBarsQuantity,
|
||||
double? totalBarsWeight,
|
||||
int? totalEnteredBars,
|
||||
int? totalEnteredBarsQuantity,
|
||||
double? totalEnteredBarsWeight,
|
||||
int? totalNotEnteredBars,
|
||||
int? totalNotEnteredBarsQuantity,
|
||||
double? totalNotEnteredKillHouseRequestsWeight,
|
||||
int? totalRejectedBars,
|
||||
int? totalRejectedBarsQuantity,
|
||||
double? totalRejectedBarsWeight,
|
||||
}) = _BarInformation;
|
||||
|
||||
factory BarInformation.fromJson(Map<String, dynamic> json) =>
|
||||
_$BarInformationFromJson(json);
|
||||
}
|
||||
@@ -0,0 +1,310 @@
|
||||
// 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 'bar_information.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
/// @nodoc
|
||||
mixin _$BarInformation {
|
||||
|
||||
int? get totalBars; int? get totalBarsQuantity; double? get totalBarsWeight; int? get totalEnteredBars; int? get totalEnteredBarsQuantity; double? get totalEnteredBarsWeight; int? get totalNotEnteredBars; int? get totalNotEnteredBarsQuantity; double? get totalNotEnteredKillHouseRequestsWeight; int? get totalRejectedBars; int? get totalRejectedBarsQuantity; double? get totalRejectedBarsWeight;
|
||||
/// Create a copy of BarInformation
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$BarInformationCopyWith<BarInformation> get copyWith => _$BarInformationCopyWithImpl<BarInformation>(this as BarInformation, _$identity);
|
||||
|
||||
/// Serializes this BarInformation to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is BarInformation&&(identical(other.totalBars, totalBars) || other.totalBars == totalBars)&&(identical(other.totalBarsQuantity, totalBarsQuantity) || other.totalBarsQuantity == totalBarsQuantity)&&(identical(other.totalBarsWeight, totalBarsWeight) || other.totalBarsWeight == totalBarsWeight)&&(identical(other.totalEnteredBars, totalEnteredBars) || other.totalEnteredBars == totalEnteredBars)&&(identical(other.totalEnteredBarsQuantity, totalEnteredBarsQuantity) || other.totalEnteredBarsQuantity == totalEnteredBarsQuantity)&&(identical(other.totalEnteredBarsWeight, totalEnteredBarsWeight) || other.totalEnteredBarsWeight == totalEnteredBarsWeight)&&(identical(other.totalNotEnteredBars, totalNotEnteredBars) || other.totalNotEnteredBars == totalNotEnteredBars)&&(identical(other.totalNotEnteredBarsQuantity, totalNotEnteredBarsQuantity) || other.totalNotEnteredBarsQuantity == totalNotEnteredBarsQuantity)&&(identical(other.totalNotEnteredKillHouseRequestsWeight, totalNotEnteredKillHouseRequestsWeight) || other.totalNotEnteredKillHouseRequestsWeight == totalNotEnteredKillHouseRequestsWeight)&&(identical(other.totalRejectedBars, totalRejectedBars) || other.totalRejectedBars == totalRejectedBars)&&(identical(other.totalRejectedBarsQuantity, totalRejectedBarsQuantity) || other.totalRejectedBarsQuantity == totalRejectedBarsQuantity)&&(identical(other.totalRejectedBarsWeight, totalRejectedBarsWeight) || other.totalRejectedBarsWeight == totalRejectedBarsWeight));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,totalBars,totalBarsQuantity,totalBarsWeight,totalEnteredBars,totalEnteredBarsQuantity,totalEnteredBarsWeight,totalNotEnteredBars,totalNotEnteredBarsQuantity,totalNotEnteredKillHouseRequestsWeight,totalRejectedBars,totalRejectedBarsQuantity,totalRejectedBarsWeight);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'BarInformation(totalBars: $totalBars, totalBarsQuantity: $totalBarsQuantity, totalBarsWeight: $totalBarsWeight, totalEnteredBars: $totalEnteredBars, totalEnteredBarsQuantity: $totalEnteredBarsQuantity, totalEnteredBarsWeight: $totalEnteredBarsWeight, totalNotEnteredBars: $totalNotEnteredBars, totalNotEnteredBarsQuantity: $totalNotEnteredBarsQuantity, totalNotEnteredKillHouseRequestsWeight: $totalNotEnteredKillHouseRequestsWeight, totalRejectedBars: $totalRejectedBars, totalRejectedBarsQuantity: $totalRejectedBarsQuantity, totalRejectedBarsWeight: $totalRejectedBarsWeight)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $BarInformationCopyWith<$Res> {
|
||||
factory $BarInformationCopyWith(BarInformation value, $Res Function(BarInformation) _then) = _$BarInformationCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
int? totalBars, int? totalBarsQuantity, double? totalBarsWeight, int? totalEnteredBars, int? totalEnteredBarsQuantity, double? totalEnteredBarsWeight, int? totalNotEnteredBars, int? totalNotEnteredBarsQuantity, double? totalNotEnteredKillHouseRequestsWeight, int? totalRejectedBars, int? totalRejectedBarsQuantity, double? totalRejectedBarsWeight
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$BarInformationCopyWithImpl<$Res>
|
||||
implements $BarInformationCopyWith<$Res> {
|
||||
_$BarInformationCopyWithImpl(this._self, this._then);
|
||||
|
||||
final BarInformation _self;
|
||||
final $Res Function(BarInformation) _then;
|
||||
|
||||
/// Create a copy of BarInformation
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? totalBars = freezed,Object? totalBarsQuantity = freezed,Object? totalBarsWeight = freezed,Object? totalEnteredBars = freezed,Object? totalEnteredBarsQuantity = freezed,Object? totalEnteredBarsWeight = freezed,Object? totalNotEnteredBars = freezed,Object? totalNotEnteredBarsQuantity = freezed,Object? totalNotEnteredKillHouseRequestsWeight = freezed,Object? totalRejectedBars = freezed,Object? totalRejectedBarsQuantity = freezed,Object? totalRejectedBarsWeight = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
totalBars: freezed == totalBars ? _self.totalBars : totalBars // ignore: cast_nullable_to_non_nullable
|
||||
as int?,totalBarsQuantity: freezed == totalBarsQuantity ? _self.totalBarsQuantity : totalBarsQuantity // ignore: cast_nullable_to_non_nullable
|
||||
as int?,totalBarsWeight: freezed == totalBarsWeight ? _self.totalBarsWeight : totalBarsWeight // ignore: cast_nullable_to_non_nullable
|
||||
as double?,totalEnteredBars: freezed == totalEnteredBars ? _self.totalEnteredBars : totalEnteredBars // ignore: cast_nullable_to_non_nullable
|
||||
as int?,totalEnteredBarsQuantity: freezed == totalEnteredBarsQuantity ? _self.totalEnteredBarsQuantity : totalEnteredBarsQuantity // ignore: cast_nullable_to_non_nullable
|
||||
as int?,totalEnteredBarsWeight: freezed == totalEnteredBarsWeight ? _self.totalEnteredBarsWeight : totalEnteredBarsWeight // ignore: cast_nullable_to_non_nullable
|
||||
as double?,totalNotEnteredBars: freezed == totalNotEnteredBars ? _self.totalNotEnteredBars : totalNotEnteredBars // ignore: cast_nullable_to_non_nullable
|
||||
as int?,totalNotEnteredBarsQuantity: freezed == totalNotEnteredBarsQuantity ? _self.totalNotEnteredBarsQuantity : totalNotEnteredBarsQuantity // ignore: cast_nullable_to_non_nullable
|
||||
as int?,totalNotEnteredKillHouseRequestsWeight: freezed == totalNotEnteredKillHouseRequestsWeight ? _self.totalNotEnteredKillHouseRequestsWeight : totalNotEnteredKillHouseRequestsWeight // ignore: cast_nullable_to_non_nullable
|
||||
as double?,totalRejectedBars: freezed == totalRejectedBars ? _self.totalRejectedBars : totalRejectedBars // ignore: cast_nullable_to_non_nullable
|
||||
as int?,totalRejectedBarsQuantity: freezed == totalRejectedBarsQuantity ? _self.totalRejectedBarsQuantity : totalRejectedBarsQuantity // ignore: cast_nullable_to_non_nullable
|
||||
as int?,totalRejectedBarsWeight: freezed == totalRejectedBarsWeight ? _self.totalRejectedBarsWeight : totalRejectedBarsWeight // ignore: cast_nullable_to_non_nullable
|
||||
as double?,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [BarInformation].
|
||||
extension BarInformationPatterns on BarInformation {
|
||||
/// 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( _BarInformation value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _BarInformation() 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( _BarInformation value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _BarInformation():
|
||||
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( _BarInformation value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _BarInformation() 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( int? totalBars, int? totalBarsQuantity, double? totalBarsWeight, int? totalEnteredBars, int? totalEnteredBarsQuantity, double? totalEnteredBarsWeight, int? totalNotEnteredBars, int? totalNotEnteredBarsQuantity, double? totalNotEnteredKillHouseRequestsWeight, int? totalRejectedBars, int? totalRejectedBarsQuantity, double? totalRejectedBarsWeight)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _BarInformation() when $default != null:
|
||||
return $default(_that.totalBars,_that.totalBarsQuantity,_that.totalBarsWeight,_that.totalEnteredBars,_that.totalEnteredBarsQuantity,_that.totalEnteredBarsWeight,_that.totalNotEnteredBars,_that.totalNotEnteredBarsQuantity,_that.totalNotEnteredKillHouseRequestsWeight,_that.totalRejectedBars,_that.totalRejectedBarsQuantity,_that.totalRejectedBarsWeight);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( int? totalBars, int? totalBarsQuantity, double? totalBarsWeight, int? totalEnteredBars, int? totalEnteredBarsQuantity, double? totalEnteredBarsWeight, int? totalNotEnteredBars, int? totalNotEnteredBarsQuantity, double? totalNotEnteredKillHouseRequestsWeight, int? totalRejectedBars, int? totalRejectedBarsQuantity, double? totalRejectedBarsWeight) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _BarInformation():
|
||||
return $default(_that.totalBars,_that.totalBarsQuantity,_that.totalBarsWeight,_that.totalEnteredBars,_that.totalEnteredBarsQuantity,_that.totalEnteredBarsWeight,_that.totalNotEnteredBars,_that.totalNotEnteredBarsQuantity,_that.totalNotEnteredKillHouseRequestsWeight,_that.totalRejectedBars,_that.totalRejectedBarsQuantity,_that.totalRejectedBarsWeight);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( int? totalBars, int? totalBarsQuantity, double? totalBarsWeight, int? totalEnteredBars, int? totalEnteredBarsQuantity, double? totalEnteredBarsWeight, int? totalNotEnteredBars, int? totalNotEnteredBarsQuantity, double? totalNotEnteredKillHouseRequestsWeight, int? totalRejectedBars, int? totalRejectedBarsQuantity, double? totalRejectedBarsWeight)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _BarInformation() when $default != null:
|
||||
return $default(_that.totalBars,_that.totalBarsQuantity,_that.totalBarsWeight,_that.totalEnteredBars,_that.totalEnteredBarsQuantity,_that.totalEnteredBarsWeight,_that.totalNotEnteredBars,_that.totalNotEnteredBarsQuantity,_that.totalNotEnteredKillHouseRequestsWeight,_that.totalRejectedBars,_that.totalRejectedBarsQuantity,_that.totalRejectedBarsWeight);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
|
||||
class _BarInformation implements BarInformation {
|
||||
const _BarInformation({this.totalBars, this.totalBarsQuantity, this.totalBarsWeight, this.totalEnteredBars, this.totalEnteredBarsQuantity, this.totalEnteredBarsWeight, this.totalNotEnteredBars, this.totalNotEnteredBarsQuantity, this.totalNotEnteredKillHouseRequestsWeight, this.totalRejectedBars, this.totalRejectedBarsQuantity, this.totalRejectedBarsWeight});
|
||||
factory _BarInformation.fromJson(Map<String, dynamic> json) => _$BarInformationFromJson(json);
|
||||
|
||||
@override final int? totalBars;
|
||||
@override final int? totalBarsQuantity;
|
||||
@override final double? totalBarsWeight;
|
||||
@override final int? totalEnteredBars;
|
||||
@override final int? totalEnteredBarsQuantity;
|
||||
@override final double? totalEnteredBarsWeight;
|
||||
@override final int? totalNotEnteredBars;
|
||||
@override final int? totalNotEnteredBarsQuantity;
|
||||
@override final double? totalNotEnteredKillHouseRequestsWeight;
|
||||
@override final int? totalRejectedBars;
|
||||
@override final int? totalRejectedBarsQuantity;
|
||||
@override final double? totalRejectedBarsWeight;
|
||||
|
||||
/// Create a copy of BarInformation
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$BarInformationCopyWith<_BarInformation> get copyWith => __$BarInformationCopyWithImpl<_BarInformation>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$BarInformationToJson(this, );
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _BarInformation&&(identical(other.totalBars, totalBars) || other.totalBars == totalBars)&&(identical(other.totalBarsQuantity, totalBarsQuantity) || other.totalBarsQuantity == totalBarsQuantity)&&(identical(other.totalBarsWeight, totalBarsWeight) || other.totalBarsWeight == totalBarsWeight)&&(identical(other.totalEnteredBars, totalEnteredBars) || other.totalEnteredBars == totalEnteredBars)&&(identical(other.totalEnteredBarsQuantity, totalEnteredBarsQuantity) || other.totalEnteredBarsQuantity == totalEnteredBarsQuantity)&&(identical(other.totalEnteredBarsWeight, totalEnteredBarsWeight) || other.totalEnteredBarsWeight == totalEnteredBarsWeight)&&(identical(other.totalNotEnteredBars, totalNotEnteredBars) || other.totalNotEnteredBars == totalNotEnteredBars)&&(identical(other.totalNotEnteredBarsQuantity, totalNotEnteredBarsQuantity) || other.totalNotEnteredBarsQuantity == totalNotEnteredBarsQuantity)&&(identical(other.totalNotEnteredKillHouseRequestsWeight, totalNotEnteredKillHouseRequestsWeight) || other.totalNotEnteredKillHouseRequestsWeight == totalNotEnteredKillHouseRequestsWeight)&&(identical(other.totalRejectedBars, totalRejectedBars) || other.totalRejectedBars == totalRejectedBars)&&(identical(other.totalRejectedBarsQuantity, totalRejectedBarsQuantity) || other.totalRejectedBarsQuantity == totalRejectedBarsQuantity)&&(identical(other.totalRejectedBarsWeight, totalRejectedBarsWeight) || other.totalRejectedBarsWeight == totalRejectedBarsWeight));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,totalBars,totalBarsQuantity,totalBarsWeight,totalEnteredBars,totalEnteredBarsQuantity,totalEnteredBarsWeight,totalNotEnteredBars,totalNotEnteredBarsQuantity,totalNotEnteredKillHouseRequestsWeight,totalRejectedBars,totalRejectedBarsQuantity,totalRejectedBarsWeight);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'BarInformation(totalBars: $totalBars, totalBarsQuantity: $totalBarsQuantity, totalBarsWeight: $totalBarsWeight, totalEnteredBars: $totalEnteredBars, totalEnteredBarsQuantity: $totalEnteredBarsQuantity, totalEnteredBarsWeight: $totalEnteredBarsWeight, totalNotEnteredBars: $totalNotEnteredBars, totalNotEnteredBarsQuantity: $totalNotEnteredBarsQuantity, totalNotEnteredKillHouseRequestsWeight: $totalNotEnteredKillHouseRequestsWeight, totalRejectedBars: $totalRejectedBars, totalRejectedBarsQuantity: $totalRejectedBarsQuantity, totalRejectedBarsWeight: $totalRejectedBarsWeight)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$BarInformationCopyWith<$Res> implements $BarInformationCopyWith<$Res> {
|
||||
factory _$BarInformationCopyWith(_BarInformation value, $Res Function(_BarInformation) _then) = __$BarInformationCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
int? totalBars, int? totalBarsQuantity, double? totalBarsWeight, int? totalEnteredBars, int? totalEnteredBarsQuantity, double? totalEnteredBarsWeight, int? totalNotEnteredBars, int? totalNotEnteredBarsQuantity, double? totalNotEnteredKillHouseRequestsWeight, int? totalRejectedBars, int? totalRejectedBarsQuantity, double? totalRejectedBarsWeight
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$BarInformationCopyWithImpl<$Res>
|
||||
implements _$BarInformationCopyWith<$Res> {
|
||||
__$BarInformationCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _BarInformation _self;
|
||||
final $Res Function(_BarInformation) _then;
|
||||
|
||||
/// Create a copy of BarInformation
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? totalBars = freezed,Object? totalBarsQuantity = freezed,Object? totalBarsWeight = freezed,Object? totalEnteredBars = freezed,Object? totalEnteredBarsQuantity = freezed,Object? totalEnteredBarsWeight = freezed,Object? totalNotEnteredBars = freezed,Object? totalNotEnteredBarsQuantity = freezed,Object? totalNotEnteredKillHouseRequestsWeight = freezed,Object? totalRejectedBars = freezed,Object? totalRejectedBarsQuantity = freezed,Object? totalRejectedBarsWeight = freezed,}) {
|
||||
return _then(_BarInformation(
|
||||
totalBars: freezed == totalBars ? _self.totalBars : totalBars // ignore: cast_nullable_to_non_nullable
|
||||
as int?,totalBarsQuantity: freezed == totalBarsQuantity ? _self.totalBarsQuantity : totalBarsQuantity // ignore: cast_nullable_to_non_nullable
|
||||
as int?,totalBarsWeight: freezed == totalBarsWeight ? _self.totalBarsWeight : totalBarsWeight // ignore: cast_nullable_to_non_nullable
|
||||
as double?,totalEnteredBars: freezed == totalEnteredBars ? _self.totalEnteredBars : totalEnteredBars // ignore: cast_nullable_to_non_nullable
|
||||
as int?,totalEnteredBarsQuantity: freezed == totalEnteredBarsQuantity ? _self.totalEnteredBarsQuantity : totalEnteredBarsQuantity // ignore: cast_nullable_to_non_nullable
|
||||
as int?,totalEnteredBarsWeight: freezed == totalEnteredBarsWeight ? _self.totalEnteredBarsWeight : totalEnteredBarsWeight // ignore: cast_nullable_to_non_nullable
|
||||
as double?,totalNotEnteredBars: freezed == totalNotEnteredBars ? _self.totalNotEnteredBars : totalNotEnteredBars // ignore: cast_nullable_to_non_nullable
|
||||
as int?,totalNotEnteredBarsQuantity: freezed == totalNotEnteredBarsQuantity ? _self.totalNotEnteredBarsQuantity : totalNotEnteredBarsQuantity // ignore: cast_nullable_to_non_nullable
|
||||
as int?,totalNotEnteredKillHouseRequestsWeight: freezed == totalNotEnteredKillHouseRequestsWeight ? _self.totalNotEnteredKillHouseRequestsWeight : totalNotEnteredKillHouseRequestsWeight // ignore: cast_nullable_to_non_nullable
|
||||
as double?,totalRejectedBars: freezed == totalRejectedBars ? _self.totalRejectedBars : totalRejectedBars // ignore: cast_nullable_to_non_nullable
|
||||
as int?,totalRejectedBarsQuantity: freezed == totalRejectedBarsQuantity ? _self.totalRejectedBarsQuantity : totalRejectedBarsQuantity // ignore: cast_nullable_to_non_nullable
|
||||
as int?,totalRejectedBarsWeight: freezed == totalRejectedBarsWeight ? _self.totalRejectedBarsWeight : totalRejectedBarsWeight // ignore: cast_nullable_to_non_nullable
|
||||
as double?,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// dart format on
|
||||
@@ -0,0 +1,47 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'bar_information.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_BarInformation _$BarInformationFromJson(Map<String, dynamic> json) =>
|
||||
_BarInformation(
|
||||
totalBars: (json['total_bars'] as num?)?.toInt(),
|
||||
totalBarsQuantity: (json['total_bars_quantity'] as num?)?.toInt(),
|
||||
totalBarsWeight: (json['total_bars_weight'] as num?)?.toDouble(),
|
||||
totalEnteredBars: (json['total_entered_bars'] as num?)?.toInt(),
|
||||
totalEnteredBarsQuantity: (json['total_entered_bars_quantity'] as num?)
|
||||
?.toInt(),
|
||||
totalEnteredBarsWeight: (json['total_entered_bars_weight'] as num?)
|
||||
?.toDouble(),
|
||||
totalNotEnteredBars: (json['total_not_entered_bars'] as num?)?.toInt(),
|
||||
totalNotEnteredBarsQuantity:
|
||||
(json['total_not_entered_bars_quantity'] as num?)?.toInt(),
|
||||
totalNotEnteredKillHouseRequestsWeight:
|
||||
(json['total_not_entered_kill_house_requests_weight'] as num?)
|
||||
?.toDouble(),
|
||||
totalRejectedBars: (json['total_rejected_bars'] as num?)?.toInt(),
|
||||
totalRejectedBarsQuantity: (json['total_rejected_bars_quantity'] as num?)
|
||||
?.toInt(),
|
||||
totalRejectedBarsWeight: (json['total_rejected_bars_weight'] as num?)
|
||||
?.toDouble(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$BarInformationToJson(_BarInformation instance) =>
|
||||
<String, dynamic>{
|
||||
'total_bars': instance.totalBars,
|
||||
'total_bars_quantity': instance.totalBarsQuantity,
|
||||
'total_bars_weight': instance.totalBarsWeight,
|
||||
'total_entered_bars': instance.totalEnteredBars,
|
||||
'total_entered_bars_quantity': instance.totalEnteredBarsQuantity,
|
||||
'total_entered_bars_weight': instance.totalEnteredBarsWeight,
|
||||
'total_not_entered_bars': instance.totalNotEnteredBars,
|
||||
'total_not_entered_bars_quantity': instance.totalNotEnteredBarsQuantity,
|
||||
'total_not_entered_kill_house_requests_weight':
|
||||
instance.totalNotEnteredKillHouseRequestsWeight,
|
||||
'total_rejected_bars': instance.totalRejectedBars,
|
||||
'total_rejected_bars_quantity': instance.totalRejectedBarsQuantity,
|
||||
'total_rejected_bars_weight': instance.totalRejectedBarsWeight,
|
||||
};
|
||||
@@ -0,0 +1,18 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'dashboard_kill_house_free_bar.freezed.dart';
|
||||
part 'dashboard_kill_house_free_bar.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class DashboardKillHouseFreeBar with _$DashboardKillHouseFreeBar {
|
||||
const factory DashboardKillHouseFreeBar({
|
||||
int? totalBars,
|
||||
int? totalBarsQuantity,
|
||||
int? totalBarsLiveWeight,
|
||||
int? totalBarsNumberOfCarcasses,
|
||||
int? totalBarsWeightOfCarcasses,
|
||||
}) = _DashboardKillHouseFreeBar;
|
||||
|
||||
factory DashboardKillHouseFreeBar.fromJson(Map<String, dynamic> json) =>
|
||||
_$DashboardKillHouseFreeBarFromJson(json);
|
||||
}
|
||||
@@ -0,0 +1,289 @@
|
||||
// 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 'dashboard_kill_house_free_bar.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
/// @nodoc
|
||||
mixin _$DashboardKillHouseFreeBar {
|
||||
|
||||
int? get totalBars; int? get totalBarsQuantity; int? get totalBarsLiveWeight; int? get totalBarsNumberOfCarcasses; int? get totalBarsWeightOfCarcasses;
|
||||
/// Create a copy of DashboardKillHouseFreeBar
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$DashboardKillHouseFreeBarCopyWith<DashboardKillHouseFreeBar> get copyWith => _$DashboardKillHouseFreeBarCopyWithImpl<DashboardKillHouseFreeBar>(this as DashboardKillHouseFreeBar, _$identity);
|
||||
|
||||
/// Serializes this DashboardKillHouseFreeBar to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is DashboardKillHouseFreeBar&&(identical(other.totalBars, totalBars) || other.totalBars == totalBars)&&(identical(other.totalBarsQuantity, totalBarsQuantity) || other.totalBarsQuantity == totalBarsQuantity)&&(identical(other.totalBarsLiveWeight, totalBarsLiveWeight) || other.totalBarsLiveWeight == totalBarsLiveWeight)&&(identical(other.totalBarsNumberOfCarcasses, totalBarsNumberOfCarcasses) || other.totalBarsNumberOfCarcasses == totalBarsNumberOfCarcasses)&&(identical(other.totalBarsWeightOfCarcasses, totalBarsWeightOfCarcasses) || other.totalBarsWeightOfCarcasses == totalBarsWeightOfCarcasses));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,totalBars,totalBarsQuantity,totalBarsLiveWeight,totalBarsNumberOfCarcasses,totalBarsWeightOfCarcasses);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'DashboardKillHouseFreeBar(totalBars: $totalBars, totalBarsQuantity: $totalBarsQuantity, totalBarsLiveWeight: $totalBarsLiveWeight, totalBarsNumberOfCarcasses: $totalBarsNumberOfCarcasses, totalBarsWeightOfCarcasses: $totalBarsWeightOfCarcasses)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $DashboardKillHouseFreeBarCopyWith<$Res> {
|
||||
factory $DashboardKillHouseFreeBarCopyWith(DashboardKillHouseFreeBar value, $Res Function(DashboardKillHouseFreeBar) _then) = _$DashboardKillHouseFreeBarCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
int? totalBars, int? totalBarsQuantity, int? totalBarsLiveWeight, int? totalBarsNumberOfCarcasses, int? totalBarsWeightOfCarcasses
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$DashboardKillHouseFreeBarCopyWithImpl<$Res>
|
||||
implements $DashboardKillHouseFreeBarCopyWith<$Res> {
|
||||
_$DashboardKillHouseFreeBarCopyWithImpl(this._self, this._then);
|
||||
|
||||
final DashboardKillHouseFreeBar _self;
|
||||
final $Res Function(DashboardKillHouseFreeBar) _then;
|
||||
|
||||
/// Create a copy of DashboardKillHouseFreeBar
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? totalBars = freezed,Object? totalBarsQuantity = freezed,Object? totalBarsLiveWeight = freezed,Object? totalBarsNumberOfCarcasses = freezed,Object? totalBarsWeightOfCarcasses = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
totalBars: freezed == totalBars ? _self.totalBars : totalBars // ignore: cast_nullable_to_non_nullable
|
||||
as int?,totalBarsQuantity: freezed == totalBarsQuantity ? _self.totalBarsQuantity : totalBarsQuantity // ignore: cast_nullable_to_non_nullable
|
||||
as int?,totalBarsLiveWeight: freezed == totalBarsLiveWeight ? _self.totalBarsLiveWeight : totalBarsLiveWeight // ignore: cast_nullable_to_non_nullable
|
||||
as int?,totalBarsNumberOfCarcasses: freezed == totalBarsNumberOfCarcasses ? _self.totalBarsNumberOfCarcasses : totalBarsNumberOfCarcasses // ignore: cast_nullable_to_non_nullable
|
||||
as int?,totalBarsWeightOfCarcasses: freezed == totalBarsWeightOfCarcasses ? _self.totalBarsWeightOfCarcasses : totalBarsWeightOfCarcasses // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [DashboardKillHouseFreeBar].
|
||||
extension DashboardKillHouseFreeBarPatterns on DashboardKillHouseFreeBar {
|
||||
/// 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( _DashboardKillHouseFreeBar value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _DashboardKillHouseFreeBar() 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( _DashboardKillHouseFreeBar value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _DashboardKillHouseFreeBar():
|
||||
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( _DashboardKillHouseFreeBar value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _DashboardKillHouseFreeBar() 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( int? totalBars, int? totalBarsQuantity, int? totalBarsLiveWeight, int? totalBarsNumberOfCarcasses, int? totalBarsWeightOfCarcasses)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _DashboardKillHouseFreeBar() when $default != null:
|
||||
return $default(_that.totalBars,_that.totalBarsQuantity,_that.totalBarsLiveWeight,_that.totalBarsNumberOfCarcasses,_that.totalBarsWeightOfCarcasses);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( int? totalBars, int? totalBarsQuantity, int? totalBarsLiveWeight, int? totalBarsNumberOfCarcasses, int? totalBarsWeightOfCarcasses) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _DashboardKillHouseFreeBar():
|
||||
return $default(_that.totalBars,_that.totalBarsQuantity,_that.totalBarsLiveWeight,_that.totalBarsNumberOfCarcasses,_that.totalBarsWeightOfCarcasses);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( int? totalBars, int? totalBarsQuantity, int? totalBarsLiveWeight, int? totalBarsNumberOfCarcasses, int? totalBarsWeightOfCarcasses)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _DashboardKillHouseFreeBar() when $default != null:
|
||||
return $default(_that.totalBars,_that.totalBarsQuantity,_that.totalBarsLiveWeight,_that.totalBarsNumberOfCarcasses,_that.totalBarsWeightOfCarcasses);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
|
||||
class _DashboardKillHouseFreeBar implements DashboardKillHouseFreeBar {
|
||||
const _DashboardKillHouseFreeBar({this.totalBars, this.totalBarsQuantity, this.totalBarsLiveWeight, this.totalBarsNumberOfCarcasses, this.totalBarsWeightOfCarcasses});
|
||||
factory _DashboardKillHouseFreeBar.fromJson(Map<String, dynamic> json) => _$DashboardKillHouseFreeBarFromJson(json);
|
||||
|
||||
@override final int? totalBars;
|
||||
@override final int? totalBarsQuantity;
|
||||
@override final int? totalBarsLiveWeight;
|
||||
@override final int? totalBarsNumberOfCarcasses;
|
||||
@override final int? totalBarsWeightOfCarcasses;
|
||||
|
||||
/// Create a copy of DashboardKillHouseFreeBar
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$DashboardKillHouseFreeBarCopyWith<_DashboardKillHouseFreeBar> get copyWith => __$DashboardKillHouseFreeBarCopyWithImpl<_DashboardKillHouseFreeBar>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$DashboardKillHouseFreeBarToJson(this, );
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _DashboardKillHouseFreeBar&&(identical(other.totalBars, totalBars) || other.totalBars == totalBars)&&(identical(other.totalBarsQuantity, totalBarsQuantity) || other.totalBarsQuantity == totalBarsQuantity)&&(identical(other.totalBarsLiveWeight, totalBarsLiveWeight) || other.totalBarsLiveWeight == totalBarsLiveWeight)&&(identical(other.totalBarsNumberOfCarcasses, totalBarsNumberOfCarcasses) || other.totalBarsNumberOfCarcasses == totalBarsNumberOfCarcasses)&&(identical(other.totalBarsWeightOfCarcasses, totalBarsWeightOfCarcasses) || other.totalBarsWeightOfCarcasses == totalBarsWeightOfCarcasses));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,totalBars,totalBarsQuantity,totalBarsLiveWeight,totalBarsNumberOfCarcasses,totalBarsWeightOfCarcasses);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'DashboardKillHouseFreeBar(totalBars: $totalBars, totalBarsQuantity: $totalBarsQuantity, totalBarsLiveWeight: $totalBarsLiveWeight, totalBarsNumberOfCarcasses: $totalBarsNumberOfCarcasses, totalBarsWeightOfCarcasses: $totalBarsWeightOfCarcasses)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$DashboardKillHouseFreeBarCopyWith<$Res> implements $DashboardKillHouseFreeBarCopyWith<$Res> {
|
||||
factory _$DashboardKillHouseFreeBarCopyWith(_DashboardKillHouseFreeBar value, $Res Function(_DashboardKillHouseFreeBar) _then) = __$DashboardKillHouseFreeBarCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
int? totalBars, int? totalBarsQuantity, int? totalBarsLiveWeight, int? totalBarsNumberOfCarcasses, int? totalBarsWeightOfCarcasses
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$DashboardKillHouseFreeBarCopyWithImpl<$Res>
|
||||
implements _$DashboardKillHouseFreeBarCopyWith<$Res> {
|
||||
__$DashboardKillHouseFreeBarCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _DashboardKillHouseFreeBar _self;
|
||||
final $Res Function(_DashboardKillHouseFreeBar) _then;
|
||||
|
||||
/// Create a copy of DashboardKillHouseFreeBar
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? totalBars = freezed,Object? totalBarsQuantity = freezed,Object? totalBarsLiveWeight = freezed,Object? totalBarsNumberOfCarcasses = freezed,Object? totalBarsWeightOfCarcasses = freezed,}) {
|
||||
return _then(_DashboardKillHouseFreeBar(
|
||||
totalBars: freezed == totalBars ? _self.totalBars : totalBars // ignore: cast_nullable_to_non_nullable
|
||||
as int?,totalBarsQuantity: freezed == totalBarsQuantity ? _self.totalBarsQuantity : totalBarsQuantity // ignore: cast_nullable_to_non_nullable
|
||||
as int?,totalBarsLiveWeight: freezed == totalBarsLiveWeight ? _self.totalBarsLiveWeight : totalBarsLiveWeight // ignore: cast_nullable_to_non_nullable
|
||||
as int?,totalBarsNumberOfCarcasses: freezed == totalBarsNumberOfCarcasses ? _self.totalBarsNumberOfCarcasses : totalBarsNumberOfCarcasses // ignore: cast_nullable_to_non_nullable
|
||||
as int?,totalBarsWeightOfCarcasses: freezed == totalBarsWeightOfCarcasses ? _self.totalBarsWeightOfCarcasses : totalBarsWeightOfCarcasses // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// dart format on
|
||||
@@ -0,0 +1,29 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'dashboard_kill_house_free_bar.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_DashboardKillHouseFreeBar _$DashboardKillHouseFreeBarFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _DashboardKillHouseFreeBar(
|
||||
totalBars: (json['total_bars'] as num?)?.toInt(),
|
||||
totalBarsQuantity: (json['total_bars_quantity'] as num?)?.toInt(),
|
||||
totalBarsLiveWeight: (json['total_bars_live_weight'] as num?)?.toInt(),
|
||||
totalBarsNumberOfCarcasses: (json['total_bars_number_of_carcasses'] as num?)
|
||||
?.toInt(),
|
||||
totalBarsWeightOfCarcasses: (json['total_bars_weight_of_carcasses'] as num?)
|
||||
?.toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$DashboardKillHouseFreeBarToJson(
|
||||
_DashboardKillHouseFreeBar instance,
|
||||
) => <String, dynamic>{
|
||||
'total_bars': instance.totalBars,
|
||||
'total_bars_quantity': instance.totalBarsQuantity,
|
||||
'total_bars_live_weight': instance.totalBarsLiveWeight,
|
||||
'total_bars_number_of_carcasses': instance.totalBarsNumberOfCarcasses,
|
||||
'total_bars_weight_of_carcasses': instance.totalBarsWeightOfCarcasses,
|
||||
};
|
||||
@@ -0,0 +1,28 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'guild_model.freezed.dart';
|
||||
part 'guild_model.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class GuildModel with _$GuildModel {
|
||||
const factory GuildModel({
|
||||
String? key,
|
||||
String? guildsName,
|
||||
bool? steward,
|
||||
User? user,
|
||||
}) = _GuildModel;
|
||||
|
||||
factory GuildModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$GuildModelFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class User with _$User {
|
||||
const factory User({
|
||||
String? fullname,
|
||||
String? mobile,
|
||||
String? city,
|
||||
}) = _User;
|
||||
|
||||
factory User.fromJson(Map<String, dynamic> json) => _$UserFromJson(json);
|
||||
}
|
||||
@@ -0,0 +1,579 @@
|
||||
// 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 'guild_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
/// @nodoc
|
||||
mixin _$GuildModel {
|
||||
|
||||
String? get key; String? get guildsName; bool? get steward; User? get user;
|
||||
/// Create a copy of GuildModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$GuildModelCopyWith<GuildModel> get copyWith => _$GuildModelCopyWithImpl<GuildModel>(this as GuildModel, _$identity);
|
||||
|
||||
/// Serializes this GuildModel to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is GuildModel&&(identical(other.key, key) || other.key == key)&&(identical(other.guildsName, guildsName) || other.guildsName == guildsName)&&(identical(other.steward, steward) || other.steward == steward)&&(identical(other.user, user) || other.user == user));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,key,guildsName,steward,user);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'GuildModel(key: $key, guildsName: $guildsName, steward: $steward, user: $user)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $GuildModelCopyWith<$Res> {
|
||||
factory $GuildModelCopyWith(GuildModel value, $Res Function(GuildModel) _then) = _$GuildModelCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
String? key, String? guildsName, bool? steward, User? user
|
||||
});
|
||||
|
||||
|
||||
$UserCopyWith<$Res>? get user;
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$GuildModelCopyWithImpl<$Res>
|
||||
implements $GuildModelCopyWith<$Res> {
|
||||
_$GuildModelCopyWithImpl(this._self, this._then);
|
||||
|
||||
final GuildModel _self;
|
||||
final $Res Function(GuildModel) _then;
|
||||
|
||||
/// Create a copy of GuildModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? key = freezed,Object? guildsName = freezed,Object? steward = freezed,Object? user = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable
|
||||
as String?,guildsName: freezed == guildsName ? _self.guildsName : guildsName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,steward: freezed == steward ? _self.steward : steward // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,user: freezed == user ? _self.user : user // ignore: cast_nullable_to_non_nullable
|
||||
as User?,
|
||||
));
|
||||
}
|
||||
/// Create a copy of GuildModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$UserCopyWith<$Res>? get user {
|
||||
if (_self.user == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $UserCopyWith<$Res>(_self.user!, (value) {
|
||||
return _then(_self.copyWith(user: value));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [GuildModel].
|
||||
extension GuildModelPatterns on GuildModel {
|
||||
/// 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( _GuildModel value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _GuildModel() 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( _GuildModel value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _GuildModel():
|
||||
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( _GuildModel value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _GuildModel() 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? key, String? guildsName, bool? steward, User? user)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _GuildModel() when $default != null:
|
||||
return $default(_that.key,_that.guildsName,_that.steward,_that.user);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? key, String? guildsName, bool? steward, User? user) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _GuildModel():
|
||||
return $default(_that.key,_that.guildsName,_that.steward,_that.user);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? key, String? guildsName, bool? steward, User? user)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _GuildModel() when $default != null:
|
||||
return $default(_that.key,_that.guildsName,_that.steward,_that.user);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
|
||||
class _GuildModel implements GuildModel {
|
||||
const _GuildModel({this.key, this.guildsName, this.steward, this.user});
|
||||
factory _GuildModel.fromJson(Map<String, dynamic> json) => _$GuildModelFromJson(json);
|
||||
|
||||
@override final String? key;
|
||||
@override final String? guildsName;
|
||||
@override final bool? steward;
|
||||
@override final User? user;
|
||||
|
||||
/// Create a copy of GuildModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$GuildModelCopyWith<_GuildModel> get copyWith => __$GuildModelCopyWithImpl<_GuildModel>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$GuildModelToJson(this, );
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _GuildModel&&(identical(other.key, key) || other.key == key)&&(identical(other.guildsName, guildsName) || other.guildsName == guildsName)&&(identical(other.steward, steward) || other.steward == steward)&&(identical(other.user, user) || other.user == user));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,key,guildsName,steward,user);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'GuildModel(key: $key, guildsName: $guildsName, steward: $steward, user: $user)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$GuildModelCopyWith<$Res> implements $GuildModelCopyWith<$Res> {
|
||||
factory _$GuildModelCopyWith(_GuildModel value, $Res Function(_GuildModel) _then) = __$GuildModelCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
String? key, String? guildsName, bool? steward, User? user
|
||||
});
|
||||
|
||||
|
||||
@override $UserCopyWith<$Res>? get user;
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$GuildModelCopyWithImpl<$Res>
|
||||
implements _$GuildModelCopyWith<$Res> {
|
||||
__$GuildModelCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _GuildModel _self;
|
||||
final $Res Function(_GuildModel) _then;
|
||||
|
||||
/// Create a copy of GuildModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? key = freezed,Object? guildsName = freezed,Object? steward = freezed,Object? user = freezed,}) {
|
||||
return _then(_GuildModel(
|
||||
key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable
|
||||
as String?,guildsName: freezed == guildsName ? _self.guildsName : guildsName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,steward: freezed == steward ? _self.steward : steward // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,user: freezed == user ? _self.user : user // ignore: cast_nullable_to_non_nullable
|
||||
as User?,
|
||||
));
|
||||
}
|
||||
|
||||
/// Create a copy of GuildModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$UserCopyWith<$Res>? get user {
|
||||
if (_self.user == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $UserCopyWith<$Res>(_self.user!, (value) {
|
||||
return _then(_self.copyWith(user: value));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// @nodoc
|
||||
mixin _$User {
|
||||
|
||||
String? get fullname; String? get mobile; String? get city;
|
||||
/// Create a copy of User
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$UserCopyWith<User> get copyWith => _$UserCopyWithImpl<User>(this as User, _$identity);
|
||||
|
||||
/// Serializes this User to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is User&&(identical(other.fullname, fullname) || other.fullname == fullname)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.city, city) || other.city == city));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,fullname,mobile,city);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'User(fullname: $fullname, mobile: $mobile, city: $city)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $UserCopyWith<$Res> {
|
||||
factory $UserCopyWith(User value, $Res Function(User) _then) = _$UserCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
String? fullname, String? mobile, String? city
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$UserCopyWithImpl<$Res>
|
||||
implements $UserCopyWith<$Res> {
|
||||
_$UserCopyWithImpl(this._self, this._then);
|
||||
|
||||
final User _self;
|
||||
final $Res Function(User) _then;
|
||||
|
||||
/// Create a copy of User
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? fullname = freezed,Object? mobile = freezed,Object? city = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
fullname: freezed == fullname ? _self.fullname : fullname // ignore: cast_nullable_to_non_nullable
|
||||
as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable
|
||||
as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [User].
|
||||
extension UserPatterns on User {
|
||||
/// 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( _User value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _User() 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( _User value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _User():
|
||||
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( _User value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _User() 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? fullname, String? mobile, String? city)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _User() when $default != null:
|
||||
return $default(_that.fullname,_that.mobile,_that.city);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? fullname, String? mobile, String? city) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _User():
|
||||
return $default(_that.fullname,_that.mobile,_that.city);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? fullname, String? mobile, String? city)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _User() when $default != null:
|
||||
return $default(_that.fullname,_that.mobile,_that.city);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
|
||||
class _User implements User {
|
||||
const _User({this.fullname, this.mobile, this.city});
|
||||
factory _User.fromJson(Map<String, dynamic> json) => _$UserFromJson(json);
|
||||
|
||||
@override final String? fullname;
|
||||
@override final String? mobile;
|
||||
@override final String? city;
|
||||
|
||||
/// Create a copy of User
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$UserCopyWith<_User> get copyWith => __$UserCopyWithImpl<_User>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$UserToJson(this, );
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _User&&(identical(other.fullname, fullname) || other.fullname == fullname)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.city, city) || other.city == city));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,fullname,mobile,city);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'User(fullname: $fullname, mobile: $mobile, city: $city)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$UserCopyWith<$Res> implements $UserCopyWith<$Res> {
|
||||
factory _$UserCopyWith(_User value, $Res Function(_User) _then) = __$UserCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
String? fullname, String? mobile, String? city
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$UserCopyWithImpl<$Res>
|
||||
implements _$UserCopyWith<$Res> {
|
||||
__$UserCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _User _self;
|
||||
final $Res Function(_User) _then;
|
||||
|
||||
/// Create a copy of User
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? fullname = freezed,Object? mobile = freezed,Object? city = freezed,}) {
|
||||
return _then(_User(
|
||||
fullname: freezed == fullname ? _self.fullname : fullname // ignore: cast_nullable_to_non_nullable
|
||||
as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable
|
||||
as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// dart format on
|
||||
@@ -0,0 +1,36 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'guild_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_GuildModel _$GuildModelFromJson(Map<String, dynamic> json) => _GuildModel(
|
||||
key: json['key'] as String?,
|
||||
guildsName: json['guilds_name'] as String?,
|
||||
steward: json['steward'] as bool?,
|
||||
user: json['user'] == null
|
||||
? null
|
||||
: User.fromJson(json['user'] as Map<String, dynamic>),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$GuildModelToJson(_GuildModel instance) =>
|
||||
<String, dynamic>{
|
||||
'key': instance.key,
|
||||
'guilds_name': instance.guildsName,
|
||||
'steward': instance.steward,
|
||||
'user': instance.user,
|
||||
};
|
||||
|
||||
_User _$UserFromJson(Map<String, dynamic> json) => _User(
|
||||
fullname: json['fullname'] as String?,
|
||||
mobile: json['mobile'] as String?,
|
||||
city: json['city'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$UserToJson(_User instance) => <String, dynamic>{
|
||||
'fullname': instance.fullname,
|
||||
'mobile': instance.mobile,
|
||||
'city': instance.city,
|
||||
};
|
||||
@@ -0,0 +1,160 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'guild_profile.freezed.dart';
|
||||
part 'guild_profile.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class GuildProfile with _$GuildProfile {
|
||||
const factory GuildProfile({
|
||||
int? id,
|
||||
User? user,
|
||||
Address? address,
|
||||
GuildAreaActivity? guild_area_activity,
|
||||
GuildTypeActivity? guild_type_activity,
|
||||
List<dynamic>? kill_house,
|
||||
List<dynamic>? steward_kill_house,
|
||||
List<dynamic>? stewards,
|
||||
GetPosStatus? get_pos_status,
|
||||
String? key,
|
||||
String? create_date,
|
||||
String? modify_date,
|
||||
bool? trash,
|
||||
String? user_id_foreign_key,
|
||||
String? address_id_foreign_key,
|
||||
String? user_bank_id_foreign_key,
|
||||
String? wallet_id_foreign_key,
|
||||
String? provincial_government_id_key,
|
||||
dynamic identity_documents,
|
||||
bool? active,
|
||||
int? city_number,
|
||||
String? city_name,
|
||||
String? guilds_id,
|
||||
String? license_number,
|
||||
String? guilds_name,
|
||||
String? phone,
|
||||
String? type_activity,
|
||||
String? area_activity,
|
||||
int? province_number,
|
||||
String? province_name,
|
||||
bool? steward,
|
||||
bool? has_pos,
|
||||
dynamic centers_allocation,
|
||||
dynamic kill_house_centers_allocation,
|
||||
dynamic allocation_limit,
|
||||
bool? limitation_allocation,
|
||||
String? registerar_role,
|
||||
String? registerar_fullname,
|
||||
String? registerar_mobile,
|
||||
bool? kill_house_register,
|
||||
bool? steward_register,
|
||||
bool? guilds_room_register,
|
||||
bool? pos_company_register,
|
||||
String? province_accept_state,
|
||||
String? province_message,
|
||||
String? condition,
|
||||
String? description_condition,
|
||||
bool? steward_active,
|
||||
dynamic steward_allocation_limit,
|
||||
bool? steward_limitation_allocation,
|
||||
bool? license,
|
||||
dynamic license_form,
|
||||
dynamic license_file,
|
||||
String? reviewer_role,
|
||||
String? reviewer_fullname,
|
||||
String? reviewer_mobile,
|
||||
String? checker_message,
|
||||
bool? final_accept,
|
||||
bool? temporary_registration,
|
||||
String? created_by,
|
||||
String? modified_by,
|
||||
dynamic user_bank_info,
|
||||
int? wallet,
|
||||
List<dynamic>? cars,
|
||||
List<dynamic>? user_level,
|
||||
}) = _GuildProfile;
|
||||
|
||||
factory GuildProfile.fromJson(Map<String, dynamic> json) =>
|
||||
_$GuildProfileFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class User with _$User {
|
||||
const factory User({
|
||||
String? fullname,
|
||||
String? first_name,
|
||||
String? last_name,
|
||||
String? mobile,
|
||||
String? national_id,
|
||||
String? city,
|
||||
}) = _User;
|
||||
|
||||
factory User.fromJson(Map<String, dynamic> json) => _$UserFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class Address with _$Address {
|
||||
const factory Address({
|
||||
Province? province,
|
||||
City? city,
|
||||
String? address,
|
||||
String? postal_code,
|
||||
}) = _Address;
|
||||
|
||||
factory Address.fromJson(Map<String, dynamic> json) =>
|
||||
_$AddressFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class Province with _$Province {
|
||||
const factory Province({
|
||||
String? key,
|
||||
String? name,
|
||||
}) = _Province;
|
||||
|
||||
factory Province.fromJson(Map<String, dynamic> json) =>
|
||||
_$ProvinceFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class City with _$City {
|
||||
const factory City({
|
||||
String? key,
|
||||
String? name,
|
||||
}) = _City;
|
||||
|
||||
factory City.fromJson(Map<String, dynamic> json) => _$CityFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class GuildAreaActivity with _$GuildAreaActivity {
|
||||
const factory GuildAreaActivity({
|
||||
String? key,
|
||||
String? title,
|
||||
}) = _GuildAreaActivity;
|
||||
|
||||
factory GuildAreaActivity.fromJson(Map<String, dynamic> json) =>
|
||||
_$GuildAreaActivityFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class GuildTypeActivity with _$GuildTypeActivity {
|
||||
const factory GuildTypeActivity({
|
||||
String? key,
|
||||
String? title,
|
||||
}) = _GuildTypeActivity;
|
||||
|
||||
factory GuildTypeActivity.fromJson(Map<String, dynamic> json) =>
|
||||
_$GuildTypeActivityFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class GetPosStatus with _$GetPosStatus {
|
||||
const factory GetPosStatus({
|
||||
int? len_active_sessions,
|
||||
bool? has_pons,
|
||||
bool? has_active_pons,
|
||||
}) = _GetPosStatus;
|
||||
|
||||
factory GetPosStatus.fromJson(Map<String, dynamic> json) =>
|
||||
_$GetPosStatusFromJson(json);
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,244 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'guild_profile.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_GuildProfile _$GuildProfileFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _GuildProfile(
|
||||
id: (json['id'] as num?)?.toInt(),
|
||||
user: json['user'] == null
|
||||
? null
|
||||
: User.fromJson(json['user'] as Map<String, dynamic>),
|
||||
address: json['address'] == null
|
||||
? null
|
||||
: Address.fromJson(json['address'] as Map<String, dynamic>),
|
||||
guild_area_activity: json['guild_area_activity'] == null
|
||||
? null
|
||||
: GuildAreaActivity.fromJson(
|
||||
json['guild_area_activity'] as Map<String, dynamic>,
|
||||
),
|
||||
guild_type_activity: json['guild_type_activity'] == null
|
||||
? null
|
||||
: GuildTypeActivity.fromJson(
|
||||
json['guild_type_activity'] as Map<String, dynamic>,
|
||||
),
|
||||
kill_house: json['kill_house'] as List<dynamic>?,
|
||||
steward_kill_house: json['steward_kill_house'] as List<dynamic>?,
|
||||
stewards: json['stewards'] as List<dynamic>?,
|
||||
get_pos_status: json['get_pos_status'] == null
|
||||
? null
|
||||
: GetPosStatus.fromJson(json['get_pos_status'] as Map<String, dynamic>),
|
||||
key: json['key'] as String?,
|
||||
create_date: json['create_date'] as String?,
|
||||
modify_date: json['modify_date'] as String?,
|
||||
trash: json['trash'] as bool?,
|
||||
user_id_foreign_key: json['user_id_foreign_key'] as String?,
|
||||
address_id_foreign_key: json['address_id_foreign_key'] as String?,
|
||||
user_bank_id_foreign_key: json['user_bank_id_foreign_key'] as String?,
|
||||
wallet_id_foreign_key: json['wallet_id_foreign_key'] as String?,
|
||||
provincial_government_id_key: json['provincial_government_id_key'] as String?,
|
||||
identity_documents: json['identity_documents'],
|
||||
active: json['active'] as bool?,
|
||||
city_number: (json['city_number'] as num?)?.toInt(),
|
||||
city_name: json['city_name'] as String?,
|
||||
guilds_id: json['guilds_id'] as String?,
|
||||
license_number: json['license_number'] as String?,
|
||||
guilds_name: json['guilds_name'] as String?,
|
||||
phone: json['phone'] as String?,
|
||||
type_activity: json['type_activity'] as String?,
|
||||
area_activity: json['area_activity'] as String?,
|
||||
province_number: (json['province_number'] as num?)?.toInt(),
|
||||
province_name: json['province_name'] as String?,
|
||||
steward: json['steward'] as bool?,
|
||||
has_pos: json['has_pos'] as bool?,
|
||||
centers_allocation: json['centers_allocation'],
|
||||
kill_house_centers_allocation: json['kill_house_centers_allocation'],
|
||||
allocation_limit: json['allocation_limit'],
|
||||
limitation_allocation: json['limitation_allocation'] as bool?,
|
||||
registerar_role: json['registerar_role'] as String?,
|
||||
registerar_fullname: json['registerar_fullname'] as String?,
|
||||
registerar_mobile: json['registerar_mobile'] as String?,
|
||||
kill_house_register: json['kill_house_register'] as bool?,
|
||||
steward_register: json['steward_register'] as bool?,
|
||||
guilds_room_register: json['guilds_room_register'] as bool?,
|
||||
pos_company_register: json['pos_company_register'] as bool?,
|
||||
province_accept_state: json['province_accept_state'] as String?,
|
||||
province_message: json['province_message'] as String?,
|
||||
condition: json['condition'] as String?,
|
||||
description_condition: json['description_condition'] as String?,
|
||||
steward_active: json['steward_active'] as bool?,
|
||||
steward_allocation_limit: json['steward_allocation_limit'],
|
||||
steward_limitation_allocation: json['steward_limitation_allocation'] as bool?,
|
||||
license: json['license'] as bool?,
|
||||
license_form: json['license_form'],
|
||||
license_file: json['license_file'],
|
||||
reviewer_role: json['reviewer_role'] as String?,
|
||||
reviewer_fullname: json['reviewer_fullname'] as String?,
|
||||
reviewer_mobile: json['reviewer_mobile'] as String?,
|
||||
checker_message: json['checker_message'] as String?,
|
||||
final_accept: json['final_accept'] as bool?,
|
||||
temporary_registration: json['temporary_registration'] as bool?,
|
||||
created_by: json['created_by'] as String?,
|
||||
modified_by: json['modified_by'] as String?,
|
||||
user_bank_info: json['user_bank_info'],
|
||||
wallet: (json['wallet'] as num?)?.toInt(),
|
||||
cars: json['cars'] as List<dynamic>?,
|
||||
user_level: json['user_level'] as List<dynamic>?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$GuildProfileToJson(_GuildProfile instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'user': instance.user,
|
||||
'address': instance.address,
|
||||
'guild_area_activity': instance.guild_area_activity,
|
||||
'guild_type_activity': instance.guild_type_activity,
|
||||
'kill_house': instance.kill_house,
|
||||
'steward_kill_house': instance.steward_kill_house,
|
||||
'stewards': instance.stewards,
|
||||
'get_pos_status': instance.get_pos_status,
|
||||
'key': instance.key,
|
||||
'create_date': instance.create_date,
|
||||
'modify_date': instance.modify_date,
|
||||
'trash': instance.trash,
|
||||
'user_id_foreign_key': instance.user_id_foreign_key,
|
||||
'address_id_foreign_key': instance.address_id_foreign_key,
|
||||
'user_bank_id_foreign_key': instance.user_bank_id_foreign_key,
|
||||
'wallet_id_foreign_key': instance.wallet_id_foreign_key,
|
||||
'provincial_government_id_key': instance.provincial_government_id_key,
|
||||
'identity_documents': instance.identity_documents,
|
||||
'active': instance.active,
|
||||
'city_number': instance.city_number,
|
||||
'city_name': instance.city_name,
|
||||
'guilds_id': instance.guilds_id,
|
||||
'license_number': instance.license_number,
|
||||
'guilds_name': instance.guilds_name,
|
||||
'phone': instance.phone,
|
||||
'type_activity': instance.type_activity,
|
||||
'area_activity': instance.area_activity,
|
||||
'province_number': instance.province_number,
|
||||
'province_name': instance.province_name,
|
||||
'steward': instance.steward,
|
||||
'has_pos': instance.has_pos,
|
||||
'centers_allocation': instance.centers_allocation,
|
||||
'kill_house_centers_allocation': instance.kill_house_centers_allocation,
|
||||
'allocation_limit': instance.allocation_limit,
|
||||
'limitation_allocation': instance.limitation_allocation,
|
||||
'registerar_role': instance.registerar_role,
|
||||
'registerar_fullname': instance.registerar_fullname,
|
||||
'registerar_mobile': instance.registerar_mobile,
|
||||
'kill_house_register': instance.kill_house_register,
|
||||
'steward_register': instance.steward_register,
|
||||
'guilds_room_register': instance.guilds_room_register,
|
||||
'pos_company_register': instance.pos_company_register,
|
||||
'province_accept_state': instance.province_accept_state,
|
||||
'province_message': instance.province_message,
|
||||
'condition': instance.condition,
|
||||
'description_condition': instance.description_condition,
|
||||
'steward_active': instance.steward_active,
|
||||
'steward_allocation_limit': instance.steward_allocation_limit,
|
||||
'steward_limitation_allocation': instance.steward_limitation_allocation,
|
||||
'license': instance.license,
|
||||
'license_form': instance.license_form,
|
||||
'license_file': instance.license_file,
|
||||
'reviewer_role': instance.reviewer_role,
|
||||
'reviewer_fullname': instance.reviewer_fullname,
|
||||
'reviewer_mobile': instance.reviewer_mobile,
|
||||
'checker_message': instance.checker_message,
|
||||
'final_accept': instance.final_accept,
|
||||
'temporary_registration': instance.temporary_registration,
|
||||
'created_by': instance.created_by,
|
||||
'modified_by': instance.modified_by,
|
||||
'user_bank_info': instance.user_bank_info,
|
||||
'wallet': instance.wallet,
|
||||
'cars': instance.cars,
|
||||
'user_level': instance.user_level,
|
||||
};
|
||||
|
||||
_User _$UserFromJson(Map<String, dynamic> json) => _User(
|
||||
fullname: json['fullname'] as String?,
|
||||
first_name: json['first_name'] as String?,
|
||||
last_name: json['last_name'] as String?,
|
||||
mobile: json['mobile'] as String?,
|
||||
national_id: json['national_id'] as String?,
|
||||
city: json['city'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$UserToJson(_User instance) => <String, dynamic>{
|
||||
'fullname': instance.fullname,
|
||||
'first_name': instance.first_name,
|
||||
'last_name': instance.last_name,
|
||||
'mobile': instance.mobile,
|
||||
'national_id': instance.national_id,
|
||||
'city': instance.city,
|
||||
};
|
||||
|
||||
_Address _$AddressFromJson(Map<String, dynamic> json) => _Address(
|
||||
province: json['province'] == null
|
||||
? null
|
||||
: Province.fromJson(json['province'] as Map<String, dynamic>),
|
||||
city: json['city'] == null
|
||||
? null
|
||||
: City.fromJson(json['city'] as Map<String, dynamic>),
|
||||
address: json['address'] as String?,
|
||||
postal_code: json['postal_code'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$AddressToJson(_Address instance) => <String, dynamic>{
|
||||
'province': instance.province,
|
||||
'city': instance.city,
|
||||
'address': instance.address,
|
||||
'postal_code': instance.postal_code,
|
||||
};
|
||||
|
||||
_Province _$ProvinceFromJson(Map<String, dynamic> json) =>
|
||||
_Province(key: json['key'] as String?, name: json['name'] as String?);
|
||||
|
||||
Map<String, dynamic> _$ProvinceToJson(_Province instance) => <String, dynamic>{
|
||||
'key': instance.key,
|
||||
'name': instance.name,
|
||||
};
|
||||
|
||||
_City _$CityFromJson(Map<String, dynamic> json) =>
|
||||
_City(key: json['key'] as String?, name: json['name'] as String?);
|
||||
|
||||
Map<String, dynamic> _$CityToJson(_City instance) => <String, dynamic>{
|
||||
'key': instance.key,
|
||||
'name': instance.name,
|
||||
};
|
||||
|
||||
_GuildAreaActivity _$GuildAreaActivityFromJson(Map<String, dynamic> json) =>
|
||||
_GuildAreaActivity(
|
||||
key: json['key'] as String?,
|
||||
title: json['title'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$GuildAreaActivityToJson(_GuildAreaActivity instance) =>
|
||||
<String, dynamic>{'key': instance.key, 'title': instance.title};
|
||||
|
||||
_GuildTypeActivity _$GuildTypeActivityFromJson(Map<String, dynamic> json) =>
|
||||
_GuildTypeActivity(
|
||||
key: json['key'] as String?,
|
||||
title: json['title'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$GuildTypeActivityToJson(_GuildTypeActivity instance) =>
|
||||
<String, dynamic>{'key': instance.key, 'title': instance.title};
|
||||
|
||||
_GetPosStatus _$GetPosStatusFromJson(Map<String, dynamic> json) =>
|
||||
_GetPosStatus(
|
||||
len_active_sessions: (json['len_active_sessions'] as num?)?.toInt(),
|
||||
has_pons: json['has_pons'] as bool?,
|
||||
has_active_pons: json['has_active_pons'] as bool?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$GetPosStatusToJson(_GetPosStatus instance) =>
|
||||
<String, dynamic>{
|
||||
'len_active_sessions': instance.len_active_sessions,
|
||||
'has_pons': instance.has_pons,
|
||||
'has_active_pons': instance.has_active_pons,
|
||||
};
|
||||
@@ -0,0 +1,298 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'imported_loads_model.freezed.dart';
|
||||
part 'imported_loads_model.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class ImportedLoadsModel with _$ImportedLoadsModel {
|
||||
const factory ImportedLoadsModel({
|
||||
int? id,
|
||||
Product? product,
|
||||
KillHouse? killHouse,
|
||||
dynamic toKillHouse,
|
||||
dynamic steward,
|
||||
ToSteward? toSteward,
|
||||
dynamic guilds,
|
||||
dynamic toGuilds,
|
||||
dynamic toColdHouse,
|
||||
int? indexWeight,
|
||||
int? dateTimestamp,
|
||||
int? newState,
|
||||
int? newReceiverState,
|
||||
int? newAllocationState,
|
||||
String? key,
|
||||
String? createDate,
|
||||
String? modifyDate,
|
||||
bool? trash,
|
||||
int? numberOfCarcasses,
|
||||
int? realNumberOfCarcasses,
|
||||
int? receiverRealNumberOfCarcasses,
|
||||
double? weightOfCarcasses,
|
||||
double? realWeightOfCarcasses,
|
||||
double? receiverRealWeightOfCarcasses,
|
||||
double? weightLossOfCarcasses,
|
||||
bool? finalRegistration,
|
||||
String? sellType,
|
||||
String? productName,
|
||||
String? sellerType,
|
||||
String? type,
|
||||
String? saleType,
|
||||
String? allocationType,
|
||||
bool? systemRegistrationCode,
|
||||
int? registrationCode,
|
||||
int? amount,
|
||||
int? totalAmount,
|
||||
int? totalAmountPaid,
|
||||
int? totalAmountRemain,
|
||||
dynamic loggedRegistrationCode,
|
||||
String? state,
|
||||
String? receiverState,
|
||||
String? allocationState,
|
||||
String? date,
|
||||
dynamic role,
|
||||
dynamic stewardTempKey,
|
||||
bool? approvedPriceStatus,
|
||||
bool? calculateStatus,
|
||||
bool? temporaryTrash,
|
||||
bool? temporaryDeleted,
|
||||
dynamic createdBy,
|
||||
dynamic modifiedBy,
|
||||
dynamic wareHouse,
|
||||
dynamic stewardWareHouse,
|
||||
dynamic car,
|
||||
dynamic dispenser,
|
||||
}) = _ImportedLoadsModel;
|
||||
|
||||
factory ImportedLoadsModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$ImportedLoadsModelFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class Product with _$Product {
|
||||
const factory Product({
|
||||
double? weightAverage,
|
||||
}) = _Product;
|
||||
|
||||
factory Product.fromJson(Map<String, dynamic> json) =>
|
||||
_$ProductFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class KillHouse with _$KillHouse {
|
||||
const factory KillHouse({
|
||||
String? key,
|
||||
KillHouseOperator? killHouseOperator,
|
||||
String? name,
|
||||
bool? killer,
|
||||
}) = _KillHouse;
|
||||
|
||||
factory KillHouse.fromJson(Map<String, dynamic> json) =>
|
||||
_$KillHouseFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class KillHouseOperator with _$KillHouseOperator {
|
||||
const factory KillHouseOperator({
|
||||
User? user,
|
||||
}) = _KillHouseOperator;
|
||||
|
||||
factory KillHouseOperator.fromJson(Map<String, dynamic> json) =>
|
||||
_$KillHouseOperatorFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class User with _$User {
|
||||
const factory User({
|
||||
String? fullname,
|
||||
String? firstName,
|
||||
String? lastName,
|
||||
int? baseOrder,
|
||||
String? mobile,
|
||||
String? nationalId,
|
||||
String? nationalCode,
|
||||
String? key,
|
||||
City? city,
|
||||
String? unitName,
|
||||
String? unitNationalId,
|
||||
String? unitRegistrationNumber,
|
||||
String? unitEconomicalNumber,
|
||||
String? unitProvince,
|
||||
String? unitCity,
|
||||
String? unitPostalCode,
|
||||
String? unitAddress,
|
||||
}) = _User;
|
||||
|
||||
factory User.fromJson(Map<String, dynamic> json) => _$UserFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class City with _$City {
|
||||
const factory City({
|
||||
int? id,
|
||||
String? key,
|
||||
String? createDate,
|
||||
String? modifyDate,
|
||||
bool? trash,
|
||||
int? provinceIdForeignKey,
|
||||
int? cityIdKey,
|
||||
String? name,
|
||||
double? productPrice,
|
||||
bool? provinceCenter,
|
||||
int? cityNumber,
|
||||
String? cityName,
|
||||
int? provinceNumber,
|
||||
String? provinceName,
|
||||
dynamic createdBy,
|
||||
dynamic modifiedBy,
|
||||
int? province,
|
||||
}) = _City;
|
||||
|
||||
factory City.fromJson(Map<String, dynamic> json) => _$CityFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class ToSteward with _$ToSteward {
|
||||
const factory ToSteward({
|
||||
int? id,
|
||||
ToStewardUser? user,
|
||||
Address? address,
|
||||
Activity? guildAreaActivity,
|
||||
Activity? guildTypeActivity,
|
||||
List<dynamic>? killHouse,
|
||||
List<dynamic>? stewardKillHouse,
|
||||
List<dynamic>? stewards,
|
||||
PosStatus? getPosStatus,
|
||||
String? key,
|
||||
String? createDate,
|
||||
String? modifyDate,
|
||||
bool? trash,
|
||||
dynamic userIdForeignKey,
|
||||
dynamic addressIdForeignKey,
|
||||
dynamic userBankIdForeignKey,
|
||||
dynamic walletIdForeignKey,
|
||||
dynamic provincialGovernmentIdKey,
|
||||
dynamic identityDocuments,
|
||||
bool? active,
|
||||
int? cityNumber,
|
||||
String? cityName,
|
||||
String? guildsId,
|
||||
String? licenseNumber,
|
||||
String? guildsName,
|
||||
dynamic phone,
|
||||
String? typeActivity,
|
||||
String? areaActivity,
|
||||
int? provinceNumber,
|
||||
String? provinceName,
|
||||
bool? steward,
|
||||
bool? hasPos,
|
||||
dynamic centersAllocation,
|
||||
dynamic killHouseCentersAllocation,
|
||||
dynamic allocationLimit,
|
||||
bool? limitationAllocation,
|
||||
dynamic registerarRole,
|
||||
dynamic registerarFullname,
|
||||
dynamic registerarMobile,
|
||||
bool? killHouseRegister,
|
||||
bool? stewardRegister,
|
||||
bool? guildsRoomRegister,
|
||||
bool? posCompanyRegister,
|
||||
String? provinceAcceptState,
|
||||
dynamic provinceMessage,
|
||||
dynamic condition,
|
||||
dynamic descriptionCondition,
|
||||
bool? stewardActive,
|
||||
dynamic stewardAllocationLimit,
|
||||
bool? stewardLimitationAllocation,
|
||||
bool? license,
|
||||
dynamic licenseForm,
|
||||
dynamic licenseFile,
|
||||
dynamic reviewerRole,
|
||||
dynamic reviewerFullname,
|
||||
dynamic reviewerMobile,
|
||||
dynamic checkerMessage,
|
||||
bool? finalAccept,
|
||||
bool? temporaryRegistration,
|
||||
dynamic createdBy,
|
||||
dynamic modifiedBy,
|
||||
dynamic userBankInfo,
|
||||
int? wallet,
|
||||
List<dynamic>? cars,
|
||||
List<dynamic>? userLevel,
|
||||
}) = _ToSteward;
|
||||
|
||||
factory ToSteward.fromJson(Map<String, dynamic> json) =>
|
||||
_$ToStewardFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class ToStewardUser with _$ToStewardUser {
|
||||
const factory ToStewardUser({
|
||||
String? fullname,
|
||||
String? firstName,
|
||||
String? lastName,
|
||||
String? mobile,
|
||||
String? nationalId,
|
||||
String? city,
|
||||
}) = _ToStewardUser;
|
||||
|
||||
factory ToStewardUser.fromJson(Map<String, dynamic> json) =>
|
||||
_$ToStewardUserFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class Address with _$Address {
|
||||
const factory Address({
|
||||
Province? province,
|
||||
CitySimple? city,
|
||||
String? address,
|
||||
String? postalCode,
|
||||
}) = _Address;
|
||||
|
||||
factory Address.fromJson(Map<String, dynamic> json) =>
|
||||
_$AddressFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class Province with _$Province {
|
||||
const factory Province({
|
||||
String? key,
|
||||
String? name,
|
||||
}) = _Province;
|
||||
|
||||
factory Province.fromJson(Map<String, dynamic> json) =>
|
||||
_$ProvinceFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class CitySimple with _$CitySimple {
|
||||
const factory CitySimple({
|
||||
String? key,
|
||||
String? name,
|
||||
}) = _CitySimple;
|
||||
|
||||
factory CitySimple.fromJson(Map<String, dynamic> json) =>
|
||||
_$CitySimpleFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class Activity with _$Activity {
|
||||
const factory Activity({
|
||||
String? key,
|
||||
String? title,
|
||||
}) = _Activity;
|
||||
|
||||
factory Activity.fromJson(Map<String, dynamic> json) =>
|
||||
_$ActivityFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class PosStatus with _$PosStatus {
|
||||
const factory PosStatus({
|
||||
int? lenActiveSessions,
|
||||
bool? hasPons,
|
||||
bool? hasActivePons,
|
||||
}) = _PosStatus;
|
||||
|
||||
factory PosStatus.fromJson(Map<String, dynamic> json) =>
|
||||
_$PosStatusFromJson(json);
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,473 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'imported_loads_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_ImportedLoadsModel _$ImportedLoadsModelFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _ImportedLoadsModel(
|
||||
id: (json['id'] as num?)?.toInt(),
|
||||
product: json['product'] == null
|
||||
? null
|
||||
: Product.fromJson(json['product'] as Map<String, dynamic>),
|
||||
killHouse: json['kill_house'] == null
|
||||
? null
|
||||
: KillHouse.fromJson(json['kill_house'] as Map<String, dynamic>),
|
||||
toKillHouse: json['to_kill_house'],
|
||||
steward: json['steward'],
|
||||
toSteward: json['to_steward'] == null
|
||||
? null
|
||||
: ToSteward.fromJson(json['to_steward'] as Map<String, dynamic>),
|
||||
guilds: json['guilds'],
|
||||
toGuilds: json['to_guilds'],
|
||||
toColdHouse: json['to_cold_house'],
|
||||
indexWeight: (json['index_weight'] as num?)?.toInt(),
|
||||
dateTimestamp: (json['date_timestamp'] as num?)?.toInt(),
|
||||
newState: (json['new_state'] as num?)?.toInt(),
|
||||
newReceiverState: (json['new_receiver_state'] as num?)?.toInt(),
|
||||
newAllocationState: (json['new_allocation_state'] as num?)?.toInt(),
|
||||
key: json['key'] as String?,
|
||||
createDate: json['create_date'] as String?,
|
||||
modifyDate: json['modify_date'] as String?,
|
||||
trash: json['trash'] as bool?,
|
||||
numberOfCarcasses: (json['number_of_carcasses'] as num?)?.toInt(),
|
||||
realNumberOfCarcasses: (json['real_number_of_carcasses'] as num?)?.toInt(),
|
||||
receiverRealNumberOfCarcasses:
|
||||
(json['receiver_real_number_of_carcasses'] as num?)?.toInt(),
|
||||
weightOfCarcasses: (json['weight_of_carcasses'] as num?)?.toDouble(),
|
||||
realWeightOfCarcasses: (json['real_weight_of_carcasses'] as num?)?.toDouble(),
|
||||
receiverRealWeightOfCarcasses:
|
||||
(json['receiver_real_weight_of_carcasses'] as num?)?.toDouble(),
|
||||
weightLossOfCarcasses: (json['weight_loss_of_carcasses'] as num?)?.toDouble(),
|
||||
finalRegistration: json['final_registration'] as bool?,
|
||||
sellType: json['sell_type'] as String?,
|
||||
productName: json['product_name'] as String?,
|
||||
sellerType: json['seller_type'] as String?,
|
||||
type: json['type'] as String?,
|
||||
saleType: json['sale_type'] as String?,
|
||||
allocationType: json['allocation_type'] as String?,
|
||||
systemRegistrationCode: json['system_registration_code'] as bool?,
|
||||
registrationCode: (json['registration_code'] as num?)?.toInt(),
|
||||
amount: (json['amount'] as num?)?.toInt(),
|
||||
totalAmount: (json['total_amount'] as num?)?.toInt(),
|
||||
totalAmountPaid: (json['total_amount_paid'] as num?)?.toInt(),
|
||||
totalAmountRemain: (json['total_amount_remain'] as num?)?.toInt(),
|
||||
loggedRegistrationCode: json['logged_registration_code'],
|
||||
state: json['state'] as String?,
|
||||
receiverState: json['receiver_state'] as String?,
|
||||
allocationState: json['allocation_state'] as String?,
|
||||
date: json['date'] as String?,
|
||||
role: json['role'],
|
||||
stewardTempKey: json['steward_temp_key'],
|
||||
approvedPriceStatus: json['approved_price_status'] as bool?,
|
||||
calculateStatus: json['calculate_status'] as bool?,
|
||||
temporaryTrash: json['temporary_trash'] as bool?,
|
||||
temporaryDeleted: json['temporary_deleted'] as bool?,
|
||||
createdBy: json['created_by'],
|
||||
modifiedBy: json['modified_by'],
|
||||
wareHouse: json['ware_house'],
|
||||
stewardWareHouse: json['steward_ware_house'],
|
||||
car: json['car'],
|
||||
dispenser: json['dispenser'],
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ImportedLoadsModelToJson(
|
||||
_ImportedLoadsModel instance,
|
||||
) => <String, dynamic>{
|
||||
'id': instance.id,
|
||||
'product': instance.product,
|
||||
'kill_house': instance.killHouse,
|
||||
'to_kill_house': instance.toKillHouse,
|
||||
'steward': instance.steward,
|
||||
'to_steward': instance.toSteward,
|
||||
'guilds': instance.guilds,
|
||||
'to_guilds': instance.toGuilds,
|
||||
'to_cold_house': instance.toColdHouse,
|
||||
'index_weight': instance.indexWeight,
|
||||
'date_timestamp': instance.dateTimestamp,
|
||||
'new_state': instance.newState,
|
||||
'new_receiver_state': instance.newReceiverState,
|
||||
'new_allocation_state': instance.newAllocationState,
|
||||
'key': instance.key,
|
||||
'create_date': instance.createDate,
|
||||
'modify_date': instance.modifyDate,
|
||||
'trash': instance.trash,
|
||||
'number_of_carcasses': instance.numberOfCarcasses,
|
||||
'real_number_of_carcasses': instance.realNumberOfCarcasses,
|
||||
'receiver_real_number_of_carcasses': instance.receiverRealNumberOfCarcasses,
|
||||
'weight_of_carcasses': instance.weightOfCarcasses,
|
||||
'real_weight_of_carcasses': instance.realWeightOfCarcasses,
|
||||
'receiver_real_weight_of_carcasses': instance.receiverRealWeightOfCarcasses,
|
||||
'weight_loss_of_carcasses': instance.weightLossOfCarcasses,
|
||||
'final_registration': instance.finalRegistration,
|
||||
'sell_type': instance.sellType,
|
||||
'product_name': instance.productName,
|
||||
'seller_type': instance.sellerType,
|
||||
'type': instance.type,
|
||||
'sale_type': instance.saleType,
|
||||
'allocation_type': instance.allocationType,
|
||||
'system_registration_code': instance.systemRegistrationCode,
|
||||
'registration_code': instance.registrationCode,
|
||||
'amount': instance.amount,
|
||||
'total_amount': instance.totalAmount,
|
||||
'total_amount_paid': instance.totalAmountPaid,
|
||||
'total_amount_remain': instance.totalAmountRemain,
|
||||
'logged_registration_code': instance.loggedRegistrationCode,
|
||||
'state': instance.state,
|
||||
'receiver_state': instance.receiverState,
|
||||
'allocation_state': instance.allocationState,
|
||||
'date': instance.date,
|
||||
'role': instance.role,
|
||||
'steward_temp_key': instance.stewardTempKey,
|
||||
'approved_price_status': instance.approvedPriceStatus,
|
||||
'calculate_status': instance.calculateStatus,
|
||||
'temporary_trash': instance.temporaryTrash,
|
||||
'temporary_deleted': instance.temporaryDeleted,
|
||||
'created_by': instance.createdBy,
|
||||
'modified_by': instance.modifiedBy,
|
||||
'ware_house': instance.wareHouse,
|
||||
'steward_ware_house': instance.stewardWareHouse,
|
||||
'car': instance.car,
|
||||
'dispenser': instance.dispenser,
|
||||
};
|
||||
|
||||
_Product _$ProductFromJson(Map<String, dynamic> json) =>
|
||||
_Product(weightAverage: (json['weight_average'] as num?)?.toDouble());
|
||||
|
||||
Map<String, dynamic> _$ProductToJson(_Product instance) => <String, dynamic>{
|
||||
'weight_average': instance.weightAverage,
|
||||
};
|
||||
|
||||
_KillHouse _$KillHouseFromJson(Map<String, dynamic> json) => _KillHouse(
|
||||
key: json['key'] as String?,
|
||||
killHouseOperator: json['kill_house_operator'] == null
|
||||
? null
|
||||
: KillHouseOperator.fromJson(
|
||||
json['kill_house_operator'] as Map<String, dynamic>,
|
||||
),
|
||||
name: json['name'] as String?,
|
||||
killer: json['killer'] as bool?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$KillHouseToJson(_KillHouse instance) =>
|
||||
<String, dynamic>{
|
||||
'key': instance.key,
|
||||
'kill_house_operator': instance.killHouseOperator,
|
||||
'name': instance.name,
|
||||
'killer': instance.killer,
|
||||
};
|
||||
|
||||
_KillHouseOperator _$KillHouseOperatorFromJson(Map<String, dynamic> json) =>
|
||||
_KillHouseOperator(
|
||||
user: json['user'] == null
|
||||
? null
|
||||
: User.fromJson(json['user'] as Map<String, dynamic>),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$KillHouseOperatorToJson(_KillHouseOperator instance) =>
|
||||
<String, dynamic>{'user': instance.user};
|
||||
|
||||
_User _$UserFromJson(Map<String, dynamic> json) => _User(
|
||||
fullname: json['fullname'] as String?,
|
||||
firstName: json['first_name'] as String?,
|
||||
lastName: json['last_name'] as String?,
|
||||
baseOrder: (json['base_order'] as num?)?.toInt(),
|
||||
mobile: json['mobile'] as String?,
|
||||
nationalId: json['national_id'] as String?,
|
||||
nationalCode: json['national_code'] as String?,
|
||||
key: json['key'] as String?,
|
||||
city: json['city'] == null
|
||||
? null
|
||||
: City.fromJson(json['city'] as Map<String, dynamic>),
|
||||
unitName: json['unit_name'] as String?,
|
||||
unitNationalId: json['unit_national_id'] as String?,
|
||||
unitRegistrationNumber: json['unit_registration_number'] as String?,
|
||||
unitEconomicalNumber: json['unit_economical_number'] as String?,
|
||||
unitProvince: json['unit_province'] as String?,
|
||||
unitCity: json['unit_city'] as String?,
|
||||
unitPostalCode: json['unit_postal_code'] as String?,
|
||||
unitAddress: json['unit_address'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$UserToJson(_User instance) => <String, dynamic>{
|
||||
'fullname': instance.fullname,
|
||||
'first_name': instance.firstName,
|
||||
'last_name': instance.lastName,
|
||||
'base_order': instance.baseOrder,
|
||||
'mobile': instance.mobile,
|
||||
'national_id': instance.nationalId,
|
||||
'national_code': instance.nationalCode,
|
||||
'key': instance.key,
|
||||
'city': instance.city,
|
||||
'unit_name': instance.unitName,
|
||||
'unit_national_id': instance.unitNationalId,
|
||||
'unit_registration_number': instance.unitRegistrationNumber,
|
||||
'unit_economical_number': instance.unitEconomicalNumber,
|
||||
'unit_province': instance.unitProvince,
|
||||
'unit_city': instance.unitCity,
|
||||
'unit_postal_code': instance.unitPostalCode,
|
||||
'unit_address': instance.unitAddress,
|
||||
};
|
||||
|
||||
_City _$CityFromJson(Map<String, dynamic> json) => _City(
|
||||
id: (json['id'] as num?)?.toInt(),
|
||||
key: json['key'] as String?,
|
||||
createDate: json['create_date'] as String?,
|
||||
modifyDate: json['modify_date'] as String?,
|
||||
trash: json['trash'] as bool?,
|
||||
provinceIdForeignKey: (json['province_id_foreign_key'] as num?)?.toInt(),
|
||||
cityIdKey: (json['city_id_key'] as num?)?.toInt(),
|
||||
name: json['name'] as String?,
|
||||
productPrice: (json['product_price'] as num?)?.toDouble(),
|
||||
provinceCenter: json['province_center'] as bool?,
|
||||
cityNumber: (json['city_number'] as num?)?.toInt(),
|
||||
cityName: json['city_name'] as String?,
|
||||
provinceNumber: (json['province_number'] as num?)?.toInt(),
|
||||
provinceName: json['province_name'] as String?,
|
||||
createdBy: json['created_by'],
|
||||
modifiedBy: json['modified_by'],
|
||||
province: (json['province'] as num?)?.toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$CityToJson(_City instance) => <String, dynamic>{
|
||||
'id': instance.id,
|
||||
'key': instance.key,
|
||||
'create_date': instance.createDate,
|
||||
'modify_date': instance.modifyDate,
|
||||
'trash': instance.trash,
|
||||
'province_id_foreign_key': instance.provinceIdForeignKey,
|
||||
'city_id_key': instance.cityIdKey,
|
||||
'name': instance.name,
|
||||
'product_price': instance.productPrice,
|
||||
'province_center': instance.provinceCenter,
|
||||
'city_number': instance.cityNumber,
|
||||
'city_name': instance.cityName,
|
||||
'province_number': instance.provinceNumber,
|
||||
'province_name': instance.provinceName,
|
||||
'created_by': instance.createdBy,
|
||||
'modified_by': instance.modifiedBy,
|
||||
'province': instance.province,
|
||||
};
|
||||
|
||||
_ToSteward _$ToStewardFromJson(Map<String, dynamic> json) => _ToSteward(
|
||||
id: (json['id'] as num?)?.toInt(),
|
||||
user: json['user'] == null
|
||||
? null
|
||||
: ToStewardUser.fromJson(json['user'] as Map<String, dynamic>),
|
||||
address: json['address'] == null
|
||||
? null
|
||||
: Address.fromJson(json['address'] as Map<String, dynamic>),
|
||||
guildAreaActivity: json['guild_area_activity'] == null
|
||||
? null
|
||||
: Activity.fromJson(json['guild_area_activity'] as Map<String, dynamic>),
|
||||
guildTypeActivity: json['guild_type_activity'] == null
|
||||
? null
|
||||
: Activity.fromJson(json['guild_type_activity'] as Map<String, dynamic>),
|
||||
killHouse: json['kill_house'] as List<dynamic>?,
|
||||
stewardKillHouse: json['steward_kill_house'] as List<dynamic>?,
|
||||
stewards: json['stewards'] as List<dynamic>?,
|
||||
getPosStatus: json['get_pos_status'] == null
|
||||
? null
|
||||
: PosStatus.fromJson(json['get_pos_status'] as Map<String, dynamic>),
|
||||
key: json['key'] as String?,
|
||||
createDate: json['create_date'] as String?,
|
||||
modifyDate: json['modify_date'] as String?,
|
||||
trash: json['trash'] as bool?,
|
||||
userIdForeignKey: json['user_id_foreign_key'],
|
||||
addressIdForeignKey: json['address_id_foreign_key'],
|
||||
userBankIdForeignKey: json['user_bank_id_foreign_key'],
|
||||
walletIdForeignKey: json['wallet_id_foreign_key'],
|
||||
provincialGovernmentIdKey: json['provincial_government_id_key'],
|
||||
identityDocuments: json['identity_documents'],
|
||||
active: json['active'] as bool?,
|
||||
cityNumber: (json['city_number'] as num?)?.toInt(),
|
||||
cityName: json['city_name'] as String?,
|
||||
guildsId: json['guilds_id'] as String?,
|
||||
licenseNumber: json['license_number'] as String?,
|
||||
guildsName: json['guilds_name'] as String?,
|
||||
phone: json['phone'],
|
||||
typeActivity: json['type_activity'] as String?,
|
||||
areaActivity: json['area_activity'] as String?,
|
||||
provinceNumber: (json['province_number'] as num?)?.toInt(),
|
||||
provinceName: json['province_name'] as String?,
|
||||
steward: json['steward'] as bool?,
|
||||
hasPos: json['has_pos'] as bool?,
|
||||
centersAllocation: json['centers_allocation'],
|
||||
killHouseCentersAllocation: json['kill_house_centers_allocation'],
|
||||
allocationLimit: json['allocation_limit'],
|
||||
limitationAllocation: json['limitation_allocation'] as bool?,
|
||||
registerarRole: json['registerar_role'],
|
||||
registerarFullname: json['registerar_fullname'],
|
||||
registerarMobile: json['registerar_mobile'],
|
||||
killHouseRegister: json['kill_house_register'] as bool?,
|
||||
stewardRegister: json['steward_register'] as bool?,
|
||||
guildsRoomRegister: json['guilds_room_register'] as bool?,
|
||||
posCompanyRegister: json['pos_company_register'] as bool?,
|
||||
provinceAcceptState: json['province_accept_state'] as String?,
|
||||
provinceMessage: json['province_message'],
|
||||
condition: json['condition'],
|
||||
descriptionCondition: json['description_condition'],
|
||||
stewardActive: json['steward_active'] as bool?,
|
||||
stewardAllocationLimit: json['steward_allocation_limit'],
|
||||
stewardLimitationAllocation: json['steward_limitation_allocation'] as bool?,
|
||||
license: json['license'] as bool?,
|
||||
licenseForm: json['license_form'],
|
||||
licenseFile: json['license_file'],
|
||||
reviewerRole: json['reviewer_role'],
|
||||
reviewerFullname: json['reviewer_fullname'],
|
||||
reviewerMobile: json['reviewer_mobile'],
|
||||
checkerMessage: json['checker_message'],
|
||||
finalAccept: json['final_accept'] as bool?,
|
||||
temporaryRegistration: json['temporary_registration'] as bool?,
|
||||
createdBy: json['created_by'],
|
||||
modifiedBy: json['modified_by'],
|
||||
userBankInfo: json['user_bank_info'],
|
||||
wallet: (json['wallet'] as num?)?.toInt(),
|
||||
cars: json['cars'] as List<dynamic>?,
|
||||
userLevel: json['user_level'] as List<dynamic>?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ToStewardToJson(_ToSteward instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'user': instance.user,
|
||||
'address': instance.address,
|
||||
'guild_area_activity': instance.guildAreaActivity,
|
||||
'guild_type_activity': instance.guildTypeActivity,
|
||||
'kill_house': instance.killHouse,
|
||||
'steward_kill_house': instance.stewardKillHouse,
|
||||
'stewards': instance.stewards,
|
||||
'get_pos_status': instance.getPosStatus,
|
||||
'key': instance.key,
|
||||
'create_date': instance.createDate,
|
||||
'modify_date': instance.modifyDate,
|
||||
'trash': instance.trash,
|
||||
'user_id_foreign_key': instance.userIdForeignKey,
|
||||
'address_id_foreign_key': instance.addressIdForeignKey,
|
||||
'user_bank_id_foreign_key': instance.userBankIdForeignKey,
|
||||
'wallet_id_foreign_key': instance.walletIdForeignKey,
|
||||
'provincial_government_id_key': instance.provincialGovernmentIdKey,
|
||||
'identity_documents': instance.identityDocuments,
|
||||
'active': instance.active,
|
||||
'city_number': instance.cityNumber,
|
||||
'city_name': instance.cityName,
|
||||
'guilds_id': instance.guildsId,
|
||||
'license_number': instance.licenseNumber,
|
||||
'guilds_name': instance.guildsName,
|
||||
'phone': instance.phone,
|
||||
'type_activity': instance.typeActivity,
|
||||
'area_activity': instance.areaActivity,
|
||||
'province_number': instance.provinceNumber,
|
||||
'province_name': instance.provinceName,
|
||||
'steward': instance.steward,
|
||||
'has_pos': instance.hasPos,
|
||||
'centers_allocation': instance.centersAllocation,
|
||||
'kill_house_centers_allocation': instance.killHouseCentersAllocation,
|
||||
'allocation_limit': instance.allocationLimit,
|
||||
'limitation_allocation': instance.limitationAllocation,
|
||||
'registerar_role': instance.registerarRole,
|
||||
'registerar_fullname': instance.registerarFullname,
|
||||
'registerar_mobile': instance.registerarMobile,
|
||||
'kill_house_register': instance.killHouseRegister,
|
||||
'steward_register': instance.stewardRegister,
|
||||
'guilds_room_register': instance.guildsRoomRegister,
|
||||
'pos_company_register': instance.posCompanyRegister,
|
||||
'province_accept_state': instance.provinceAcceptState,
|
||||
'province_message': instance.provinceMessage,
|
||||
'condition': instance.condition,
|
||||
'description_condition': instance.descriptionCondition,
|
||||
'steward_active': instance.stewardActive,
|
||||
'steward_allocation_limit': instance.stewardAllocationLimit,
|
||||
'steward_limitation_allocation': instance.stewardLimitationAllocation,
|
||||
'license': instance.license,
|
||||
'license_form': instance.licenseForm,
|
||||
'license_file': instance.licenseFile,
|
||||
'reviewer_role': instance.reviewerRole,
|
||||
'reviewer_fullname': instance.reviewerFullname,
|
||||
'reviewer_mobile': instance.reviewerMobile,
|
||||
'checker_message': instance.checkerMessage,
|
||||
'final_accept': instance.finalAccept,
|
||||
'temporary_registration': instance.temporaryRegistration,
|
||||
'created_by': instance.createdBy,
|
||||
'modified_by': instance.modifiedBy,
|
||||
'user_bank_info': instance.userBankInfo,
|
||||
'wallet': instance.wallet,
|
||||
'cars': instance.cars,
|
||||
'user_level': instance.userLevel,
|
||||
};
|
||||
|
||||
_ToStewardUser _$ToStewardUserFromJson(Map<String, dynamic> json) =>
|
||||
_ToStewardUser(
|
||||
fullname: json['fullname'] as String?,
|
||||
firstName: json['first_name'] as String?,
|
||||
lastName: json['last_name'] as String?,
|
||||
mobile: json['mobile'] as String?,
|
||||
nationalId: json['national_id'] as String?,
|
||||
city: json['city'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ToStewardUserToJson(_ToStewardUser instance) =>
|
||||
<String, dynamic>{
|
||||
'fullname': instance.fullname,
|
||||
'first_name': instance.firstName,
|
||||
'last_name': instance.lastName,
|
||||
'mobile': instance.mobile,
|
||||
'national_id': instance.nationalId,
|
||||
'city': instance.city,
|
||||
};
|
||||
|
||||
_Address _$AddressFromJson(Map<String, dynamic> json) => _Address(
|
||||
province: json['province'] == null
|
||||
? null
|
||||
: Province.fromJson(json['province'] as Map<String, dynamic>),
|
||||
city: json['city'] == null
|
||||
? null
|
||||
: CitySimple.fromJson(json['city'] as Map<String, dynamic>),
|
||||
address: json['address'] as String?,
|
||||
postalCode: json['postal_code'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$AddressToJson(_Address instance) => <String, dynamic>{
|
||||
'province': instance.province,
|
||||
'city': instance.city,
|
||||
'address': instance.address,
|
||||
'postal_code': instance.postalCode,
|
||||
};
|
||||
|
||||
_Province _$ProvinceFromJson(Map<String, dynamic> json) =>
|
||||
_Province(key: json['key'] as String?, name: json['name'] as String?);
|
||||
|
||||
Map<String, dynamic> _$ProvinceToJson(_Province instance) => <String, dynamic>{
|
||||
'key': instance.key,
|
||||
'name': instance.name,
|
||||
};
|
||||
|
||||
_CitySimple _$CitySimpleFromJson(Map<String, dynamic> json) =>
|
||||
_CitySimple(key: json['key'] as String?, name: json['name'] as String?);
|
||||
|
||||
Map<String, dynamic> _$CitySimpleToJson(_CitySimple instance) =>
|
||||
<String, dynamic>{'key': instance.key, 'name': instance.name};
|
||||
|
||||
_Activity _$ActivityFromJson(Map<String, dynamic> json) =>
|
||||
_Activity(key: json['key'] as String?, title: json['title'] as String?);
|
||||
|
||||
Map<String, dynamic> _$ActivityToJson(_Activity instance) => <String, dynamic>{
|
||||
'key': instance.key,
|
||||
'title': instance.title,
|
||||
};
|
||||
|
||||
_PosStatus _$PosStatusFromJson(Map<String, dynamic> json) => _PosStatus(
|
||||
lenActiveSessions: (json['len_active_sessions'] as num?)?.toInt(),
|
||||
hasPons: json['has_pons'] as bool?,
|
||||
hasActivePons: json['has_active_pons'] as bool?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$PosStatusToJson(_PosStatus instance) =>
|
||||
<String, dynamic>{
|
||||
'len_active_sessions': instance.lenActiveSessions,
|
||||
'has_pons': instance.hasPons,
|
||||
'has_active_pons': instance.hasActivePons,
|
||||
};
|
||||
@@ -0,0 +1,56 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'inventory_model.freezed.dart';
|
||||
part 'inventory_model.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class InventoryModel with _$InventoryModel {
|
||||
const factory InventoryModel({
|
||||
int? id,
|
||||
String? key,
|
||||
String? createDate,
|
||||
String? modifyDate,
|
||||
bool? trash,
|
||||
String? name,
|
||||
int? provinceGovernmentalCarcassesQuantity,
|
||||
int? provinceGovernmentalCarcassesWeight,
|
||||
int? provinceFreeCarcassesQuantity,
|
||||
int? provinceFreeCarcassesWeight,
|
||||
int? receiveGovernmentalCarcassesQuantity,
|
||||
int? receiveGovernmentalCarcassesWeight,
|
||||
int? receiveFreeCarcassesQuantity,
|
||||
int? receiveFreeCarcassesWeight,
|
||||
int? freeBuyingCarcassesQuantity,
|
||||
int? freeBuyingCarcassesWeight,
|
||||
int? totalGovernmentalCarcassesQuantity,
|
||||
int? totalGovernmentalCarcassesWeight,
|
||||
int? totalFreeBarsCarcassesQuantity,
|
||||
int? totalFreeBarsCarcassesWeight,
|
||||
double? weightAverage,
|
||||
int? totalCarcassesQuantity,
|
||||
int? totalCarcassesWeight,
|
||||
int? freezingQuantity,
|
||||
int? freezingWeight,
|
||||
int? lossWeight,
|
||||
int? outProvinceAllocatedQuantity,
|
||||
int? outProvinceAllocatedWeight,
|
||||
int? provinceAllocatedQuantity,
|
||||
int? provinceAllocatedWeight,
|
||||
int? realAllocatedQuantity,
|
||||
int? realAllocatedWeight,
|
||||
int? coldHouseAllocatedWeight,
|
||||
int? posAllocatedWeight,
|
||||
int? segmentationWeight,
|
||||
int? totalRemainQuantity,
|
||||
int? totalRemainWeight,
|
||||
int? freePrice,
|
||||
int? approvedPrice,
|
||||
bool? approvedPriceStatus,
|
||||
int? parentProduct,
|
||||
int? killHouse,
|
||||
int? guild,
|
||||
}) = _InventoryModel; // Changed to _InventoryModel
|
||||
|
||||
factory InventoryModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$InventoryModelFromJson(json);
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,127 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'inventory_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_InventoryModel _$InventoryModelFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _InventoryModel(
|
||||
id: (json['id'] as num?)?.toInt(),
|
||||
key: json['key'] as String?,
|
||||
createDate: json['create_date'] as String?,
|
||||
modifyDate: json['modify_date'] as String?,
|
||||
trash: json['trash'] as bool?,
|
||||
name: json['name'] as String?,
|
||||
provinceGovernmentalCarcassesQuantity:
|
||||
(json['province_governmental_carcasses_quantity'] as num?)?.toInt(),
|
||||
provinceGovernmentalCarcassesWeight:
|
||||
(json['province_governmental_carcasses_weight'] as num?)?.toInt(),
|
||||
provinceFreeCarcassesQuantity:
|
||||
(json['province_free_carcasses_quantity'] as num?)?.toInt(),
|
||||
provinceFreeCarcassesWeight: (json['province_free_carcasses_weight'] as num?)
|
||||
?.toInt(),
|
||||
receiveGovernmentalCarcassesQuantity:
|
||||
(json['receive_governmental_carcasses_quantity'] as num?)?.toInt(),
|
||||
receiveGovernmentalCarcassesWeight:
|
||||
(json['receive_governmental_carcasses_weight'] as num?)?.toInt(),
|
||||
receiveFreeCarcassesQuantity:
|
||||
(json['receive_free_carcasses_quantity'] as num?)?.toInt(),
|
||||
receiveFreeCarcassesWeight: (json['receive_free_carcasses_weight'] as num?)
|
||||
?.toInt(),
|
||||
freeBuyingCarcassesQuantity: (json['free_buying_carcasses_quantity'] as num?)
|
||||
?.toInt(),
|
||||
freeBuyingCarcassesWeight: (json['free_buying_carcasses_weight'] as num?)
|
||||
?.toInt(),
|
||||
totalGovernmentalCarcassesQuantity:
|
||||
(json['total_governmental_carcasses_quantity'] as num?)?.toInt(),
|
||||
totalGovernmentalCarcassesWeight:
|
||||
(json['total_governmental_carcasses_weight'] as num?)?.toInt(),
|
||||
totalFreeBarsCarcassesQuantity:
|
||||
(json['total_free_bars_carcasses_quantity'] as num?)?.toInt(),
|
||||
totalFreeBarsCarcassesWeight:
|
||||
(json['total_free_bars_carcasses_weight'] as num?)?.toInt(),
|
||||
weightAverage: (json['weight_average'] as num?)?.toDouble(),
|
||||
totalCarcassesQuantity: (json['total_carcasses_quantity'] as num?)?.toInt(),
|
||||
totalCarcassesWeight: (json['total_carcasses_weight'] as num?)?.toInt(),
|
||||
freezingQuantity: (json['freezing_quantity'] as num?)?.toInt(),
|
||||
freezingWeight: (json['freezing_weight'] as num?)?.toInt(),
|
||||
lossWeight: (json['loss_weight'] as num?)?.toInt(),
|
||||
outProvinceAllocatedQuantity:
|
||||
(json['out_province_allocated_quantity'] as num?)?.toInt(),
|
||||
outProvinceAllocatedWeight: (json['out_province_allocated_weight'] as num?)
|
||||
?.toInt(),
|
||||
provinceAllocatedQuantity: (json['province_allocated_quantity'] as num?)
|
||||
?.toInt(),
|
||||
provinceAllocatedWeight: (json['province_allocated_weight'] as num?)?.toInt(),
|
||||
realAllocatedQuantity: (json['real_allocated_quantity'] as num?)?.toInt(),
|
||||
realAllocatedWeight: (json['real_allocated_weight'] as num?)?.toInt(),
|
||||
coldHouseAllocatedWeight: (json['cold_house_allocated_weight'] as num?)
|
||||
?.toInt(),
|
||||
posAllocatedWeight: (json['pos_allocated_weight'] as num?)?.toInt(),
|
||||
segmentationWeight: (json['segmentation_weight'] as num?)?.toInt(),
|
||||
totalRemainQuantity: (json['total_remain_quantity'] as num?)?.toInt(),
|
||||
totalRemainWeight: (json['total_remain_weight'] as num?)?.toInt(),
|
||||
freePrice: (json['free_price'] as num?)?.toInt(),
|
||||
approvedPrice: (json['approved_price'] as num?)?.toInt(),
|
||||
approvedPriceStatus: json['approved_price_status'] as bool?,
|
||||
parentProduct: (json['parent_product'] as num?)?.toInt(),
|
||||
killHouse: (json['kill_house'] as num?)?.toInt(),
|
||||
guild: (json['guild'] as num?)?.toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$InventoryModelToJson(
|
||||
_InventoryModel instance,
|
||||
) => <String, dynamic>{
|
||||
'id': instance.id,
|
||||
'key': instance.key,
|
||||
'create_date': instance.createDate,
|
||||
'modify_date': instance.modifyDate,
|
||||
'trash': instance.trash,
|
||||
'name': instance.name,
|
||||
'province_governmental_carcasses_quantity':
|
||||
instance.provinceGovernmentalCarcassesQuantity,
|
||||
'province_governmental_carcasses_weight':
|
||||
instance.provinceGovernmentalCarcassesWeight,
|
||||
'province_free_carcasses_quantity': instance.provinceFreeCarcassesQuantity,
|
||||
'province_free_carcasses_weight': instance.provinceFreeCarcassesWeight,
|
||||
'receive_governmental_carcasses_quantity':
|
||||
instance.receiveGovernmentalCarcassesQuantity,
|
||||
'receive_governmental_carcasses_weight':
|
||||
instance.receiveGovernmentalCarcassesWeight,
|
||||
'receive_free_carcasses_quantity': instance.receiveFreeCarcassesQuantity,
|
||||
'receive_free_carcasses_weight': instance.receiveFreeCarcassesWeight,
|
||||
'free_buying_carcasses_quantity': instance.freeBuyingCarcassesQuantity,
|
||||
'free_buying_carcasses_weight': instance.freeBuyingCarcassesWeight,
|
||||
'total_governmental_carcasses_quantity':
|
||||
instance.totalGovernmentalCarcassesQuantity,
|
||||
'total_governmental_carcasses_weight':
|
||||
instance.totalGovernmentalCarcassesWeight,
|
||||
'total_free_bars_carcasses_quantity': instance.totalFreeBarsCarcassesQuantity,
|
||||
'total_free_bars_carcasses_weight': instance.totalFreeBarsCarcassesWeight,
|
||||
'weight_average': instance.weightAverage,
|
||||
'total_carcasses_quantity': instance.totalCarcassesQuantity,
|
||||
'total_carcasses_weight': instance.totalCarcassesWeight,
|
||||
'freezing_quantity': instance.freezingQuantity,
|
||||
'freezing_weight': instance.freezingWeight,
|
||||
'loss_weight': instance.lossWeight,
|
||||
'out_province_allocated_quantity': instance.outProvinceAllocatedQuantity,
|
||||
'out_province_allocated_weight': instance.outProvinceAllocatedWeight,
|
||||
'province_allocated_quantity': instance.provinceAllocatedQuantity,
|
||||
'province_allocated_weight': instance.provinceAllocatedWeight,
|
||||
'real_allocated_quantity': instance.realAllocatedQuantity,
|
||||
'real_allocated_weight': instance.realAllocatedWeight,
|
||||
'cold_house_allocated_weight': instance.coldHouseAllocatedWeight,
|
||||
'pos_allocated_weight': instance.posAllocatedWeight,
|
||||
'segmentation_weight': instance.segmentationWeight,
|
||||
'total_remain_quantity': instance.totalRemainQuantity,
|
||||
'total_remain_weight': instance.totalRemainWeight,
|
||||
'free_price': instance.freePrice,
|
||||
'approved_price': instance.approvedPrice,
|
||||
'approved_price_status': instance.approvedPriceStatus,
|
||||
'parent_product': instance.parentProduct,
|
||||
'kill_house': instance.killHouse,
|
||||
'guild': instance.guild,
|
||||
};
|
||||
@@ -0,0 +1,16 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'iran_province_city_model.freezed.dart';
|
||||
part 'iran_province_city_model.g.dart';
|
||||
|
||||
|
||||
@freezed
|
||||
abstract class IranProvinceCityModel with _$IranProvinceCityModel {
|
||||
const factory IranProvinceCityModel({
|
||||
int? id,
|
||||
String? name,
|
||||
}) = _IranProvinceCityModel;
|
||||
|
||||
factory IranProvinceCityModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$IranProvinceCityModelFromJson(json);
|
||||
}
|
||||
@@ -0,0 +1,280 @@
|
||||
// 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 'iran_province_city_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
/// @nodoc
|
||||
mixin _$IranProvinceCityModel {
|
||||
|
||||
int? get id; String? get name;
|
||||
/// Create a copy of IranProvinceCityModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$IranProvinceCityModelCopyWith<IranProvinceCityModel> get copyWith => _$IranProvinceCityModelCopyWithImpl<IranProvinceCityModel>(this as IranProvinceCityModel, _$identity);
|
||||
|
||||
/// Serializes this IranProvinceCityModel to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is IranProvinceCityModel&&(identical(other.id, id) || other.id == id)&&(identical(other.name, name) || other.name == name));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,id,name);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'IranProvinceCityModel(id: $id, name: $name)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $IranProvinceCityModelCopyWith<$Res> {
|
||||
factory $IranProvinceCityModelCopyWith(IranProvinceCityModel value, $Res Function(IranProvinceCityModel) _then) = _$IranProvinceCityModelCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
int? id, String? name
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$IranProvinceCityModelCopyWithImpl<$Res>
|
||||
implements $IranProvinceCityModelCopyWith<$Res> {
|
||||
_$IranProvinceCityModelCopyWithImpl(this._self, this._then);
|
||||
|
||||
final IranProvinceCityModel _self;
|
||||
final $Res Function(IranProvinceCityModel) _then;
|
||||
|
||||
/// Create a copy of IranProvinceCityModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? name = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
|
||||
as int?,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [IranProvinceCityModel].
|
||||
extension IranProvinceCityModelPatterns on IranProvinceCityModel {
|
||||
/// 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( _IranProvinceCityModel value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _IranProvinceCityModel() 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( _IranProvinceCityModel value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _IranProvinceCityModel():
|
||||
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( _IranProvinceCityModel value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _IranProvinceCityModel() 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( int? id, String? name)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _IranProvinceCityModel() when $default != null:
|
||||
return $default(_that.id,_that.name);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( int? id, String? name) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _IranProvinceCityModel():
|
||||
return $default(_that.id,_that.name);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( int? id, String? name)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _IranProvinceCityModel() when $default != null:
|
||||
return $default(_that.id,_that.name);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
|
||||
class _IranProvinceCityModel implements IranProvinceCityModel {
|
||||
const _IranProvinceCityModel({this.id, this.name});
|
||||
factory _IranProvinceCityModel.fromJson(Map<String, dynamic> json) => _$IranProvinceCityModelFromJson(json);
|
||||
|
||||
@override final int? id;
|
||||
@override final String? name;
|
||||
|
||||
/// Create a copy of IranProvinceCityModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$IranProvinceCityModelCopyWith<_IranProvinceCityModel> get copyWith => __$IranProvinceCityModelCopyWithImpl<_IranProvinceCityModel>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$IranProvinceCityModelToJson(this, );
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _IranProvinceCityModel&&(identical(other.id, id) || other.id == id)&&(identical(other.name, name) || other.name == name));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,id,name);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'IranProvinceCityModel(id: $id, name: $name)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$IranProvinceCityModelCopyWith<$Res> implements $IranProvinceCityModelCopyWith<$Res> {
|
||||
factory _$IranProvinceCityModelCopyWith(_IranProvinceCityModel value, $Res Function(_IranProvinceCityModel) _then) = __$IranProvinceCityModelCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
int? id, String? name
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$IranProvinceCityModelCopyWithImpl<$Res>
|
||||
implements _$IranProvinceCityModelCopyWith<$Res> {
|
||||
__$IranProvinceCityModelCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _IranProvinceCityModel _self;
|
||||
final $Res Function(_IranProvinceCityModel) _then;
|
||||
|
||||
/// Create a copy of IranProvinceCityModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? name = freezed,}) {
|
||||
return _then(_IranProvinceCityModel(
|
||||
id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
|
||||
as int?,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// dart format on
|
||||
@@ -0,0 +1,18 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'iran_province_city_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_IranProvinceCityModel _$IranProvinceCityModelFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _IranProvinceCityModel(
|
||||
id: (json['id'] as num?)?.toInt(),
|
||||
name: json['name'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$IranProvinceCityModelToJson(
|
||||
_IranProvinceCityModel instance,
|
||||
) => <String, dynamic>{'id': instance.id, 'name': instance.name};
|
||||
@@ -0,0 +1,15 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'kill_house_distribution_info.freezed.dart';
|
||||
part 'kill_house_distribution_info.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class KillHouseDistributionInfo with _$KillHouseDistributionInfo {
|
||||
const factory KillHouseDistributionInfo({
|
||||
double? stewardAllocationsWeight,
|
||||
double? freeSalesWeight,
|
||||
}) = _KillHouseDistributionInfo;
|
||||
|
||||
factory KillHouseDistributionInfo.fromJson(Map<String, dynamic> json) =>
|
||||
_$KillHouseDistributionInfoFromJson(json);
|
||||
}
|
||||
@@ -0,0 +1,280 @@
|
||||
// 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 'kill_house_distribution_info.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
/// @nodoc
|
||||
mixin _$KillHouseDistributionInfo {
|
||||
|
||||
double? get stewardAllocationsWeight; double? get freeSalesWeight;
|
||||
/// Create a copy of KillHouseDistributionInfo
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$KillHouseDistributionInfoCopyWith<KillHouseDistributionInfo> get copyWith => _$KillHouseDistributionInfoCopyWithImpl<KillHouseDistributionInfo>(this as KillHouseDistributionInfo, _$identity);
|
||||
|
||||
/// Serializes this KillHouseDistributionInfo to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is KillHouseDistributionInfo&&(identical(other.stewardAllocationsWeight, stewardAllocationsWeight) || other.stewardAllocationsWeight == stewardAllocationsWeight)&&(identical(other.freeSalesWeight, freeSalesWeight) || other.freeSalesWeight == freeSalesWeight));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,stewardAllocationsWeight,freeSalesWeight);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'KillHouseDistributionInfo(stewardAllocationsWeight: $stewardAllocationsWeight, freeSalesWeight: $freeSalesWeight)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $KillHouseDistributionInfoCopyWith<$Res> {
|
||||
factory $KillHouseDistributionInfoCopyWith(KillHouseDistributionInfo value, $Res Function(KillHouseDistributionInfo) _then) = _$KillHouseDistributionInfoCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
double? stewardAllocationsWeight, double? freeSalesWeight
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$KillHouseDistributionInfoCopyWithImpl<$Res>
|
||||
implements $KillHouseDistributionInfoCopyWith<$Res> {
|
||||
_$KillHouseDistributionInfoCopyWithImpl(this._self, this._then);
|
||||
|
||||
final KillHouseDistributionInfo _self;
|
||||
final $Res Function(KillHouseDistributionInfo) _then;
|
||||
|
||||
/// Create a copy of KillHouseDistributionInfo
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? stewardAllocationsWeight = freezed,Object? freeSalesWeight = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
stewardAllocationsWeight: freezed == stewardAllocationsWeight ? _self.stewardAllocationsWeight : stewardAllocationsWeight // ignore: cast_nullable_to_non_nullable
|
||||
as double?,freeSalesWeight: freezed == freeSalesWeight ? _self.freeSalesWeight : freeSalesWeight // ignore: cast_nullable_to_non_nullable
|
||||
as double?,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [KillHouseDistributionInfo].
|
||||
extension KillHouseDistributionInfoPatterns on KillHouseDistributionInfo {
|
||||
/// 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( _KillHouseDistributionInfo value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _KillHouseDistributionInfo() 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( _KillHouseDistributionInfo value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _KillHouseDistributionInfo():
|
||||
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( _KillHouseDistributionInfo value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _KillHouseDistributionInfo() 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( double? stewardAllocationsWeight, double? freeSalesWeight)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _KillHouseDistributionInfo() when $default != null:
|
||||
return $default(_that.stewardAllocationsWeight,_that.freeSalesWeight);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( double? stewardAllocationsWeight, double? freeSalesWeight) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _KillHouseDistributionInfo():
|
||||
return $default(_that.stewardAllocationsWeight,_that.freeSalesWeight);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( double? stewardAllocationsWeight, double? freeSalesWeight)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _KillHouseDistributionInfo() when $default != null:
|
||||
return $default(_that.stewardAllocationsWeight,_that.freeSalesWeight);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
|
||||
class _KillHouseDistributionInfo implements KillHouseDistributionInfo {
|
||||
const _KillHouseDistributionInfo({this.stewardAllocationsWeight, this.freeSalesWeight});
|
||||
factory _KillHouseDistributionInfo.fromJson(Map<String, dynamic> json) => _$KillHouseDistributionInfoFromJson(json);
|
||||
|
||||
@override final double? stewardAllocationsWeight;
|
||||
@override final double? freeSalesWeight;
|
||||
|
||||
/// Create a copy of KillHouseDistributionInfo
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$KillHouseDistributionInfoCopyWith<_KillHouseDistributionInfo> get copyWith => __$KillHouseDistributionInfoCopyWithImpl<_KillHouseDistributionInfo>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$KillHouseDistributionInfoToJson(this, );
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _KillHouseDistributionInfo&&(identical(other.stewardAllocationsWeight, stewardAllocationsWeight) || other.stewardAllocationsWeight == stewardAllocationsWeight)&&(identical(other.freeSalesWeight, freeSalesWeight) || other.freeSalesWeight == freeSalesWeight));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,stewardAllocationsWeight,freeSalesWeight);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'KillHouseDistributionInfo(stewardAllocationsWeight: $stewardAllocationsWeight, freeSalesWeight: $freeSalesWeight)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$KillHouseDistributionInfoCopyWith<$Res> implements $KillHouseDistributionInfoCopyWith<$Res> {
|
||||
factory _$KillHouseDistributionInfoCopyWith(_KillHouseDistributionInfo value, $Res Function(_KillHouseDistributionInfo) _then) = __$KillHouseDistributionInfoCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
double? stewardAllocationsWeight, double? freeSalesWeight
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$KillHouseDistributionInfoCopyWithImpl<$Res>
|
||||
implements _$KillHouseDistributionInfoCopyWith<$Res> {
|
||||
__$KillHouseDistributionInfoCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _KillHouseDistributionInfo _self;
|
||||
final $Res Function(_KillHouseDistributionInfo) _then;
|
||||
|
||||
/// Create a copy of KillHouseDistributionInfo
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? stewardAllocationsWeight = freezed,Object? freeSalesWeight = freezed,}) {
|
||||
return _then(_KillHouseDistributionInfo(
|
||||
stewardAllocationsWeight: freezed == stewardAllocationsWeight ? _self.stewardAllocationsWeight : stewardAllocationsWeight // ignore: cast_nullable_to_non_nullable
|
||||
as double?,freeSalesWeight: freezed == freeSalesWeight ? _self.freeSalesWeight : freeSalesWeight // ignore: cast_nullable_to_non_nullable
|
||||
as double?,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// dart format on
|
||||
@@ -0,0 +1,22 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'kill_house_distribution_info.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_KillHouseDistributionInfo _$KillHouseDistributionInfoFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _KillHouseDistributionInfo(
|
||||
stewardAllocationsWeight: (json['steward_allocations_weight'] as num?)
|
||||
?.toDouble(),
|
||||
freeSalesWeight: (json['free_sales_weight'] as num?)?.toDouble(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$KillHouseDistributionInfoToJson(
|
||||
_KillHouseDistributionInfo instance,
|
||||
) => <String, dynamic>{
|
||||
'steward_allocations_weight': instance.stewardAllocationsWeight,
|
||||
'free_sales_weight': instance.freeSalesWeight,
|
||||
};
|
||||
@@ -0,0 +1,71 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'kill_house_free_bar.freezed.dart';
|
||||
part 'kill_house_free_bar.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class KillHouseFreeBar with _$KillHouseFreeBar {
|
||||
const factory KillHouseFreeBar({
|
||||
int? id,
|
||||
dynamic killHouse,
|
||||
dynamic exclusiveKiller,
|
||||
String? key,
|
||||
String? createDate,
|
||||
String? modifyDate,
|
||||
bool? trash,
|
||||
String? poultryName,
|
||||
String? poultryMobile,
|
||||
String? sellerName,
|
||||
String? sellerMobile,
|
||||
String? province,
|
||||
String? city,
|
||||
String? vetFarmName,
|
||||
String? vetFarmMobile,
|
||||
String? driverName,
|
||||
String? driverMobile,
|
||||
String? car,
|
||||
String? clearanceCode,
|
||||
String? barClearanceCode,
|
||||
int? quantity,
|
||||
int? numberOfCarcasses,
|
||||
int? weightOfCarcasses,
|
||||
int? killHouseVetQuantity,
|
||||
int? killHouseVetWeight,
|
||||
String? killHouseVetState,
|
||||
String? dateOfAcceptReject,
|
||||
dynamic acceptorRejector,
|
||||
int? liveWeight,
|
||||
String? barImage,
|
||||
String? buyType,
|
||||
bool? wareHouse,
|
||||
String? date,
|
||||
int? wage,
|
||||
int? totalWageAmount,
|
||||
int? unionShare,
|
||||
int? unionSharePercent,
|
||||
int? companyShare,
|
||||
int? companySharePercent,
|
||||
int? guildsShare,
|
||||
int? guildsSharePercent,
|
||||
int? cityShare,
|
||||
int? citySharePercent,
|
||||
int? walletShare,
|
||||
int? walletSharePercent,
|
||||
int? otherShare,
|
||||
int? otherSharePercent,
|
||||
bool? archiveWage,
|
||||
int? weightLoss,
|
||||
bool? calculateStatus,
|
||||
bool? temporaryTrash,
|
||||
bool? temporaryDeleted,
|
||||
String? enteredMessage,
|
||||
int? barCode,
|
||||
String? registerType,
|
||||
dynamic createdBy,
|
||||
dynamic modifiedBy,
|
||||
int? product,
|
||||
}) = _KillHouseFreeBar;
|
||||
|
||||
factory KillHouseFreeBar.fromJson(Map<String, dynamic> json) =>
|
||||
_$KillHouseFreeBarFromJson(json);
|
||||
}
|
||||
@@ -0,0 +1,448 @@
|
||||
// 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 'kill_house_free_bar.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
/// @nodoc
|
||||
mixin _$KillHouseFreeBar {
|
||||
|
||||
int? get id; dynamic get killHouse; dynamic get exclusiveKiller; String? get key; String? get createDate; String? get modifyDate; bool? get trash; String? get poultryName; String? get poultryMobile; String? get sellerName; String? get sellerMobile; String? get province; String? get city; String? get vetFarmName; String? get vetFarmMobile; String? get driverName; String? get driverMobile; String? get car; String? get clearanceCode; String? get barClearanceCode; int? get quantity; int? get numberOfCarcasses; int? get weightOfCarcasses; int? get killHouseVetQuantity; int? get killHouseVetWeight; String? get killHouseVetState; String? get dateOfAcceptReject; dynamic get acceptorRejector; int? get liveWeight; String? get barImage; String? get buyType; bool? get wareHouse; String? get date; int? get wage; int? get totalWageAmount; int? get unionShare; int? get unionSharePercent; int? get companyShare; int? get companySharePercent; int? get guildsShare; int? get guildsSharePercent; int? get cityShare; int? get citySharePercent; int? get walletShare; int? get walletSharePercent; int? get otherShare; int? get otherSharePercent; bool? get archiveWage; int? get weightLoss; bool? get calculateStatus; bool? get temporaryTrash; bool? get temporaryDeleted; String? get enteredMessage; int? get barCode; String? get registerType; dynamic get createdBy; dynamic get modifiedBy; int? get product;
|
||||
/// Create a copy of KillHouseFreeBar
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$KillHouseFreeBarCopyWith<KillHouseFreeBar> get copyWith => _$KillHouseFreeBarCopyWithImpl<KillHouseFreeBar>(this as KillHouseFreeBar, _$identity);
|
||||
|
||||
/// Serializes this KillHouseFreeBar to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is KillHouseFreeBar&&(identical(other.id, id) || other.id == id)&&const DeepCollectionEquality().equals(other.killHouse, killHouse)&&const DeepCollectionEquality().equals(other.exclusiveKiller, exclusiveKiller)&&(identical(other.key, key) || other.key == key)&&(identical(other.createDate, createDate) || other.createDate == createDate)&&(identical(other.modifyDate, modifyDate) || other.modifyDate == modifyDate)&&(identical(other.trash, trash) || other.trash == trash)&&(identical(other.poultryName, poultryName) || other.poultryName == poultryName)&&(identical(other.poultryMobile, poultryMobile) || other.poultryMobile == poultryMobile)&&(identical(other.sellerName, sellerName) || other.sellerName == sellerName)&&(identical(other.sellerMobile, sellerMobile) || other.sellerMobile == sellerMobile)&&(identical(other.province, province) || other.province == province)&&(identical(other.city, city) || other.city == city)&&(identical(other.vetFarmName, vetFarmName) || other.vetFarmName == vetFarmName)&&(identical(other.vetFarmMobile, vetFarmMobile) || other.vetFarmMobile == vetFarmMobile)&&(identical(other.driverName, driverName) || other.driverName == driverName)&&(identical(other.driverMobile, driverMobile) || other.driverMobile == driverMobile)&&(identical(other.car, car) || other.car == car)&&(identical(other.clearanceCode, clearanceCode) || other.clearanceCode == clearanceCode)&&(identical(other.barClearanceCode, barClearanceCode) || other.barClearanceCode == barClearanceCode)&&(identical(other.quantity, quantity) || other.quantity == quantity)&&(identical(other.numberOfCarcasses, numberOfCarcasses) || other.numberOfCarcasses == numberOfCarcasses)&&(identical(other.weightOfCarcasses, weightOfCarcasses) || other.weightOfCarcasses == weightOfCarcasses)&&(identical(other.killHouseVetQuantity, killHouseVetQuantity) || other.killHouseVetQuantity == killHouseVetQuantity)&&(identical(other.killHouseVetWeight, killHouseVetWeight) || other.killHouseVetWeight == killHouseVetWeight)&&(identical(other.killHouseVetState, killHouseVetState) || other.killHouseVetState == killHouseVetState)&&(identical(other.dateOfAcceptReject, dateOfAcceptReject) || other.dateOfAcceptReject == dateOfAcceptReject)&&const DeepCollectionEquality().equals(other.acceptorRejector, acceptorRejector)&&(identical(other.liveWeight, liveWeight) || other.liveWeight == liveWeight)&&(identical(other.barImage, barImage) || other.barImage == barImage)&&(identical(other.buyType, buyType) || other.buyType == buyType)&&(identical(other.wareHouse, wareHouse) || other.wareHouse == wareHouse)&&(identical(other.date, date) || other.date == date)&&(identical(other.wage, wage) || other.wage == wage)&&(identical(other.totalWageAmount, totalWageAmount) || other.totalWageAmount == totalWageAmount)&&(identical(other.unionShare, unionShare) || other.unionShare == unionShare)&&(identical(other.unionSharePercent, unionSharePercent) || other.unionSharePercent == unionSharePercent)&&(identical(other.companyShare, companyShare) || other.companyShare == companyShare)&&(identical(other.companySharePercent, companySharePercent) || other.companySharePercent == companySharePercent)&&(identical(other.guildsShare, guildsShare) || other.guildsShare == guildsShare)&&(identical(other.guildsSharePercent, guildsSharePercent) || other.guildsSharePercent == guildsSharePercent)&&(identical(other.cityShare, cityShare) || other.cityShare == cityShare)&&(identical(other.citySharePercent, citySharePercent) || other.citySharePercent == citySharePercent)&&(identical(other.walletShare, walletShare) || other.walletShare == walletShare)&&(identical(other.walletSharePercent, walletSharePercent) || other.walletSharePercent == walletSharePercent)&&(identical(other.otherShare, otherShare) || other.otherShare == otherShare)&&(identical(other.otherSharePercent, otherSharePercent) || other.otherSharePercent == otherSharePercent)&&(identical(other.archiveWage, archiveWage) || other.archiveWage == archiveWage)&&(identical(other.weightLoss, weightLoss) || other.weightLoss == weightLoss)&&(identical(other.calculateStatus, calculateStatus) || other.calculateStatus == calculateStatus)&&(identical(other.temporaryTrash, temporaryTrash) || other.temporaryTrash == temporaryTrash)&&(identical(other.temporaryDeleted, temporaryDeleted) || other.temporaryDeleted == temporaryDeleted)&&(identical(other.enteredMessage, enteredMessage) || other.enteredMessage == enteredMessage)&&(identical(other.barCode, barCode) || other.barCode == barCode)&&(identical(other.registerType, registerType) || other.registerType == registerType)&&const DeepCollectionEquality().equals(other.createdBy, createdBy)&&const DeepCollectionEquality().equals(other.modifiedBy, modifiedBy)&&(identical(other.product, product) || other.product == product));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hashAll([runtimeType,id,const DeepCollectionEquality().hash(killHouse),const DeepCollectionEquality().hash(exclusiveKiller),key,createDate,modifyDate,trash,poultryName,poultryMobile,sellerName,sellerMobile,province,city,vetFarmName,vetFarmMobile,driverName,driverMobile,car,clearanceCode,barClearanceCode,quantity,numberOfCarcasses,weightOfCarcasses,killHouseVetQuantity,killHouseVetWeight,killHouseVetState,dateOfAcceptReject,const DeepCollectionEquality().hash(acceptorRejector),liveWeight,barImage,buyType,wareHouse,date,wage,totalWageAmount,unionShare,unionSharePercent,companyShare,companySharePercent,guildsShare,guildsSharePercent,cityShare,citySharePercent,walletShare,walletSharePercent,otherShare,otherSharePercent,archiveWage,weightLoss,calculateStatus,temporaryTrash,temporaryDeleted,enteredMessage,barCode,registerType,const DeepCollectionEquality().hash(createdBy),const DeepCollectionEquality().hash(modifiedBy),product]);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'KillHouseFreeBar(id: $id, killHouse: $killHouse, exclusiveKiller: $exclusiveKiller, key: $key, createDate: $createDate, modifyDate: $modifyDate, trash: $trash, poultryName: $poultryName, poultryMobile: $poultryMobile, sellerName: $sellerName, sellerMobile: $sellerMobile, province: $province, city: $city, vetFarmName: $vetFarmName, vetFarmMobile: $vetFarmMobile, driverName: $driverName, driverMobile: $driverMobile, car: $car, clearanceCode: $clearanceCode, barClearanceCode: $barClearanceCode, quantity: $quantity, numberOfCarcasses: $numberOfCarcasses, weightOfCarcasses: $weightOfCarcasses, killHouseVetQuantity: $killHouseVetQuantity, killHouseVetWeight: $killHouseVetWeight, killHouseVetState: $killHouseVetState, dateOfAcceptReject: $dateOfAcceptReject, acceptorRejector: $acceptorRejector, liveWeight: $liveWeight, barImage: $barImage, buyType: $buyType, wareHouse: $wareHouse, date: $date, wage: $wage, totalWageAmount: $totalWageAmount, unionShare: $unionShare, unionSharePercent: $unionSharePercent, companyShare: $companyShare, companySharePercent: $companySharePercent, guildsShare: $guildsShare, guildsSharePercent: $guildsSharePercent, cityShare: $cityShare, citySharePercent: $citySharePercent, walletShare: $walletShare, walletSharePercent: $walletSharePercent, otherShare: $otherShare, otherSharePercent: $otherSharePercent, archiveWage: $archiveWage, weightLoss: $weightLoss, calculateStatus: $calculateStatus, temporaryTrash: $temporaryTrash, temporaryDeleted: $temporaryDeleted, enteredMessage: $enteredMessage, barCode: $barCode, registerType: $registerType, createdBy: $createdBy, modifiedBy: $modifiedBy, product: $product)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $KillHouseFreeBarCopyWith<$Res> {
|
||||
factory $KillHouseFreeBarCopyWith(KillHouseFreeBar value, $Res Function(KillHouseFreeBar) _then) = _$KillHouseFreeBarCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
int? id, dynamic killHouse, dynamic exclusiveKiller, String? key, String? createDate, String? modifyDate, bool? trash, String? poultryName, String? poultryMobile, String? sellerName, String? sellerMobile, String? province, String? city, String? vetFarmName, String? vetFarmMobile, String? driverName, String? driverMobile, String? car, String? clearanceCode, String? barClearanceCode, int? quantity, int? numberOfCarcasses, int? weightOfCarcasses, int? killHouseVetQuantity, int? killHouseVetWeight, String? killHouseVetState, String? dateOfAcceptReject, dynamic acceptorRejector, int? liveWeight, String? barImage, String? buyType, bool? wareHouse, String? date, int? wage, int? totalWageAmount, int? unionShare, int? unionSharePercent, int? companyShare, int? companySharePercent, int? guildsShare, int? guildsSharePercent, int? cityShare, int? citySharePercent, int? walletShare, int? walletSharePercent, int? otherShare, int? otherSharePercent, bool? archiveWage, int? weightLoss, bool? calculateStatus, bool? temporaryTrash, bool? temporaryDeleted, String? enteredMessage, int? barCode, String? registerType, dynamic createdBy, dynamic modifiedBy, int? product
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$KillHouseFreeBarCopyWithImpl<$Res>
|
||||
implements $KillHouseFreeBarCopyWith<$Res> {
|
||||
_$KillHouseFreeBarCopyWithImpl(this._self, this._then);
|
||||
|
||||
final KillHouseFreeBar _self;
|
||||
final $Res Function(KillHouseFreeBar) _then;
|
||||
|
||||
/// Create a copy of KillHouseFreeBar
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? killHouse = freezed,Object? exclusiveKiller = freezed,Object? key = freezed,Object? createDate = freezed,Object? modifyDate = freezed,Object? trash = freezed,Object? poultryName = freezed,Object? poultryMobile = freezed,Object? sellerName = freezed,Object? sellerMobile = freezed,Object? province = freezed,Object? city = freezed,Object? vetFarmName = freezed,Object? vetFarmMobile = freezed,Object? driverName = freezed,Object? driverMobile = freezed,Object? car = freezed,Object? clearanceCode = freezed,Object? barClearanceCode = freezed,Object? quantity = freezed,Object? numberOfCarcasses = freezed,Object? weightOfCarcasses = freezed,Object? killHouseVetQuantity = freezed,Object? killHouseVetWeight = freezed,Object? killHouseVetState = freezed,Object? dateOfAcceptReject = freezed,Object? acceptorRejector = freezed,Object? liveWeight = freezed,Object? barImage = freezed,Object? buyType = freezed,Object? wareHouse = freezed,Object? date = freezed,Object? wage = freezed,Object? totalWageAmount = freezed,Object? unionShare = freezed,Object? unionSharePercent = freezed,Object? companyShare = freezed,Object? companySharePercent = freezed,Object? guildsShare = freezed,Object? guildsSharePercent = freezed,Object? cityShare = freezed,Object? citySharePercent = freezed,Object? walletShare = freezed,Object? walletSharePercent = freezed,Object? otherShare = freezed,Object? otherSharePercent = freezed,Object? archiveWage = freezed,Object? weightLoss = freezed,Object? calculateStatus = freezed,Object? temporaryTrash = freezed,Object? temporaryDeleted = freezed,Object? enteredMessage = freezed,Object? barCode = freezed,Object? registerType = freezed,Object? createdBy = freezed,Object? modifiedBy = freezed,Object? product = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
|
||||
as int?,killHouse: freezed == killHouse ? _self.killHouse : killHouse // ignore: cast_nullable_to_non_nullable
|
||||
as dynamic,exclusiveKiller: freezed == exclusiveKiller ? _self.exclusiveKiller : exclusiveKiller // ignore: cast_nullable_to_non_nullable
|
||||
as dynamic,key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable
|
||||
as String?,createDate: freezed == createDate ? _self.createDate : createDate // ignore: cast_nullable_to_non_nullable
|
||||
as String?,modifyDate: freezed == modifyDate ? _self.modifyDate : modifyDate // ignore: cast_nullable_to_non_nullable
|
||||
as String?,trash: freezed == trash ? _self.trash : trash // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,poultryName: freezed == poultryName ? _self.poultryName : poultryName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,poultryMobile: freezed == poultryMobile ? _self.poultryMobile : poultryMobile // ignore: cast_nullable_to_non_nullable
|
||||
as String?,sellerName: freezed == sellerName ? _self.sellerName : sellerName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,sellerMobile: freezed == sellerMobile ? _self.sellerMobile : sellerMobile // ignore: cast_nullable_to_non_nullable
|
||||
as String?,province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable
|
||||
as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable
|
||||
as String?,vetFarmName: freezed == vetFarmName ? _self.vetFarmName : vetFarmName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,vetFarmMobile: freezed == vetFarmMobile ? _self.vetFarmMobile : vetFarmMobile // ignore: cast_nullable_to_non_nullable
|
||||
as String?,driverName: freezed == driverName ? _self.driverName : driverName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,driverMobile: freezed == driverMobile ? _self.driverMobile : driverMobile // ignore: cast_nullable_to_non_nullable
|
||||
as String?,car: freezed == car ? _self.car : car // ignore: cast_nullable_to_non_nullable
|
||||
as String?,clearanceCode: freezed == clearanceCode ? _self.clearanceCode : clearanceCode // ignore: cast_nullable_to_non_nullable
|
||||
as String?,barClearanceCode: freezed == barClearanceCode ? _self.barClearanceCode : barClearanceCode // ignore: cast_nullable_to_non_nullable
|
||||
as String?,quantity: freezed == quantity ? _self.quantity : quantity // ignore: cast_nullable_to_non_nullable
|
||||
as int?,numberOfCarcasses: freezed == numberOfCarcasses ? _self.numberOfCarcasses : numberOfCarcasses // ignore: cast_nullable_to_non_nullable
|
||||
as int?,weightOfCarcasses: freezed == weightOfCarcasses ? _self.weightOfCarcasses : weightOfCarcasses // ignore: cast_nullable_to_non_nullable
|
||||
as int?,killHouseVetQuantity: freezed == killHouseVetQuantity ? _self.killHouseVetQuantity : killHouseVetQuantity // ignore: cast_nullable_to_non_nullable
|
||||
as int?,killHouseVetWeight: freezed == killHouseVetWeight ? _self.killHouseVetWeight : killHouseVetWeight // ignore: cast_nullable_to_non_nullable
|
||||
as int?,killHouseVetState: freezed == killHouseVetState ? _self.killHouseVetState : killHouseVetState // ignore: cast_nullable_to_non_nullable
|
||||
as String?,dateOfAcceptReject: freezed == dateOfAcceptReject ? _self.dateOfAcceptReject : dateOfAcceptReject // ignore: cast_nullable_to_non_nullable
|
||||
as String?,acceptorRejector: freezed == acceptorRejector ? _self.acceptorRejector : acceptorRejector // ignore: cast_nullable_to_non_nullable
|
||||
as dynamic,liveWeight: freezed == liveWeight ? _self.liveWeight : liveWeight // ignore: cast_nullable_to_non_nullable
|
||||
as int?,barImage: freezed == barImage ? _self.barImage : barImage // ignore: cast_nullable_to_non_nullable
|
||||
as String?,buyType: freezed == buyType ? _self.buyType : buyType // ignore: cast_nullable_to_non_nullable
|
||||
as String?,wareHouse: freezed == wareHouse ? _self.wareHouse : wareHouse // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,date: freezed == date ? _self.date : date // ignore: cast_nullable_to_non_nullable
|
||||
as String?,wage: freezed == wage ? _self.wage : wage // ignore: cast_nullable_to_non_nullable
|
||||
as int?,totalWageAmount: freezed == totalWageAmount ? _self.totalWageAmount : totalWageAmount // ignore: cast_nullable_to_non_nullable
|
||||
as int?,unionShare: freezed == unionShare ? _self.unionShare : unionShare // ignore: cast_nullable_to_non_nullable
|
||||
as int?,unionSharePercent: freezed == unionSharePercent ? _self.unionSharePercent : unionSharePercent // ignore: cast_nullable_to_non_nullable
|
||||
as int?,companyShare: freezed == companyShare ? _self.companyShare : companyShare // ignore: cast_nullable_to_non_nullable
|
||||
as int?,companySharePercent: freezed == companySharePercent ? _self.companySharePercent : companySharePercent // ignore: cast_nullable_to_non_nullable
|
||||
as int?,guildsShare: freezed == guildsShare ? _self.guildsShare : guildsShare // ignore: cast_nullable_to_non_nullable
|
||||
as int?,guildsSharePercent: freezed == guildsSharePercent ? _self.guildsSharePercent : guildsSharePercent // ignore: cast_nullable_to_non_nullable
|
||||
as int?,cityShare: freezed == cityShare ? _self.cityShare : cityShare // ignore: cast_nullable_to_non_nullable
|
||||
as int?,citySharePercent: freezed == citySharePercent ? _self.citySharePercent : citySharePercent // ignore: cast_nullable_to_non_nullable
|
||||
as int?,walletShare: freezed == walletShare ? _self.walletShare : walletShare // ignore: cast_nullable_to_non_nullable
|
||||
as int?,walletSharePercent: freezed == walletSharePercent ? _self.walletSharePercent : walletSharePercent // ignore: cast_nullable_to_non_nullable
|
||||
as int?,otherShare: freezed == otherShare ? _self.otherShare : otherShare // ignore: cast_nullable_to_non_nullable
|
||||
as int?,otherSharePercent: freezed == otherSharePercent ? _self.otherSharePercent : otherSharePercent // ignore: cast_nullable_to_non_nullable
|
||||
as int?,archiveWage: freezed == archiveWage ? _self.archiveWage : archiveWage // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,weightLoss: freezed == weightLoss ? _self.weightLoss : weightLoss // ignore: cast_nullable_to_non_nullable
|
||||
as int?,calculateStatus: freezed == calculateStatus ? _self.calculateStatus : calculateStatus // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,temporaryTrash: freezed == temporaryTrash ? _self.temporaryTrash : temporaryTrash // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,temporaryDeleted: freezed == temporaryDeleted ? _self.temporaryDeleted : temporaryDeleted // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,enteredMessage: freezed == enteredMessage ? _self.enteredMessage : enteredMessage // ignore: cast_nullable_to_non_nullable
|
||||
as String?,barCode: freezed == barCode ? _self.barCode : barCode // ignore: cast_nullable_to_non_nullable
|
||||
as int?,registerType: freezed == registerType ? _self.registerType : registerType // ignore: cast_nullable_to_non_nullable
|
||||
as String?,createdBy: freezed == createdBy ? _self.createdBy : createdBy // ignore: cast_nullable_to_non_nullable
|
||||
as dynamic,modifiedBy: freezed == modifiedBy ? _self.modifiedBy : modifiedBy // ignore: cast_nullable_to_non_nullable
|
||||
as dynamic,product: freezed == product ? _self.product : product // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [KillHouseFreeBar].
|
||||
extension KillHouseFreeBarPatterns on KillHouseFreeBar {
|
||||
/// 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( _KillHouseFreeBar value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _KillHouseFreeBar() 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( _KillHouseFreeBar value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _KillHouseFreeBar():
|
||||
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( _KillHouseFreeBar value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _KillHouseFreeBar() 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( int? id, dynamic killHouse, dynamic exclusiveKiller, String? key, String? createDate, String? modifyDate, bool? trash, String? poultryName, String? poultryMobile, String? sellerName, String? sellerMobile, String? province, String? city, String? vetFarmName, String? vetFarmMobile, String? driverName, String? driverMobile, String? car, String? clearanceCode, String? barClearanceCode, int? quantity, int? numberOfCarcasses, int? weightOfCarcasses, int? killHouseVetQuantity, int? killHouseVetWeight, String? killHouseVetState, String? dateOfAcceptReject, dynamic acceptorRejector, int? liveWeight, String? barImage, String? buyType, bool? wareHouse, String? date, int? wage, int? totalWageAmount, int? unionShare, int? unionSharePercent, int? companyShare, int? companySharePercent, int? guildsShare, int? guildsSharePercent, int? cityShare, int? citySharePercent, int? walletShare, int? walletSharePercent, int? otherShare, int? otherSharePercent, bool? archiveWage, int? weightLoss, bool? calculateStatus, bool? temporaryTrash, bool? temporaryDeleted, String? enteredMessage, int? barCode, String? registerType, dynamic createdBy, dynamic modifiedBy, int? product)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _KillHouseFreeBar() when $default != null:
|
||||
return $default(_that.id,_that.killHouse,_that.exclusiveKiller,_that.key,_that.createDate,_that.modifyDate,_that.trash,_that.poultryName,_that.poultryMobile,_that.sellerName,_that.sellerMobile,_that.province,_that.city,_that.vetFarmName,_that.vetFarmMobile,_that.driverName,_that.driverMobile,_that.car,_that.clearanceCode,_that.barClearanceCode,_that.quantity,_that.numberOfCarcasses,_that.weightOfCarcasses,_that.killHouseVetQuantity,_that.killHouseVetWeight,_that.killHouseVetState,_that.dateOfAcceptReject,_that.acceptorRejector,_that.liveWeight,_that.barImage,_that.buyType,_that.wareHouse,_that.date,_that.wage,_that.totalWageAmount,_that.unionShare,_that.unionSharePercent,_that.companyShare,_that.companySharePercent,_that.guildsShare,_that.guildsSharePercent,_that.cityShare,_that.citySharePercent,_that.walletShare,_that.walletSharePercent,_that.otherShare,_that.otherSharePercent,_that.archiveWage,_that.weightLoss,_that.calculateStatus,_that.temporaryTrash,_that.temporaryDeleted,_that.enteredMessage,_that.barCode,_that.registerType,_that.createdBy,_that.modifiedBy,_that.product);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( int? id, dynamic killHouse, dynamic exclusiveKiller, String? key, String? createDate, String? modifyDate, bool? trash, String? poultryName, String? poultryMobile, String? sellerName, String? sellerMobile, String? province, String? city, String? vetFarmName, String? vetFarmMobile, String? driverName, String? driverMobile, String? car, String? clearanceCode, String? barClearanceCode, int? quantity, int? numberOfCarcasses, int? weightOfCarcasses, int? killHouseVetQuantity, int? killHouseVetWeight, String? killHouseVetState, String? dateOfAcceptReject, dynamic acceptorRejector, int? liveWeight, String? barImage, String? buyType, bool? wareHouse, String? date, int? wage, int? totalWageAmount, int? unionShare, int? unionSharePercent, int? companyShare, int? companySharePercent, int? guildsShare, int? guildsSharePercent, int? cityShare, int? citySharePercent, int? walletShare, int? walletSharePercent, int? otherShare, int? otherSharePercent, bool? archiveWage, int? weightLoss, bool? calculateStatus, bool? temporaryTrash, bool? temporaryDeleted, String? enteredMessage, int? barCode, String? registerType, dynamic createdBy, dynamic modifiedBy, int? product) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _KillHouseFreeBar():
|
||||
return $default(_that.id,_that.killHouse,_that.exclusiveKiller,_that.key,_that.createDate,_that.modifyDate,_that.trash,_that.poultryName,_that.poultryMobile,_that.sellerName,_that.sellerMobile,_that.province,_that.city,_that.vetFarmName,_that.vetFarmMobile,_that.driverName,_that.driverMobile,_that.car,_that.clearanceCode,_that.barClearanceCode,_that.quantity,_that.numberOfCarcasses,_that.weightOfCarcasses,_that.killHouseVetQuantity,_that.killHouseVetWeight,_that.killHouseVetState,_that.dateOfAcceptReject,_that.acceptorRejector,_that.liveWeight,_that.barImage,_that.buyType,_that.wareHouse,_that.date,_that.wage,_that.totalWageAmount,_that.unionShare,_that.unionSharePercent,_that.companyShare,_that.companySharePercent,_that.guildsShare,_that.guildsSharePercent,_that.cityShare,_that.citySharePercent,_that.walletShare,_that.walletSharePercent,_that.otherShare,_that.otherSharePercent,_that.archiveWage,_that.weightLoss,_that.calculateStatus,_that.temporaryTrash,_that.temporaryDeleted,_that.enteredMessage,_that.barCode,_that.registerType,_that.createdBy,_that.modifiedBy,_that.product);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( int? id, dynamic killHouse, dynamic exclusiveKiller, String? key, String? createDate, String? modifyDate, bool? trash, String? poultryName, String? poultryMobile, String? sellerName, String? sellerMobile, String? province, String? city, String? vetFarmName, String? vetFarmMobile, String? driverName, String? driverMobile, String? car, String? clearanceCode, String? barClearanceCode, int? quantity, int? numberOfCarcasses, int? weightOfCarcasses, int? killHouseVetQuantity, int? killHouseVetWeight, String? killHouseVetState, String? dateOfAcceptReject, dynamic acceptorRejector, int? liveWeight, String? barImage, String? buyType, bool? wareHouse, String? date, int? wage, int? totalWageAmount, int? unionShare, int? unionSharePercent, int? companyShare, int? companySharePercent, int? guildsShare, int? guildsSharePercent, int? cityShare, int? citySharePercent, int? walletShare, int? walletSharePercent, int? otherShare, int? otherSharePercent, bool? archiveWage, int? weightLoss, bool? calculateStatus, bool? temporaryTrash, bool? temporaryDeleted, String? enteredMessage, int? barCode, String? registerType, dynamic createdBy, dynamic modifiedBy, int? product)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _KillHouseFreeBar() when $default != null:
|
||||
return $default(_that.id,_that.killHouse,_that.exclusiveKiller,_that.key,_that.createDate,_that.modifyDate,_that.trash,_that.poultryName,_that.poultryMobile,_that.sellerName,_that.sellerMobile,_that.province,_that.city,_that.vetFarmName,_that.vetFarmMobile,_that.driverName,_that.driverMobile,_that.car,_that.clearanceCode,_that.barClearanceCode,_that.quantity,_that.numberOfCarcasses,_that.weightOfCarcasses,_that.killHouseVetQuantity,_that.killHouseVetWeight,_that.killHouseVetState,_that.dateOfAcceptReject,_that.acceptorRejector,_that.liveWeight,_that.barImage,_that.buyType,_that.wareHouse,_that.date,_that.wage,_that.totalWageAmount,_that.unionShare,_that.unionSharePercent,_that.companyShare,_that.companySharePercent,_that.guildsShare,_that.guildsSharePercent,_that.cityShare,_that.citySharePercent,_that.walletShare,_that.walletSharePercent,_that.otherShare,_that.otherSharePercent,_that.archiveWage,_that.weightLoss,_that.calculateStatus,_that.temporaryTrash,_that.temporaryDeleted,_that.enteredMessage,_that.barCode,_that.registerType,_that.createdBy,_that.modifiedBy,_that.product);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
|
||||
class _KillHouseFreeBar implements KillHouseFreeBar {
|
||||
const _KillHouseFreeBar({this.id, this.killHouse, this.exclusiveKiller, this.key, this.createDate, this.modifyDate, this.trash, this.poultryName, this.poultryMobile, this.sellerName, this.sellerMobile, this.province, this.city, this.vetFarmName, this.vetFarmMobile, this.driverName, this.driverMobile, this.car, this.clearanceCode, this.barClearanceCode, this.quantity, this.numberOfCarcasses, this.weightOfCarcasses, this.killHouseVetQuantity, this.killHouseVetWeight, this.killHouseVetState, this.dateOfAcceptReject, this.acceptorRejector, this.liveWeight, this.barImage, this.buyType, this.wareHouse, this.date, this.wage, this.totalWageAmount, this.unionShare, this.unionSharePercent, this.companyShare, this.companySharePercent, this.guildsShare, this.guildsSharePercent, this.cityShare, this.citySharePercent, this.walletShare, this.walletSharePercent, this.otherShare, this.otherSharePercent, this.archiveWage, this.weightLoss, this.calculateStatus, this.temporaryTrash, this.temporaryDeleted, this.enteredMessage, this.barCode, this.registerType, this.createdBy, this.modifiedBy, this.product});
|
||||
factory _KillHouseFreeBar.fromJson(Map<String, dynamic> json) => _$KillHouseFreeBarFromJson(json);
|
||||
|
||||
@override final int? id;
|
||||
@override final dynamic killHouse;
|
||||
@override final dynamic exclusiveKiller;
|
||||
@override final String? key;
|
||||
@override final String? createDate;
|
||||
@override final String? modifyDate;
|
||||
@override final bool? trash;
|
||||
@override final String? poultryName;
|
||||
@override final String? poultryMobile;
|
||||
@override final String? sellerName;
|
||||
@override final String? sellerMobile;
|
||||
@override final String? province;
|
||||
@override final String? city;
|
||||
@override final String? vetFarmName;
|
||||
@override final String? vetFarmMobile;
|
||||
@override final String? driverName;
|
||||
@override final String? driverMobile;
|
||||
@override final String? car;
|
||||
@override final String? clearanceCode;
|
||||
@override final String? barClearanceCode;
|
||||
@override final int? quantity;
|
||||
@override final int? numberOfCarcasses;
|
||||
@override final int? weightOfCarcasses;
|
||||
@override final int? killHouseVetQuantity;
|
||||
@override final int? killHouseVetWeight;
|
||||
@override final String? killHouseVetState;
|
||||
@override final String? dateOfAcceptReject;
|
||||
@override final dynamic acceptorRejector;
|
||||
@override final int? liveWeight;
|
||||
@override final String? barImage;
|
||||
@override final String? buyType;
|
||||
@override final bool? wareHouse;
|
||||
@override final String? date;
|
||||
@override final int? wage;
|
||||
@override final int? totalWageAmount;
|
||||
@override final int? unionShare;
|
||||
@override final int? unionSharePercent;
|
||||
@override final int? companyShare;
|
||||
@override final int? companySharePercent;
|
||||
@override final int? guildsShare;
|
||||
@override final int? guildsSharePercent;
|
||||
@override final int? cityShare;
|
||||
@override final int? citySharePercent;
|
||||
@override final int? walletShare;
|
||||
@override final int? walletSharePercent;
|
||||
@override final int? otherShare;
|
||||
@override final int? otherSharePercent;
|
||||
@override final bool? archiveWage;
|
||||
@override final int? weightLoss;
|
||||
@override final bool? calculateStatus;
|
||||
@override final bool? temporaryTrash;
|
||||
@override final bool? temporaryDeleted;
|
||||
@override final String? enteredMessage;
|
||||
@override final int? barCode;
|
||||
@override final String? registerType;
|
||||
@override final dynamic createdBy;
|
||||
@override final dynamic modifiedBy;
|
||||
@override final int? product;
|
||||
|
||||
/// Create a copy of KillHouseFreeBar
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$KillHouseFreeBarCopyWith<_KillHouseFreeBar> get copyWith => __$KillHouseFreeBarCopyWithImpl<_KillHouseFreeBar>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$KillHouseFreeBarToJson(this, );
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _KillHouseFreeBar&&(identical(other.id, id) || other.id == id)&&const DeepCollectionEquality().equals(other.killHouse, killHouse)&&const DeepCollectionEquality().equals(other.exclusiveKiller, exclusiveKiller)&&(identical(other.key, key) || other.key == key)&&(identical(other.createDate, createDate) || other.createDate == createDate)&&(identical(other.modifyDate, modifyDate) || other.modifyDate == modifyDate)&&(identical(other.trash, trash) || other.trash == trash)&&(identical(other.poultryName, poultryName) || other.poultryName == poultryName)&&(identical(other.poultryMobile, poultryMobile) || other.poultryMobile == poultryMobile)&&(identical(other.sellerName, sellerName) || other.sellerName == sellerName)&&(identical(other.sellerMobile, sellerMobile) || other.sellerMobile == sellerMobile)&&(identical(other.province, province) || other.province == province)&&(identical(other.city, city) || other.city == city)&&(identical(other.vetFarmName, vetFarmName) || other.vetFarmName == vetFarmName)&&(identical(other.vetFarmMobile, vetFarmMobile) || other.vetFarmMobile == vetFarmMobile)&&(identical(other.driverName, driverName) || other.driverName == driverName)&&(identical(other.driverMobile, driverMobile) || other.driverMobile == driverMobile)&&(identical(other.car, car) || other.car == car)&&(identical(other.clearanceCode, clearanceCode) || other.clearanceCode == clearanceCode)&&(identical(other.barClearanceCode, barClearanceCode) || other.barClearanceCode == barClearanceCode)&&(identical(other.quantity, quantity) || other.quantity == quantity)&&(identical(other.numberOfCarcasses, numberOfCarcasses) || other.numberOfCarcasses == numberOfCarcasses)&&(identical(other.weightOfCarcasses, weightOfCarcasses) || other.weightOfCarcasses == weightOfCarcasses)&&(identical(other.killHouseVetQuantity, killHouseVetQuantity) || other.killHouseVetQuantity == killHouseVetQuantity)&&(identical(other.killHouseVetWeight, killHouseVetWeight) || other.killHouseVetWeight == killHouseVetWeight)&&(identical(other.killHouseVetState, killHouseVetState) || other.killHouseVetState == killHouseVetState)&&(identical(other.dateOfAcceptReject, dateOfAcceptReject) || other.dateOfAcceptReject == dateOfAcceptReject)&&const DeepCollectionEquality().equals(other.acceptorRejector, acceptorRejector)&&(identical(other.liveWeight, liveWeight) || other.liveWeight == liveWeight)&&(identical(other.barImage, barImage) || other.barImage == barImage)&&(identical(other.buyType, buyType) || other.buyType == buyType)&&(identical(other.wareHouse, wareHouse) || other.wareHouse == wareHouse)&&(identical(other.date, date) || other.date == date)&&(identical(other.wage, wage) || other.wage == wage)&&(identical(other.totalWageAmount, totalWageAmount) || other.totalWageAmount == totalWageAmount)&&(identical(other.unionShare, unionShare) || other.unionShare == unionShare)&&(identical(other.unionSharePercent, unionSharePercent) || other.unionSharePercent == unionSharePercent)&&(identical(other.companyShare, companyShare) || other.companyShare == companyShare)&&(identical(other.companySharePercent, companySharePercent) || other.companySharePercent == companySharePercent)&&(identical(other.guildsShare, guildsShare) || other.guildsShare == guildsShare)&&(identical(other.guildsSharePercent, guildsSharePercent) || other.guildsSharePercent == guildsSharePercent)&&(identical(other.cityShare, cityShare) || other.cityShare == cityShare)&&(identical(other.citySharePercent, citySharePercent) || other.citySharePercent == citySharePercent)&&(identical(other.walletShare, walletShare) || other.walletShare == walletShare)&&(identical(other.walletSharePercent, walletSharePercent) || other.walletSharePercent == walletSharePercent)&&(identical(other.otherShare, otherShare) || other.otherShare == otherShare)&&(identical(other.otherSharePercent, otherSharePercent) || other.otherSharePercent == otherSharePercent)&&(identical(other.archiveWage, archiveWage) || other.archiveWage == archiveWage)&&(identical(other.weightLoss, weightLoss) || other.weightLoss == weightLoss)&&(identical(other.calculateStatus, calculateStatus) || other.calculateStatus == calculateStatus)&&(identical(other.temporaryTrash, temporaryTrash) || other.temporaryTrash == temporaryTrash)&&(identical(other.temporaryDeleted, temporaryDeleted) || other.temporaryDeleted == temporaryDeleted)&&(identical(other.enteredMessage, enteredMessage) || other.enteredMessage == enteredMessage)&&(identical(other.barCode, barCode) || other.barCode == barCode)&&(identical(other.registerType, registerType) || other.registerType == registerType)&&const DeepCollectionEquality().equals(other.createdBy, createdBy)&&const DeepCollectionEquality().equals(other.modifiedBy, modifiedBy)&&(identical(other.product, product) || other.product == product));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hashAll([runtimeType,id,const DeepCollectionEquality().hash(killHouse),const DeepCollectionEquality().hash(exclusiveKiller),key,createDate,modifyDate,trash,poultryName,poultryMobile,sellerName,sellerMobile,province,city,vetFarmName,vetFarmMobile,driverName,driverMobile,car,clearanceCode,barClearanceCode,quantity,numberOfCarcasses,weightOfCarcasses,killHouseVetQuantity,killHouseVetWeight,killHouseVetState,dateOfAcceptReject,const DeepCollectionEquality().hash(acceptorRejector),liveWeight,barImage,buyType,wareHouse,date,wage,totalWageAmount,unionShare,unionSharePercent,companyShare,companySharePercent,guildsShare,guildsSharePercent,cityShare,citySharePercent,walletShare,walletSharePercent,otherShare,otherSharePercent,archiveWage,weightLoss,calculateStatus,temporaryTrash,temporaryDeleted,enteredMessage,barCode,registerType,const DeepCollectionEquality().hash(createdBy),const DeepCollectionEquality().hash(modifiedBy),product]);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'KillHouseFreeBar(id: $id, killHouse: $killHouse, exclusiveKiller: $exclusiveKiller, key: $key, createDate: $createDate, modifyDate: $modifyDate, trash: $trash, poultryName: $poultryName, poultryMobile: $poultryMobile, sellerName: $sellerName, sellerMobile: $sellerMobile, province: $province, city: $city, vetFarmName: $vetFarmName, vetFarmMobile: $vetFarmMobile, driverName: $driverName, driverMobile: $driverMobile, car: $car, clearanceCode: $clearanceCode, barClearanceCode: $barClearanceCode, quantity: $quantity, numberOfCarcasses: $numberOfCarcasses, weightOfCarcasses: $weightOfCarcasses, killHouseVetQuantity: $killHouseVetQuantity, killHouseVetWeight: $killHouseVetWeight, killHouseVetState: $killHouseVetState, dateOfAcceptReject: $dateOfAcceptReject, acceptorRejector: $acceptorRejector, liveWeight: $liveWeight, barImage: $barImage, buyType: $buyType, wareHouse: $wareHouse, date: $date, wage: $wage, totalWageAmount: $totalWageAmount, unionShare: $unionShare, unionSharePercent: $unionSharePercent, companyShare: $companyShare, companySharePercent: $companySharePercent, guildsShare: $guildsShare, guildsSharePercent: $guildsSharePercent, cityShare: $cityShare, citySharePercent: $citySharePercent, walletShare: $walletShare, walletSharePercent: $walletSharePercent, otherShare: $otherShare, otherSharePercent: $otherSharePercent, archiveWage: $archiveWage, weightLoss: $weightLoss, calculateStatus: $calculateStatus, temporaryTrash: $temporaryTrash, temporaryDeleted: $temporaryDeleted, enteredMessage: $enteredMessage, barCode: $barCode, registerType: $registerType, createdBy: $createdBy, modifiedBy: $modifiedBy, product: $product)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$KillHouseFreeBarCopyWith<$Res> implements $KillHouseFreeBarCopyWith<$Res> {
|
||||
factory _$KillHouseFreeBarCopyWith(_KillHouseFreeBar value, $Res Function(_KillHouseFreeBar) _then) = __$KillHouseFreeBarCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
int? id, dynamic killHouse, dynamic exclusiveKiller, String? key, String? createDate, String? modifyDate, bool? trash, String? poultryName, String? poultryMobile, String? sellerName, String? sellerMobile, String? province, String? city, String? vetFarmName, String? vetFarmMobile, String? driverName, String? driverMobile, String? car, String? clearanceCode, String? barClearanceCode, int? quantity, int? numberOfCarcasses, int? weightOfCarcasses, int? killHouseVetQuantity, int? killHouseVetWeight, String? killHouseVetState, String? dateOfAcceptReject, dynamic acceptorRejector, int? liveWeight, String? barImage, String? buyType, bool? wareHouse, String? date, int? wage, int? totalWageAmount, int? unionShare, int? unionSharePercent, int? companyShare, int? companySharePercent, int? guildsShare, int? guildsSharePercent, int? cityShare, int? citySharePercent, int? walletShare, int? walletSharePercent, int? otherShare, int? otherSharePercent, bool? archiveWage, int? weightLoss, bool? calculateStatus, bool? temporaryTrash, bool? temporaryDeleted, String? enteredMessage, int? barCode, String? registerType, dynamic createdBy, dynamic modifiedBy, int? product
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$KillHouseFreeBarCopyWithImpl<$Res>
|
||||
implements _$KillHouseFreeBarCopyWith<$Res> {
|
||||
__$KillHouseFreeBarCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _KillHouseFreeBar _self;
|
||||
final $Res Function(_KillHouseFreeBar) _then;
|
||||
|
||||
/// Create a copy of KillHouseFreeBar
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? killHouse = freezed,Object? exclusiveKiller = freezed,Object? key = freezed,Object? createDate = freezed,Object? modifyDate = freezed,Object? trash = freezed,Object? poultryName = freezed,Object? poultryMobile = freezed,Object? sellerName = freezed,Object? sellerMobile = freezed,Object? province = freezed,Object? city = freezed,Object? vetFarmName = freezed,Object? vetFarmMobile = freezed,Object? driverName = freezed,Object? driverMobile = freezed,Object? car = freezed,Object? clearanceCode = freezed,Object? barClearanceCode = freezed,Object? quantity = freezed,Object? numberOfCarcasses = freezed,Object? weightOfCarcasses = freezed,Object? killHouseVetQuantity = freezed,Object? killHouseVetWeight = freezed,Object? killHouseVetState = freezed,Object? dateOfAcceptReject = freezed,Object? acceptorRejector = freezed,Object? liveWeight = freezed,Object? barImage = freezed,Object? buyType = freezed,Object? wareHouse = freezed,Object? date = freezed,Object? wage = freezed,Object? totalWageAmount = freezed,Object? unionShare = freezed,Object? unionSharePercent = freezed,Object? companyShare = freezed,Object? companySharePercent = freezed,Object? guildsShare = freezed,Object? guildsSharePercent = freezed,Object? cityShare = freezed,Object? citySharePercent = freezed,Object? walletShare = freezed,Object? walletSharePercent = freezed,Object? otherShare = freezed,Object? otherSharePercent = freezed,Object? archiveWage = freezed,Object? weightLoss = freezed,Object? calculateStatus = freezed,Object? temporaryTrash = freezed,Object? temporaryDeleted = freezed,Object? enteredMessage = freezed,Object? barCode = freezed,Object? registerType = freezed,Object? createdBy = freezed,Object? modifiedBy = freezed,Object? product = freezed,}) {
|
||||
return _then(_KillHouseFreeBar(
|
||||
id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
|
||||
as int?,killHouse: freezed == killHouse ? _self.killHouse : killHouse // ignore: cast_nullable_to_non_nullable
|
||||
as dynamic,exclusiveKiller: freezed == exclusiveKiller ? _self.exclusiveKiller : exclusiveKiller // ignore: cast_nullable_to_non_nullable
|
||||
as dynamic,key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable
|
||||
as String?,createDate: freezed == createDate ? _self.createDate : createDate // ignore: cast_nullable_to_non_nullable
|
||||
as String?,modifyDate: freezed == modifyDate ? _self.modifyDate : modifyDate // ignore: cast_nullable_to_non_nullable
|
||||
as String?,trash: freezed == trash ? _self.trash : trash // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,poultryName: freezed == poultryName ? _self.poultryName : poultryName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,poultryMobile: freezed == poultryMobile ? _self.poultryMobile : poultryMobile // ignore: cast_nullable_to_non_nullable
|
||||
as String?,sellerName: freezed == sellerName ? _self.sellerName : sellerName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,sellerMobile: freezed == sellerMobile ? _self.sellerMobile : sellerMobile // ignore: cast_nullable_to_non_nullable
|
||||
as String?,province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable
|
||||
as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable
|
||||
as String?,vetFarmName: freezed == vetFarmName ? _self.vetFarmName : vetFarmName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,vetFarmMobile: freezed == vetFarmMobile ? _self.vetFarmMobile : vetFarmMobile // ignore: cast_nullable_to_non_nullable
|
||||
as String?,driverName: freezed == driverName ? _self.driverName : driverName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,driverMobile: freezed == driverMobile ? _self.driverMobile : driverMobile // ignore: cast_nullable_to_non_nullable
|
||||
as String?,car: freezed == car ? _self.car : car // ignore: cast_nullable_to_non_nullable
|
||||
as String?,clearanceCode: freezed == clearanceCode ? _self.clearanceCode : clearanceCode // ignore: cast_nullable_to_non_nullable
|
||||
as String?,barClearanceCode: freezed == barClearanceCode ? _self.barClearanceCode : barClearanceCode // ignore: cast_nullable_to_non_nullable
|
||||
as String?,quantity: freezed == quantity ? _self.quantity : quantity // ignore: cast_nullable_to_non_nullable
|
||||
as int?,numberOfCarcasses: freezed == numberOfCarcasses ? _self.numberOfCarcasses : numberOfCarcasses // ignore: cast_nullable_to_non_nullable
|
||||
as int?,weightOfCarcasses: freezed == weightOfCarcasses ? _self.weightOfCarcasses : weightOfCarcasses // ignore: cast_nullable_to_non_nullable
|
||||
as int?,killHouseVetQuantity: freezed == killHouseVetQuantity ? _self.killHouseVetQuantity : killHouseVetQuantity // ignore: cast_nullable_to_non_nullable
|
||||
as int?,killHouseVetWeight: freezed == killHouseVetWeight ? _self.killHouseVetWeight : killHouseVetWeight // ignore: cast_nullable_to_non_nullable
|
||||
as int?,killHouseVetState: freezed == killHouseVetState ? _self.killHouseVetState : killHouseVetState // ignore: cast_nullable_to_non_nullable
|
||||
as String?,dateOfAcceptReject: freezed == dateOfAcceptReject ? _self.dateOfAcceptReject : dateOfAcceptReject // ignore: cast_nullable_to_non_nullable
|
||||
as String?,acceptorRejector: freezed == acceptorRejector ? _self.acceptorRejector : acceptorRejector // ignore: cast_nullable_to_non_nullable
|
||||
as dynamic,liveWeight: freezed == liveWeight ? _self.liveWeight : liveWeight // ignore: cast_nullable_to_non_nullable
|
||||
as int?,barImage: freezed == barImage ? _self.barImage : barImage // ignore: cast_nullable_to_non_nullable
|
||||
as String?,buyType: freezed == buyType ? _self.buyType : buyType // ignore: cast_nullable_to_non_nullable
|
||||
as String?,wareHouse: freezed == wareHouse ? _self.wareHouse : wareHouse // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,date: freezed == date ? _self.date : date // ignore: cast_nullable_to_non_nullable
|
||||
as String?,wage: freezed == wage ? _self.wage : wage // ignore: cast_nullable_to_non_nullable
|
||||
as int?,totalWageAmount: freezed == totalWageAmount ? _self.totalWageAmount : totalWageAmount // ignore: cast_nullable_to_non_nullable
|
||||
as int?,unionShare: freezed == unionShare ? _self.unionShare : unionShare // ignore: cast_nullable_to_non_nullable
|
||||
as int?,unionSharePercent: freezed == unionSharePercent ? _self.unionSharePercent : unionSharePercent // ignore: cast_nullable_to_non_nullable
|
||||
as int?,companyShare: freezed == companyShare ? _self.companyShare : companyShare // ignore: cast_nullable_to_non_nullable
|
||||
as int?,companySharePercent: freezed == companySharePercent ? _self.companySharePercent : companySharePercent // ignore: cast_nullable_to_non_nullable
|
||||
as int?,guildsShare: freezed == guildsShare ? _self.guildsShare : guildsShare // ignore: cast_nullable_to_non_nullable
|
||||
as int?,guildsSharePercent: freezed == guildsSharePercent ? _self.guildsSharePercent : guildsSharePercent // ignore: cast_nullable_to_non_nullable
|
||||
as int?,cityShare: freezed == cityShare ? _self.cityShare : cityShare // ignore: cast_nullable_to_non_nullable
|
||||
as int?,citySharePercent: freezed == citySharePercent ? _self.citySharePercent : citySharePercent // ignore: cast_nullable_to_non_nullable
|
||||
as int?,walletShare: freezed == walletShare ? _self.walletShare : walletShare // ignore: cast_nullable_to_non_nullable
|
||||
as int?,walletSharePercent: freezed == walletSharePercent ? _self.walletSharePercent : walletSharePercent // ignore: cast_nullable_to_non_nullable
|
||||
as int?,otherShare: freezed == otherShare ? _self.otherShare : otherShare // ignore: cast_nullable_to_non_nullable
|
||||
as int?,otherSharePercent: freezed == otherSharePercent ? _self.otherSharePercent : otherSharePercent // ignore: cast_nullable_to_non_nullable
|
||||
as int?,archiveWage: freezed == archiveWage ? _self.archiveWage : archiveWage // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,weightLoss: freezed == weightLoss ? _self.weightLoss : weightLoss // ignore: cast_nullable_to_non_nullable
|
||||
as int?,calculateStatus: freezed == calculateStatus ? _self.calculateStatus : calculateStatus // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,temporaryTrash: freezed == temporaryTrash ? _self.temporaryTrash : temporaryTrash // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,temporaryDeleted: freezed == temporaryDeleted ? _self.temporaryDeleted : temporaryDeleted // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,enteredMessage: freezed == enteredMessage ? _self.enteredMessage : enteredMessage // ignore: cast_nullable_to_non_nullable
|
||||
as String?,barCode: freezed == barCode ? _self.barCode : barCode // ignore: cast_nullable_to_non_nullable
|
||||
as int?,registerType: freezed == registerType ? _self.registerType : registerType // ignore: cast_nullable_to_non_nullable
|
||||
as String?,createdBy: freezed == createdBy ? _self.createdBy : createdBy // ignore: cast_nullable_to_non_nullable
|
||||
as dynamic,modifiedBy: freezed == modifiedBy ? _self.modifiedBy : modifiedBy // ignore: cast_nullable_to_non_nullable
|
||||
as dynamic,product: freezed == product ? _self.product : product // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// dart format on
|
||||
@@ -0,0 +1,131 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'kill_house_free_bar.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_KillHouseFreeBar _$KillHouseFreeBarFromJson(Map<String, dynamic> json) =>
|
||||
_KillHouseFreeBar(
|
||||
id: (json['id'] as num?)?.toInt(),
|
||||
killHouse: json['kill_house'],
|
||||
exclusiveKiller: json['exclusive_killer'],
|
||||
key: json['key'] as String?,
|
||||
createDate: json['create_date'] as String?,
|
||||
modifyDate: json['modify_date'] as String?,
|
||||
trash: json['trash'] as bool?,
|
||||
poultryName: json['poultry_name'] as String?,
|
||||
poultryMobile: json['poultry_mobile'] as String?,
|
||||
sellerName: json['seller_name'] as String?,
|
||||
sellerMobile: json['seller_mobile'] as String?,
|
||||
province: json['province'] as String?,
|
||||
city: json['city'] as String?,
|
||||
vetFarmName: json['vet_farm_name'] as String?,
|
||||
vetFarmMobile: json['vet_farm_mobile'] as String?,
|
||||
driverName: json['driver_name'] as String?,
|
||||
driverMobile: json['driver_mobile'] as String?,
|
||||
car: json['car'] as String?,
|
||||
clearanceCode: json['clearance_code'] as String?,
|
||||
barClearanceCode: json['bar_clearance_code'] as String?,
|
||||
quantity: (json['quantity'] as num?)?.toInt(),
|
||||
numberOfCarcasses: (json['number_of_carcasses'] as num?)?.toInt(),
|
||||
weightOfCarcasses: (json['weight_of_carcasses'] as num?)?.toInt(),
|
||||
killHouseVetQuantity: (json['kill_house_vet_quantity'] as num?)?.toInt(),
|
||||
killHouseVetWeight: (json['kill_house_vet_weight'] as num?)?.toInt(),
|
||||
killHouseVetState: json['kill_house_vet_state'] as String?,
|
||||
dateOfAcceptReject: json['date_of_accept_reject'] as String?,
|
||||
acceptorRejector: json['acceptor_rejector'],
|
||||
liveWeight: (json['live_weight'] as num?)?.toInt(),
|
||||
barImage: json['bar_image'] as String?,
|
||||
buyType: json['buy_type'] as String?,
|
||||
wareHouse: json['ware_house'] as bool?,
|
||||
date: json['date'] as String?,
|
||||
wage: (json['wage'] as num?)?.toInt(),
|
||||
totalWageAmount: (json['total_wage_amount'] as num?)?.toInt(),
|
||||
unionShare: (json['union_share'] as num?)?.toInt(),
|
||||
unionSharePercent: (json['union_share_percent'] as num?)?.toInt(),
|
||||
companyShare: (json['company_share'] as num?)?.toInt(),
|
||||
companySharePercent: (json['company_share_percent'] as num?)?.toInt(),
|
||||
guildsShare: (json['guilds_share'] as num?)?.toInt(),
|
||||
guildsSharePercent: (json['guilds_share_percent'] as num?)?.toInt(),
|
||||
cityShare: (json['city_share'] as num?)?.toInt(),
|
||||
citySharePercent: (json['city_share_percent'] as num?)?.toInt(),
|
||||
walletShare: (json['wallet_share'] as num?)?.toInt(),
|
||||
walletSharePercent: (json['wallet_share_percent'] as num?)?.toInt(),
|
||||
otherShare: (json['other_share'] as num?)?.toInt(),
|
||||
otherSharePercent: (json['other_share_percent'] as num?)?.toInt(),
|
||||
archiveWage: json['archive_wage'] as bool?,
|
||||
weightLoss: (json['weight_loss'] as num?)?.toInt(),
|
||||
calculateStatus: json['calculate_status'] as bool?,
|
||||
temporaryTrash: json['temporary_trash'] as bool?,
|
||||
temporaryDeleted: json['temporary_deleted'] as bool?,
|
||||
enteredMessage: json['entered_message'] as String?,
|
||||
barCode: (json['bar_code'] as num?)?.toInt(),
|
||||
registerType: json['register_type'] as String?,
|
||||
createdBy: json['created_by'],
|
||||
modifiedBy: json['modified_by'],
|
||||
product: (json['product'] as num?)?.toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$KillHouseFreeBarToJson(_KillHouseFreeBar instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'kill_house': instance.killHouse,
|
||||
'exclusive_killer': instance.exclusiveKiller,
|
||||
'key': instance.key,
|
||||
'create_date': instance.createDate,
|
||||
'modify_date': instance.modifyDate,
|
||||
'trash': instance.trash,
|
||||
'poultry_name': instance.poultryName,
|
||||
'poultry_mobile': instance.poultryMobile,
|
||||
'seller_name': instance.sellerName,
|
||||
'seller_mobile': instance.sellerMobile,
|
||||
'province': instance.province,
|
||||
'city': instance.city,
|
||||
'vet_farm_name': instance.vetFarmName,
|
||||
'vet_farm_mobile': instance.vetFarmMobile,
|
||||
'driver_name': instance.driverName,
|
||||
'driver_mobile': instance.driverMobile,
|
||||
'car': instance.car,
|
||||
'clearance_code': instance.clearanceCode,
|
||||
'bar_clearance_code': instance.barClearanceCode,
|
||||
'quantity': instance.quantity,
|
||||
'number_of_carcasses': instance.numberOfCarcasses,
|
||||
'weight_of_carcasses': instance.weightOfCarcasses,
|
||||
'kill_house_vet_quantity': instance.killHouseVetQuantity,
|
||||
'kill_house_vet_weight': instance.killHouseVetWeight,
|
||||
'kill_house_vet_state': instance.killHouseVetState,
|
||||
'date_of_accept_reject': instance.dateOfAcceptReject,
|
||||
'acceptor_rejector': instance.acceptorRejector,
|
||||
'live_weight': instance.liveWeight,
|
||||
'bar_image': instance.barImage,
|
||||
'buy_type': instance.buyType,
|
||||
'ware_house': instance.wareHouse,
|
||||
'date': instance.date,
|
||||
'wage': instance.wage,
|
||||
'total_wage_amount': instance.totalWageAmount,
|
||||
'union_share': instance.unionShare,
|
||||
'union_share_percent': instance.unionSharePercent,
|
||||
'company_share': instance.companyShare,
|
||||
'company_share_percent': instance.companySharePercent,
|
||||
'guilds_share': instance.guildsShare,
|
||||
'guilds_share_percent': instance.guildsSharePercent,
|
||||
'city_share': instance.cityShare,
|
||||
'city_share_percent': instance.citySharePercent,
|
||||
'wallet_share': instance.walletShare,
|
||||
'wallet_share_percent': instance.walletSharePercent,
|
||||
'other_share': instance.otherShare,
|
||||
'other_share_percent': instance.otherSharePercent,
|
||||
'archive_wage': instance.archiveWage,
|
||||
'weight_loss': instance.weightLoss,
|
||||
'calculate_status': instance.calculateStatus,
|
||||
'temporary_trash': instance.temporaryTrash,
|
||||
'temporary_deleted': instance.temporaryDeleted,
|
||||
'entered_message': instance.enteredMessage,
|
||||
'bar_code': instance.barCode,
|
||||
'register_type': instance.registerType,
|
||||
'created_by': instance.createdBy,
|
||||
'modified_by': instance.modifiedBy,
|
||||
'product': instance.product,
|
||||
};
|
||||
@@ -0,0 +1,60 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'out_province_carcasses_buyer.freezed.dart';
|
||||
part 'out_province_carcasses_buyer.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class OutProvinceCarcassesBuyer with _$OutProvinceCarcassesBuyer {
|
||||
const factory OutProvinceCarcassesBuyer({
|
||||
Buyer? buyer,
|
||||
RequestsInfo? requestsInfo,
|
||||
String? key,
|
||||
bool? trash,
|
||||
String? fullname,
|
||||
String? firstName,
|
||||
String? lastName,
|
||||
String? mobile,
|
||||
String? unitName,
|
||||
String? city,
|
||||
String? province,
|
||||
String? role,
|
||||
bool? active,
|
||||
String? typeActivity,
|
||||
dynamic killHouse,
|
||||
int? steward,
|
||||
}) = _OutProvinceCarcassesBuyer;
|
||||
|
||||
factory OutProvinceCarcassesBuyer.fromJson(Map<String, dynamic> json) =>
|
||||
_$OutProvinceCarcassesBuyerFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class Buyer with _$Buyer {
|
||||
const factory Buyer({
|
||||
String? key,
|
||||
bool? trash,
|
||||
String? fullname,
|
||||
String? firstName,
|
||||
String? lastName,
|
||||
String? mobile,
|
||||
String? unitName,
|
||||
String? city,
|
||||
String? province,
|
||||
bool? active,
|
||||
int? user,
|
||||
}) = _Buyer;
|
||||
|
||||
factory Buyer.fromJson(Map<String, dynamic> json) => _$BuyerFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class RequestsInfo with _$RequestsInfo {
|
||||
const factory RequestsInfo({
|
||||
int? numberOfRequests,
|
||||
int? totalQuantity,
|
||||
double? totalWeight,
|
||||
}) = _RequestsInfo;
|
||||
|
||||
factory RequestsInfo.fromJson(Map<String, dynamic> json) =>
|
||||
_$RequestsInfoFromJson(json);
|
||||
}
|
||||
@@ -0,0 +1,932 @@
|
||||
// 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 'out_province_carcasses_buyer.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
/// @nodoc
|
||||
mixin _$OutProvinceCarcassesBuyer {
|
||||
|
||||
Buyer? get buyer; RequestsInfo? get requestsInfo; String? get key; bool? get trash; String? get fullname; String? get firstName; String? get lastName; String? get mobile; String? get unitName; String? get city; String? get province; String? get role; bool? get active; String? get typeActivity; dynamic get killHouse; int? get steward;
|
||||
/// Create a copy of OutProvinceCarcassesBuyer
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$OutProvinceCarcassesBuyerCopyWith<OutProvinceCarcassesBuyer> get copyWith => _$OutProvinceCarcassesBuyerCopyWithImpl<OutProvinceCarcassesBuyer>(this as OutProvinceCarcassesBuyer, _$identity);
|
||||
|
||||
/// Serializes this OutProvinceCarcassesBuyer to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is OutProvinceCarcassesBuyer&&(identical(other.buyer, buyer) || other.buyer == buyer)&&(identical(other.requestsInfo, requestsInfo) || other.requestsInfo == requestsInfo)&&(identical(other.key, key) || other.key == key)&&(identical(other.trash, trash) || other.trash == trash)&&(identical(other.fullname, fullname) || other.fullname == fullname)&&(identical(other.firstName, firstName) || other.firstName == firstName)&&(identical(other.lastName, lastName) || other.lastName == lastName)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.unitName, unitName) || other.unitName == unitName)&&(identical(other.city, city) || other.city == city)&&(identical(other.province, province) || other.province == province)&&(identical(other.role, role) || other.role == role)&&(identical(other.active, active) || other.active == active)&&(identical(other.typeActivity, typeActivity) || other.typeActivity == typeActivity)&&const DeepCollectionEquality().equals(other.killHouse, killHouse)&&(identical(other.steward, steward) || other.steward == steward));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,buyer,requestsInfo,key,trash,fullname,firstName,lastName,mobile,unitName,city,province,role,active,typeActivity,const DeepCollectionEquality().hash(killHouse),steward);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'OutProvinceCarcassesBuyer(buyer: $buyer, requestsInfo: $requestsInfo, key: $key, trash: $trash, fullname: $fullname, firstName: $firstName, lastName: $lastName, mobile: $mobile, unitName: $unitName, city: $city, province: $province, role: $role, active: $active, typeActivity: $typeActivity, killHouse: $killHouse, steward: $steward)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $OutProvinceCarcassesBuyerCopyWith<$Res> {
|
||||
factory $OutProvinceCarcassesBuyerCopyWith(OutProvinceCarcassesBuyer value, $Res Function(OutProvinceCarcassesBuyer) _then) = _$OutProvinceCarcassesBuyerCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
Buyer? buyer, RequestsInfo? requestsInfo, String? key, bool? trash, String? fullname, String? firstName, String? lastName, String? mobile, String? unitName, String? city, String? province, String? role, bool? active, String? typeActivity, dynamic killHouse, int? steward
|
||||
});
|
||||
|
||||
|
||||
$BuyerCopyWith<$Res>? get buyer;$RequestsInfoCopyWith<$Res>? get requestsInfo;
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$OutProvinceCarcassesBuyerCopyWithImpl<$Res>
|
||||
implements $OutProvinceCarcassesBuyerCopyWith<$Res> {
|
||||
_$OutProvinceCarcassesBuyerCopyWithImpl(this._self, this._then);
|
||||
|
||||
final OutProvinceCarcassesBuyer _self;
|
||||
final $Res Function(OutProvinceCarcassesBuyer) _then;
|
||||
|
||||
/// Create a copy of OutProvinceCarcassesBuyer
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? buyer = freezed,Object? requestsInfo = freezed,Object? key = freezed,Object? trash = freezed,Object? fullname = freezed,Object? firstName = freezed,Object? lastName = freezed,Object? mobile = freezed,Object? unitName = freezed,Object? city = freezed,Object? province = freezed,Object? role = freezed,Object? active = freezed,Object? typeActivity = freezed,Object? killHouse = freezed,Object? steward = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
buyer: freezed == buyer ? _self.buyer : buyer // ignore: cast_nullable_to_non_nullable
|
||||
as Buyer?,requestsInfo: freezed == requestsInfo ? _self.requestsInfo : requestsInfo // ignore: cast_nullable_to_non_nullable
|
||||
as RequestsInfo?,key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable
|
||||
as String?,trash: freezed == trash ? _self.trash : trash // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,fullname: freezed == fullname ? _self.fullname : fullname // ignore: cast_nullable_to_non_nullable
|
||||
as String?,firstName: freezed == firstName ? _self.firstName : firstName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,lastName: freezed == lastName ? _self.lastName : lastName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable
|
||||
as String?,unitName: freezed == unitName ? _self.unitName : unitName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable
|
||||
as String?,province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable
|
||||
as String?,role: freezed == role ? _self.role : role // ignore: cast_nullable_to_non_nullable
|
||||
as String?,active: freezed == active ? _self.active : active // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,typeActivity: freezed == typeActivity ? _self.typeActivity : typeActivity // ignore: cast_nullable_to_non_nullable
|
||||
as String?,killHouse: freezed == killHouse ? _self.killHouse : killHouse // ignore: cast_nullable_to_non_nullable
|
||||
as dynamic,steward: freezed == steward ? _self.steward : steward // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
));
|
||||
}
|
||||
/// Create a copy of OutProvinceCarcassesBuyer
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$BuyerCopyWith<$Res>? get buyer {
|
||||
if (_self.buyer == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $BuyerCopyWith<$Res>(_self.buyer!, (value) {
|
||||
return _then(_self.copyWith(buyer: value));
|
||||
});
|
||||
}/// Create a copy of OutProvinceCarcassesBuyer
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$RequestsInfoCopyWith<$Res>? get requestsInfo {
|
||||
if (_self.requestsInfo == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $RequestsInfoCopyWith<$Res>(_self.requestsInfo!, (value) {
|
||||
return _then(_self.copyWith(requestsInfo: value));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [OutProvinceCarcassesBuyer].
|
||||
extension OutProvinceCarcassesBuyerPatterns on OutProvinceCarcassesBuyer {
|
||||
/// 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( _OutProvinceCarcassesBuyer value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _OutProvinceCarcassesBuyer() 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( _OutProvinceCarcassesBuyer value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _OutProvinceCarcassesBuyer():
|
||||
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( _OutProvinceCarcassesBuyer value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _OutProvinceCarcassesBuyer() 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( Buyer? buyer, RequestsInfo? requestsInfo, String? key, bool? trash, String? fullname, String? firstName, String? lastName, String? mobile, String? unitName, String? city, String? province, String? role, bool? active, String? typeActivity, dynamic killHouse, int? steward)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _OutProvinceCarcassesBuyer() when $default != null:
|
||||
return $default(_that.buyer,_that.requestsInfo,_that.key,_that.trash,_that.fullname,_that.firstName,_that.lastName,_that.mobile,_that.unitName,_that.city,_that.province,_that.role,_that.active,_that.typeActivity,_that.killHouse,_that.steward);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( Buyer? buyer, RequestsInfo? requestsInfo, String? key, bool? trash, String? fullname, String? firstName, String? lastName, String? mobile, String? unitName, String? city, String? province, String? role, bool? active, String? typeActivity, dynamic killHouse, int? steward) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _OutProvinceCarcassesBuyer():
|
||||
return $default(_that.buyer,_that.requestsInfo,_that.key,_that.trash,_that.fullname,_that.firstName,_that.lastName,_that.mobile,_that.unitName,_that.city,_that.province,_that.role,_that.active,_that.typeActivity,_that.killHouse,_that.steward);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( Buyer? buyer, RequestsInfo? requestsInfo, String? key, bool? trash, String? fullname, String? firstName, String? lastName, String? mobile, String? unitName, String? city, String? province, String? role, bool? active, String? typeActivity, dynamic killHouse, int? steward)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _OutProvinceCarcassesBuyer() when $default != null:
|
||||
return $default(_that.buyer,_that.requestsInfo,_that.key,_that.trash,_that.fullname,_that.firstName,_that.lastName,_that.mobile,_that.unitName,_that.city,_that.province,_that.role,_that.active,_that.typeActivity,_that.killHouse,_that.steward);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
|
||||
class _OutProvinceCarcassesBuyer implements OutProvinceCarcassesBuyer {
|
||||
const _OutProvinceCarcassesBuyer({this.buyer, this.requestsInfo, this.key, this.trash, this.fullname, this.firstName, this.lastName, this.mobile, this.unitName, this.city, this.province, this.role, this.active, this.typeActivity, this.killHouse, this.steward});
|
||||
factory _OutProvinceCarcassesBuyer.fromJson(Map<String, dynamic> json) => _$OutProvinceCarcassesBuyerFromJson(json);
|
||||
|
||||
@override final Buyer? buyer;
|
||||
@override final RequestsInfo? requestsInfo;
|
||||
@override final String? key;
|
||||
@override final bool? trash;
|
||||
@override final String? fullname;
|
||||
@override final String? firstName;
|
||||
@override final String? lastName;
|
||||
@override final String? mobile;
|
||||
@override final String? unitName;
|
||||
@override final String? city;
|
||||
@override final String? province;
|
||||
@override final String? role;
|
||||
@override final bool? active;
|
||||
@override final String? typeActivity;
|
||||
@override final dynamic killHouse;
|
||||
@override final int? steward;
|
||||
|
||||
/// Create a copy of OutProvinceCarcassesBuyer
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$OutProvinceCarcassesBuyerCopyWith<_OutProvinceCarcassesBuyer> get copyWith => __$OutProvinceCarcassesBuyerCopyWithImpl<_OutProvinceCarcassesBuyer>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$OutProvinceCarcassesBuyerToJson(this, );
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _OutProvinceCarcassesBuyer&&(identical(other.buyer, buyer) || other.buyer == buyer)&&(identical(other.requestsInfo, requestsInfo) || other.requestsInfo == requestsInfo)&&(identical(other.key, key) || other.key == key)&&(identical(other.trash, trash) || other.trash == trash)&&(identical(other.fullname, fullname) || other.fullname == fullname)&&(identical(other.firstName, firstName) || other.firstName == firstName)&&(identical(other.lastName, lastName) || other.lastName == lastName)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.unitName, unitName) || other.unitName == unitName)&&(identical(other.city, city) || other.city == city)&&(identical(other.province, province) || other.province == province)&&(identical(other.role, role) || other.role == role)&&(identical(other.active, active) || other.active == active)&&(identical(other.typeActivity, typeActivity) || other.typeActivity == typeActivity)&&const DeepCollectionEquality().equals(other.killHouse, killHouse)&&(identical(other.steward, steward) || other.steward == steward));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,buyer,requestsInfo,key,trash,fullname,firstName,lastName,mobile,unitName,city,province,role,active,typeActivity,const DeepCollectionEquality().hash(killHouse),steward);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'OutProvinceCarcassesBuyer(buyer: $buyer, requestsInfo: $requestsInfo, key: $key, trash: $trash, fullname: $fullname, firstName: $firstName, lastName: $lastName, mobile: $mobile, unitName: $unitName, city: $city, province: $province, role: $role, active: $active, typeActivity: $typeActivity, killHouse: $killHouse, steward: $steward)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$OutProvinceCarcassesBuyerCopyWith<$Res> implements $OutProvinceCarcassesBuyerCopyWith<$Res> {
|
||||
factory _$OutProvinceCarcassesBuyerCopyWith(_OutProvinceCarcassesBuyer value, $Res Function(_OutProvinceCarcassesBuyer) _then) = __$OutProvinceCarcassesBuyerCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
Buyer? buyer, RequestsInfo? requestsInfo, String? key, bool? trash, String? fullname, String? firstName, String? lastName, String? mobile, String? unitName, String? city, String? province, String? role, bool? active, String? typeActivity, dynamic killHouse, int? steward
|
||||
});
|
||||
|
||||
|
||||
@override $BuyerCopyWith<$Res>? get buyer;@override $RequestsInfoCopyWith<$Res>? get requestsInfo;
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$OutProvinceCarcassesBuyerCopyWithImpl<$Res>
|
||||
implements _$OutProvinceCarcassesBuyerCopyWith<$Res> {
|
||||
__$OutProvinceCarcassesBuyerCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _OutProvinceCarcassesBuyer _self;
|
||||
final $Res Function(_OutProvinceCarcassesBuyer) _then;
|
||||
|
||||
/// Create a copy of OutProvinceCarcassesBuyer
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? buyer = freezed,Object? requestsInfo = freezed,Object? key = freezed,Object? trash = freezed,Object? fullname = freezed,Object? firstName = freezed,Object? lastName = freezed,Object? mobile = freezed,Object? unitName = freezed,Object? city = freezed,Object? province = freezed,Object? role = freezed,Object? active = freezed,Object? typeActivity = freezed,Object? killHouse = freezed,Object? steward = freezed,}) {
|
||||
return _then(_OutProvinceCarcassesBuyer(
|
||||
buyer: freezed == buyer ? _self.buyer : buyer // ignore: cast_nullable_to_non_nullable
|
||||
as Buyer?,requestsInfo: freezed == requestsInfo ? _self.requestsInfo : requestsInfo // ignore: cast_nullable_to_non_nullable
|
||||
as RequestsInfo?,key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable
|
||||
as String?,trash: freezed == trash ? _self.trash : trash // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,fullname: freezed == fullname ? _self.fullname : fullname // ignore: cast_nullable_to_non_nullable
|
||||
as String?,firstName: freezed == firstName ? _self.firstName : firstName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,lastName: freezed == lastName ? _self.lastName : lastName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable
|
||||
as String?,unitName: freezed == unitName ? _self.unitName : unitName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable
|
||||
as String?,province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable
|
||||
as String?,role: freezed == role ? _self.role : role // ignore: cast_nullable_to_non_nullable
|
||||
as String?,active: freezed == active ? _self.active : active // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,typeActivity: freezed == typeActivity ? _self.typeActivity : typeActivity // ignore: cast_nullable_to_non_nullable
|
||||
as String?,killHouse: freezed == killHouse ? _self.killHouse : killHouse // ignore: cast_nullable_to_non_nullable
|
||||
as dynamic,steward: freezed == steward ? _self.steward : steward // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
));
|
||||
}
|
||||
|
||||
/// Create a copy of OutProvinceCarcassesBuyer
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$BuyerCopyWith<$Res>? get buyer {
|
||||
if (_self.buyer == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $BuyerCopyWith<$Res>(_self.buyer!, (value) {
|
||||
return _then(_self.copyWith(buyer: value));
|
||||
});
|
||||
}/// Create a copy of OutProvinceCarcassesBuyer
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$RequestsInfoCopyWith<$Res>? get requestsInfo {
|
||||
if (_self.requestsInfo == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $RequestsInfoCopyWith<$Res>(_self.requestsInfo!, (value) {
|
||||
return _then(_self.copyWith(requestsInfo: value));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// @nodoc
|
||||
mixin _$Buyer {
|
||||
|
||||
String? get key; bool? get trash; String? get fullname; String? get firstName; String? get lastName; String? get mobile; String? get unitName; String? get city; String? get province; bool? get active; int? get user;
|
||||
/// Create a copy of Buyer
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$BuyerCopyWith<Buyer> get copyWith => _$BuyerCopyWithImpl<Buyer>(this as Buyer, _$identity);
|
||||
|
||||
/// Serializes this Buyer to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is Buyer&&(identical(other.key, key) || other.key == key)&&(identical(other.trash, trash) || other.trash == trash)&&(identical(other.fullname, fullname) || other.fullname == fullname)&&(identical(other.firstName, firstName) || other.firstName == firstName)&&(identical(other.lastName, lastName) || other.lastName == lastName)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.unitName, unitName) || other.unitName == unitName)&&(identical(other.city, city) || other.city == city)&&(identical(other.province, province) || other.province == province)&&(identical(other.active, active) || other.active == active)&&(identical(other.user, user) || other.user == user));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,key,trash,fullname,firstName,lastName,mobile,unitName,city,province,active,user);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'Buyer(key: $key, trash: $trash, fullname: $fullname, firstName: $firstName, lastName: $lastName, mobile: $mobile, unitName: $unitName, city: $city, province: $province, active: $active, user: $user)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $BuyerCopyWith<$Res> {
|
||||
factory $BuyerCopyWith(Buyer value, $Res Function(Buyer) _then) = _$BuyerCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
String? key, bool? trash, String? fullname, String? firstName, String? lastName, String? mobile, String? unitName, String? city, String? province, bool? active, int? user
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$BuyerCopyWithImpl<$Res>
|
||||
implements $BuyerCopyWith<$Res> {
|
||||
_$BuyerCopyWithImpl(this._self, this._then);
|
||||
|
||||
final Buyer _self;
|
||||
final $Res Function(Buyer) _then;
|
||||
|
||||
/// Create a copy of Buyer
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? key = freezed,Object? trash = freezed,Object? fullname = freezed,Object? firstName = freezed,Object? lastName = freezed,Object? mobile = freezed,Object? unitName = freezed,Object? city = freezed,Object? province = freezed,Object? active = freezed,Object? user = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable
|
||||
as String?,trash: freezed == trash ? _self.trash : trash // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,fullname: freezed == fullname ? _self.fullname : fullname // ignore: cast_nullable_to_non_nullable
|
||||
as String?,firstName: freezed == firstName ? _self.firstName : firstName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,lastName: freezed == lastName ? _self.lastName : lastName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable
|
||||
as String?,unitName: freezed == unitName ? _self.unitName : unitName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable
|
||||
as String?,province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable
|
||||
as String?,active: freezed == active ? _self.active : active // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,user: freezed == user ? _self.user : user // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [Buyer].
|
||||
extension BuyerPatterns on Buyer {
|
||||
/// 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( _Buyer value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _Buyer() 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( _Buyer value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _Buyer():
|
||||
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( _Buyer value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _Buyer() 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? key, bool? trash, String? fullname, String? firstName, String? lastName, String? mobile, String? unitName, String? city, String? province, bool? active, int? user)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _Buyer() when $default != null:
|
||||
return $default(_that.key,_that.trash,_that.fullname,_that.firstName,_that.lastName,_that.mobile,_that.unitName,_that.city,_that.province,_that.active,_that.user);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? key, bool? trash, String? fullname, String? firstName, String? lastName, String? mobile, String? unitName, String? city, String? province, bool? active, int? user) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _Buyer():
|
||||
return $default(_that.key,_that.trash,_that.fullname,_that.firstName,_that.lastName,_that.mobile,_that.unitName,_that.city,_that.province,_that.active,_that.user);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? key, bool? trash, String? fullname, String? firstName, String? lastName, String? mobile, String? unitName, String? city, String? province, bool? active, int? user)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _Buyer() when $default != null:
|
||||
return $default(_that.key,_that.trash,_that.fullname,_that.firstName,_that.lastName,_that.mobile,_that.unitName,_that.city,_that.province,_that.active,_that.user);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
|
||||
class _Buyer implements Buyer {
|
||||
const _Buyer({this.key, this.trash, this.fullname, this.firstName, this.lastName, this.mobile, this.unitName, this.city, this.province, this.active, this.user});
|
||||
factory _Buyer.fromJson(Map<String, dynamic> json) => _$BuyerFromJson(json);
|
||||
|
||||
@override final String? key;
|
||||
@override final bool? trash;
|
||||
@override final String? fullname;
|
||||
@override final String? firstName;
|
||||
@override final String? lastName;
|
||||
@override final String? mobile;
|
||||
@override final String? unitName;
|
||||
@override final String? city;
|
||||
@override final String? province;
|
||||
@override final bool? active;
|
||||
@override final int? user;
|
||||
|
||||
/// Create a copy of Buyer
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$BuyerCopyWith<_Buyer> get copyWith => __$BuyerCopyWithImpl<_Buyer>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$BuyerToJson(this, );
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _Buyer&&(identical(other.key, key) || other.key == key)&&(identical(other.trash, trash) || other.trash == trash)&&(identical(other.fullname, fullname) || other.fullname == fullname)&&(identical(other.firstName, firstName) || other.firstName == firstName)&&(identical(other.lastName, lastName) || other.lastName == lastName)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.unitName, unitName) || other.unitName == unitName)&&(identical(other.city, city) || other.city == city)&&(identical(other.province, province) || other.province == province)&&(identical(other.active, active) || other.active == active)&&(identical(other.user, user) || other.user == user));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,key,trash,fullname,firstName,lastName,mobile,unitName,city,province,active,user);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'Buyer(key: $key, trash: $trash, fullname: $fullname, firstName: $firstName, lastName: $lastName, mobile: $mobile, unitName: $unitName, city: $city, province: $province, active: $active, user: $user)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$BuyerCopyWith<$Res> implements $BuyerCopyWith<$Res> {
|
||||
factory _$BuyerCopyWith(_Buyer value, $Res Function(_Buyer) _then) = __$BuyerCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
String? key, bool? trash, String? fullname, String? firstName, String? lastName, String? mobile, String? unitName, String? city, String? province, bool? active, int? user
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$BuyerCopyWithImpl<$Res>
|
||||
implements _$BuyerCopyWith<$Res> {
|
||||
__$BuyerCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _Buyer _self;
|
||||
final $Res Function(_Buyer) _then;
|
||||
|
||||
/// Create a copy of Buyer
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? key = freezed,Object? trash = freezed,Object? fullname = freezed,Object? firstName = freezed,Object? lastName = freezed,Object? mobile = freezed,Object? unitName = freezed,Object? city = freezed,Object? province = freezed,Object? active = freezed,Object? user = freezed,}) {
|
||||
return _then(_Buyer(
|
||||
key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable
|
||||
as String?,trash: freezed == trash ? _self.trash : trash // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,fullname: freezed == fullname ? _self.fullname : fullname // ignore: cast_nullable_to_non_nullable
|
||||
as String?,firstName: freezed == firstName ? _self.firstName : firstName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,lastName: freezed == lastName ? _self.lastName : lastName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable
|
||||
as String?,unitName: freezed == unitName ? _self.unitName : unitName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable
|
||||
as String?,province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable
|
||||
as String?,active: freezed == active ? _self.active : active // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,user: freezed == user ? _self.user : user // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// @nodoc
|
||||
mixin _$RequestsInfo {
|
||||
|
||||
int? get numberOfRequests; int? get totalQuantity; double? get totalWeight;
|
||||
/// Create a copy of RequestsInfo
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$RequestsInfoCopyWith<RequestsInfo> get copyWith => _$RequestsInfoCopyWithImpl<RequestsInfo>(this as RequestsInfo, _$identity);
|
||||
|
||||
/// Serializes this RequestsInfo to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is RequestsInfo&&(identical(other.numberOfRequests, numberOfRequests) || other.numberOfRequests == numberOfRequests)&&(identical(other.totalQuantity, totalQuantity) || other.totalQuantity == totalQuantity)&&(identical(other.totalWeight, totalWeight) || other.totalWeight == totalWeight));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,numberOfRequests,totalQuantity,totalWeight);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'RequestsInfo(numberOfRequests: $numberOfRequests, totalQuantity: $totalQuantity, totalWeight: $totalWeight)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $RequestsInfoCopyWith<$Res> {
|
||||
factory $RequestsInfoCopyWith(RequestsInfo value, $Res Function(RequestsInfo) _then) = _$RequestsInfoCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
int? numberOfRequests, int? totalQuantity, double? totalWeight
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$RequestsInfoCopyWithImpl<$Res>
|
||||
implements $RequestsInfoCopyWith<$Res> {
|
||||
_$RequestsInfoCopyWithImpl(this._self, this._then);
|
||||
|
||||
final RequestsInfo _self;
|
||||
final $Res Function(RequestsInfo) _then;
|
||||
|
||||
/// Create a copy of RequestsInfo
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? numberOfRequests = freezed,Object? totalQuantity = freezed,Object? totalWeight = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
numberOfRequests: freezed == numberOfRequests ? _self.numberOfRequests : numberOfRequests // ignore: cast_nullable_to_non_nullable
|
||||
as int?,totalQuantity: freezed == totalQuantity ? _self.totalQuantity : totalQuantity // ignore: cast_nullable_to_non_nullable
|
||||
as int?,totalWeight: freezed == totalWeight ? _self.totalWeight : totalWeight // ignore: cast_nullable_to_non_nullable
|
||||
as double?,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [RequestsInfo].
|
||||
extension RequestsInfoPatterns on RequestsInfo {
|
||||
/// 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( _RequestsInfo value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _RequestsInfo() 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( _RequestsInfo value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _RequestsInfo():
|
||||
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( _RequestsInfo value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _RequestsInfo() 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( int? numberOfRequests, int? totalQuantity, double? totalWeight)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _RequestsInfo() when $default != null:
|
||||
return $default(_that.numberOfRequests,_that.totalQuantity,_that.totalWeight);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( int? numberOfRequests, int? totalQuantity, double? totalWeight) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _RequestsInfo():
|
||||
return $default(_that.numberOfRequests,_that.totalQuantity,_that.totalWeight);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( int? numberOfRequests, int? totalQuantity, double? totalWeight)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _RequestsInfo() when $default != null:
|
||||
return $default(_that.numberOfRequests,_that.totalQuantity,_that.totalWeight);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
|
||||
class _RequestsInfo implements RequestsInfo {
|
||||
const _RequestsInfo({this.numberOfRequests, this.totalQuantity, this.totalWeight});
|
||||
factory _RequestsInfo.fromJson(Map<String, dynamic> json) => _$RequestsInfoFromJson(json);
|
||||
|
||||
@override final int? numberOfRequests;
|
||||
@override final int? totalQuantity;
|
||||
@override final double? totalWeight;
|
||||
|
||||
/// Create a copy of RequestsInfo
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$RequestsInfoCopyWith<_RequestsInfo> get copyWith => __$RequestsInfoCopyWithImpl<_RequestsInfo>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$RequestsInfoToJson(this, );
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _RequestsInfo&&(identical(other.numberOfRequests, numberOfRequests) || other.numberOfRequests == numberOfRequests)&&(identical(other.totalQuantity, totalQuantity) || other.totalQuantity == totalQuantity)&&(identical(other.totalWeight, totalWeight) || other.totalWeight == totalWeight));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,numberOfRequests,totalQuantity,totalWeight);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'RequestsInfo(numberOfRequests: $numberOfRequests, totalQuantity: $totalQuantity, totalWeight: $totalWeight)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$RequestsInfoCopyWith<$Res> implements $RequestsInfoCopyWith<$Res> {
|
||||
factory _$RequestsInfoCopyWith(_RequestsInfo value, $Res Function(_RequestsInfo) _then) = __$RequestsInfoCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
int? numberOfRequests, int? totalQuantity, double? totalWeight
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$RequestsInfoCopyWithImpl<$Res>
|
||||
implements _$RequestsInfoCopyWith<$Res> {
|
||||
__$RequestsInfoCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _RequestsInfo _self;
|
||||
final $Res Function(_RequestsInfo) _then;
|
||||
|
||||
/// Create a copy of RequestsInfo
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? numberOfRequests = freezed,Object? totalQuantity = freezed,Object? totalWeight = freezed,}) {
|
||||
return _then(_RequestsInfo(
|
||||
numberOfRequests: freezed == numberOfRequests ? _self.numberOfRequests : numberOfRequests // ignore: cast_nullable_to_non_nullable
|
||||
as int?,totalQuantity: freezed == totalQuantity ? _self.totalQuantity : totalQuantity // ignore: cast_nullable_to_non_nullable
|
||||
as int?,totalWeight: freezed == totalWeight ? _self.totalWeight : totalWeight // ignore: cast_nullable_to_non_nullable
|
||||
as double?,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// dart format on
|
||||
@@ -0,0 +1,95 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'out_province_carcasses_buyer.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_OutProvinceCarcassesBuyer _$OutProvinceCarcassesBuyerFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _OutProvinceCarcassesBuyer(
|
||||
buyer: json['buyer'] == null
|
||||
? null
|
||||
: Buyer.fromJson(json['buyer'] as Map<String, dynamic>),
|
||||
requestsInfo: json['requests_info'] == null
|
||||
? null
|
||||
: RequestsInfo.fromJson(json['requests_info'] as Map<String, dynamic>),
|
||||
key: json['key'] as String?,
|
||||
trash: json['trash'] as bool?,
|
||||
fullname: json['fullname'] as String?,
|
||||
firstName: json['first_name'] as String?,
|
||||
lastName: json['last_name'] as String?,
|
||||
mobile: json['mobile'] as String?,
|
||||
unitName: json['unit_name'] as String?,
|
||||
city: json['city'] as String?,
|
||||
province: json['province'] as String?,
|
||||
role: json['role'] as String?,
|
||||
active: json['active'] as bool?,
|
||||
typeActivity: json['type_activity'] as String?,
|
||||
killHouse: json['kill_house'],
|
||||
steward: (json['steward'] as num?)?.toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$OutProvinceCarcassesBuyerToJson(
|
||||
_OutProvinceCarcassesBuyer instance,
|
||||
) => <String, dynamic>{
|
||||
'buyer': instance.buyer,
|
||||
'requests_info': instance.requestsInfo,
|
||||
'key': instance.key,
|
||||
'trash': instance.trash,
|
||||
'fullname': instance.fullname,
|
||||
'first_name': instance.firstName,
|
||||
'last_name': instance.lastName,
|
||||
'mobile': instance.mobile,
|
||||
'unit_name': instance.unitName,
|
||||
'city': instance.city,
|
||||
'province': instance.province,
|
||||
'role': instance.role,
|
||||
'active': instance.active,
|
||||
'type_activity': instance.typeActivity,
|
||||
'kill_house': instance.killHouse,
|
||||
'steward': instance.steward,
|
||||
};
|
||||
|
||||
_Buyer _$BuyerFromJson(Map<String, dynamic> json) => _Buyer(
|
||||
key: json['key'] as String?,
|
||||
trash: json['trash'] as bool?,
|
||||
fullname: json['fullname'] as String?,
|
||||
firstName: json['first_name'] as String?,
|
||||
lastName: json['last_name'] as String?,
|
||||
mobile: json['mobile'] as String?,
|
||||
unitName: json['unit_name'] as String?,
|
||||
city: json['city'] as String?,
|
||||
province: json['province'] as String?,
|
||||
active: json['active'] as bool?,
|
||||
user: (json['user'] as num?)?.toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$BuyerToJson(_Buyer instance) => <String, dynamic>{
|
||||
'key': instance.key,
|
||||
'trash': instance.trash,
|
||||
'fullname': instance.fullname,
|
||||
'first_name': instance.firstName,
|
||||
'last_name': instance.lastName,
|
||||
'mobile': instance.mobile,
|
||||
'unit_name': instance.unitName,
|
||||
'city': instance.city,
|
||||
'province': instance.province,
|
||||
'active': instance.active,
|
||||
'user': instance.user,
|
||||
};
|
||||
|
||||
_RequestsInfo _$RequestsInfoFromJson(Map<String, dynamic> json) =>
|
||||
_RequestsInfo(
|
||||
numberOfRequests: (json['number_of_requests'] as num?)?.toInt(),
|
||||
totalQuantity: (json['total_quantity'] as num?)?.toInt(),
|
||||
totalWeight: (json['total_weight'] as num?)?.toDouble(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$RequestsInfoToJson(_RequestsInfo instance) =>
|
||||
<String, dynamic>{
|
||||
'number_of_requests': instance.numberOfRequests,
|
||||
'total_quantity': instance.totalQuantity,
|
||||
'total_weight': instance.totalWeight,
|
||||
};
|
||||
@@ -0,0 +1,67 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'roles_products.freezed.dart';
|
||||
part 'roles_products.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class RolesProductsModel with _$RolesProductsModel {
|
||||
factory RolesProductsModel({required List<ProductModel> products}) =
|
||||
_RolesProductsModel;
|
||||
|
||||
factory RolesProductsModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$RolesProductsModelFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class ProductModel with _$ProductModel {
|
||||
factory ProductModel({
|
||||
int? id,
|
||||
String? key,
|
||||
String? create_date, // Changed from createDate, removed @JsonKey
|
||||
String? modify_date, // Changed from modifyDate, removed @JsonKey
|
||||
bool? trash,
|
||||
String? name,
|
||||
int? provinceGovernmentalCarcassesQuantity,
|
||||
int? provinceGovernmentalCarcassesWeight,
|
||||
int? provinceFreeCarcassesQuantity,
|
||||
int? provinceFreeCarcassesWeight,
|
||||
int? receiveGovernmentalCarcassesQuantity,
|
||||
int? receiveGovernmentalCarcassesWeight,
|
||||
int? receiveFreeCarcassesQuantity,
|
||||
int? receiveFreeCarcassesWeight,
|
||||
int? freeBuyingCarcassesQuantity,
|
||||
int? freeBuyingCarcassesWeight,
|
||||
int? totalGovernmentalCarcassesQuantity,
|
||||
int? totalGovernmentalCarcassesWeight,
|
||||
int? totalFreeBarsCarcassesQuantity,
|
||||
int? totalFreeBarsCarcassesWeight,
|
||||
double? weightAverage,
|
||||
int? totalCarcassesQuantity,
|
||||
int? totalCarcassesWeight,
|
||||
int? freezingQuantity,
|
||||
int? freezingWeight,
|
||||
int? lossWeight,
|
||||
int? outProvinceAllocatedQuantity,
|
||||
int? outProvinceAllocatedWeight,
|
||||
int? provinceAllocatedQuantity,
|
||||
int? provinceAllocatedWeight,
|
||||
int? realAllocatedQuantity,
|
||||
int? realAllocatedWeight,
|
||||
int? coldHouseAllocatedWeight,
|
||||
int? posAllocatedWeight,
|
||||
int? segmentationWeight,
|
||||
int? totalRemainQuantity,
|
||||
int? totalRemainWeight,
|
||||
int? freePrice,
|
||||
int? approvedPrice,
|
||||
bool? approvedPriceStatus,
|
||||
dynamic createdBy,
|
||||
dynamic modifiedBy,
|
||||
int? parentProduct,
|
||||
dynamic killHouse,
|
||||
int? guild,
|
||||
}) = _ProductModel;
|
||||
|
||||
factory ProductModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$ProductModelFromJson(json);
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,141 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'roles_products.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_RolesProductsModel _$RolesProductsModelFromJson(Map<String, dynamic> json) =>
|
||||
_RolesProductsModel(
|
||||
products: (json['products'] as List<dynamic>)
|
||||
.map((e) => ProductModel.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$RolesProductsModelToJson(_RolesProductsModel instance) =>
|
||||
<String, dynamic>{'products': instance.products};
|
||||
|
||||
_ProductModel _$ProductModelFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _ProductModel(
|
||||
id: (json['id'] as num?)?.toInt(),
|
||||
key: json['key'] as String?,
|
||||
create_date: json['create_date'] as String?,
|
||||
modify_date: json['modify_date'] as String?,
|
||||
trash: json['trash'] as bool?,
|
||||
name: json['name'] as String?,
|
||||
provinceGovernmentalCarcassesQuantity:
|
||||
(json['province_governmental_carcasses_quantity'] as num?)?.toInt(),
|
||||
provinceGovernmentalCarcassesWeight:
|
||||
(json['province_governmental_carcasses_weight'] as num?)?.toInt(),
|
||||
provinceFreeCarcassesQuantity:
|
||||
(json['province_free_carcasses_quantity'] as num?)?.toInt(),
|
||||
provinceFreeCarcassesWeight: (json['province_free_carcasses_weight'] as num?)
|
||||
?.toInt(),
|
||||
receiveGovernmentalCarcassesQuantity:
|
||||
(json['receive_governmental_carcasses_quantity'] as num?)?.toInt(),
|
||||
receiveGovernmentalCarcassesWeight:
|
||||
(json['receive_governmental_carcasses_weight'] as num?)?.toInt(),
|
||||
receiveFreeCarcassesQuantity:
|
||||
(json['receive_free_carcasses_quantity'] as num?)?.toInt(),
|
||||
receiveFreeCarcassesWeight: (json['receive_free_carcasses_weight'] as num?)
|
||||
?.toInt(),
|
||||
freeBuyingCarcassesQuantity: (json['free_buying_carcasses_quantity'] as num?)
|
||||
?.toInt(),
|
||||
freeBuyingCarcassesWeight: (json['free_buying_carcasses_weight'] as num?)
|
||||
?.toInt(),
|
||||
totalGovernmentalCarcassesQuantity:
|
||||
(json['total_governmental_carcasses_quantity'] as num?)?.toInt(),
|
||||
totalGovernmentalCarcassesWeight:
|
||||
(json['total_governmental_carcasses_weight'] as num?)?.toInt(),
|
||||
totalFreeBarsCarcassesQuantity:
|
||||
(json['total_free_bars_carcasses_quantity'] as num?)?.toInt(),
|
||||
totalFreeBarsCarcassesWeight:
|
||||
(json['total_free_bars_carcasses_weight'] as num?)?.toInt(),
|
||||
weightAverage: (json['weight_average'] as num?)?.toDouble(),
|
||||
totalCarcassesQuantity: (json['total_carcasses_quantity'] as num?)?.toInt(),
|
||||
totalCarcassesWeight: (json['total_carcasses_weight'] as num?)?.toInt(),
|
||||
freezingQuantity: (json['freezing_quantity'] as num?)?.toInt(),
|
||||
freezingWeight: (json['freezing_weight'] as num?)?.toInt(),
|
||||
lossWeight: (json['loss_weight'] as num?)?.toInt(),
|
||||
outProvinceAllocatedQuantity:
|
||||
(json['out_province_allocated_quantity'] as num?)?.toInt(),
|
||||
outProvinceAllocatedWeight: (json['out_province_allocated_weight'] as num?)
|
||||
?.toInt(),
|
||||
provinceAllocatedQuantity: (json['province_allocated_quantity'] as num?)
|
||||
?.toInt(),
|
||||
provinceAllocatedWeight: (json['province_allocated_weight'] as num?)?.toInt(),
|
||||
realAllocatedQuantity: (json['real_allocated_quantity'] as num?)?.toInt(),
|
||||
realAllocatedWeight: (json['real_allocated_weight'] as num?)?.toInt(),
|
||||
coldHouseAllocatedWeight: (json['cold_house_allocated_weight'] as num?)
|
||||
?.toInt(),
|
||||
posAllocatedWeight: (json['pos_allocated_weight'] as num?)?.toInt(),
|
||||
segmentationWeight: (json['segmentation_weight'] as num?)?.toInt(),
|
||||
totalRemainQuantity: (json['total_remain_quantity'] as num?)?.toInt(),
|
||||
totalRemainWeight: (json['total_remain_weight'] as num?)?.toInt(),
|
||||
freePrice: (json['free_price'] as num?)?.toInt(),
|
||||
approvedPrice: (json['approved_price'] as num?)?.toInt(),
|
||||
approvedPriceStatus: json['approved_price_status'] as bool?,
|
||||
createdBy: json['created_by'],
|
||||
modifiedBy: json['modified_by'],
|
||||
parentProduct: (json['parent_product'] as num?)?.toInt(),
|
||||
killHouse: json['kill_house'],
|
||||
guild: (json['guild'] as num?)?.toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ProductModelToJson(
|
||||
_ProductModel instance,
|
||||
) => <String, dynamic>{
|
||||
'id': instance.id,
|
||||
'key': instance.key,
|
||||
'create_date': instance.create_date,
|
||||
'modify_date': instance.modify_date,
|
||||
'trash': instance.trash,
|
||||
'name': instance.name,
|
||||
'province_governmental_carcasses_quantity':
|
||||
instance.provinceGovernmentalCarcassesQuantity,
|
||||
'province_governmental_carcasses_weight':
|
||||
instance.provinceGovernmentalCarcassesWeight,
|
||||
'province_free_carcasses_quantity': instance.provinceFreeCarcassesQuantity,
|
||||
'province_free_carcasses_weight': instance.provinceFreeCarcassesWeight,
|
||||
'receive_governmental_carcasses_quantity':
|
||||
instance.receiveGovernmentalCarcassesQuantity,
|
||||
'receive_governmental_carcasses_weight':
|
||||
instance.receiveGovernmentalCarcassesWeight,
|
||||
'receive_free_carcasses_quantity': instance.receiveFreeCarcassesQuantity,
|
||||
'receive_free_carcasses_weight': instance.receiveFreeCarcassesWeight,
|
||||
'free_buying_carcasses_quantity': instance.freeBuyingCarcassesQuantity,
|
||||
'free_buying_carcasses_weight': instance.freeBuyingCarcassesWeight,
|
||||
'total_governmental_carcasses_quantity':
|
||||
instance.totalGovernmentalCarcassesQuantity,
|
||||
'total_governmental_carcasses_weight':
|
||||
instance.totalGovernmentalCarcassesWeight,
|
||||
'total_free_bars_carcasses_quantity': instance.totalFreeBarsCarcassesQuantity,
|
||||
'total_free_bars_carcasses_weight': instance.totalFreeBarsCarcassesWeight,
|
||||
'weight_average': instance.weightAverage,
|
||||
'total_carcasses_quantity': instance.totalCarcassesQuantity,
|
||||
'total_carcasses_weight': instance.totalCarcassesWeight,
|
||||
'freezing_quantity': instance.freezingQuantity,
|
||||
'freezing_weight': instance.freezingWeight,
|
||||
'loss_weight': instance.lossWeight,
|
||||
'out_province_allocated_quantity': instance.outProvinceAllocatedQuantity,
|
||||
'out_province_allocated_weight': instance.outProvinceAllocatedWeight,
|
||||
'province_allocated_quantity': instance.provinceAllocatedQuantity,
|
||||
'province_allocated_weight': instance.provinceAllocatedWeight,
|
||||
'real_allocated_quantity': instance.realAllocatedQuantity,
|
||||
'real_allocated_weight': instance.realAllocatedWeight,
|
||||
'cold_house_allocated_weight': instance.coldHouseAllocatedWeight,
|
||||
'pos_allocated_weight': instance.posAllocatedWeight,
|
||||
'segmentation_weight': instance.segmentationWeight,
|
||||
'total_remain_quantity': instance.totalRemainQuantity,
|
||||
'total_remain_weight': instance.totalRemainWeight,
|
||||
'free_price': instance.freePrice,
|
||||
'approved_price': instance.approvedPrice,
|
||||
'approved_price_status': instance.approvedPriceStatus,
|
||||
'created_by': instance.createdBy,
|
||||
'modified_by': instance.modifiedBy,
|
||||
'parent_product': instance.parentProduct,
|
||||
'kill_house': instance.killHouse,
|
||||
'guild': instance.guild,
|
||||
};
|
||||
@@ -0,0 +1,62 @@
|
||||
// segmentation_model.dart
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'segmentation_model.freezed.dart';
|
||||
part 'segmentation_model.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class SegmentationModel with _$SegmentationModel {
|
||||
const factory SegmentationModel({
|
||||
String? key,
|
||||
String? productKey,
|
||||
String? guildKey,
|
||||
String? result,
|
||||
int? weight,
|
||||
Buyer? buyer,
|
||||
DateTime? date,
|
||||
ToGuild? toGuild,
|
||||
}) = _SegmentationModel;
|
||||
|
||||
factory SegmentationModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$SegmentationModelFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class Buyer with _$Buyer {
|
||||
const factory Buyer({
|
||||
String? fullname,
|
||||
String? mobile,
|
||||
String? shop,
|
||||
}) = _Buyer;
|
||||
|
||||
factory Buyer.fromJson(Map<String, dynamic> json) => _$BuyerFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class ToGuild with _$ToGuild {
|
||||
const factory ToGuild({
|
||||
String? key,
|
||||
String? guildsName,
|
||||
String? typeActivity,
|
||||
String? areaActivity,
|
||||
String? guildsId,
|
||||
bool? steward,
|
||||
User? user,
|
||||
}) = _ToGuild;
|
||||
|
||||
factory ToGuild.fromJson(Map<String, dynamic> json) => _$ToGuildFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class User with _$User {
|
||||
const factory User({
|
||||
String? fullname,
|
||||
String? firstName,
|
||||
String? lastName,
|
||||
String? mobile,
|
||||
String? nationalId,
|
||||
String? city,
|
||||
}) = _User;
|
||||
|
||||
factory User.fromJson(Map<String, dynamic> json) => _$UserFromJson(json);
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,89 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'segmentation_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_SegmentationModel _$SegmentationModelFromJson(Map<String, dynamic> json) =>
|
||||
_SegmentationModel(
|
||||
key: json['key'] as String?,
|
||||
productKey: json['product_key'] as String?,
|
||||
guildKey: json['guild_key'] as String?,
|
||||
result: json['result'] as String?,
|
||||
weight: (json['weight'] as num?)?.toInt(),
|
||||
buyer: json['buyer'] == null
|
||||
? null
|
||||
: Buyer.fromJson(json['buyer'] as Map<String, dynamic>),
|
||||
date: json['date'] == null
|
||||
? null
|
||||
: DateTime.parse(json['date'] as String),
|
||||
toGuild: json['to_guild'] == null
|
||||
? null
|
||||
: ToGuild.fromJson(json['to_guild'] as Map<String, dynamic>),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$SegmentationModelToJson(_SegmentationModel instance) =>
|
||||
<String, dynamic>{
|
||||
'key': instance.key,
|
||||
'product_key': instance.productKey,
|
||||
'guild_key': instance.guildKey,
|
||||
'result': instance.result,
|
||||
'weight': instance.weight,
|
||||
'buyer': instance.buyer,
|
||||
'date': instance.date?.toIso8601String(),
|
||||
'to_guild': instance.toGuild,
|
||||
};
|
||||
|
||||
_Buyer _$BuyerFromJson(Map<String, dynamic> json) => _Buyer(
|
||||
fullname: json['fullname'] as String?,
|
||||
mobile: json['mobile'] as String?,
|
||||
shop: json['shop'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$BuyerToJson(_Buyer instance) => <String, dynamic>{
|
||||
'fullname': instance.fullname,
|
||||
'mobile': instance.mobile,
|
||||
'shop': instance.shop,
|
||||
};
|
||||
|
||||
_ToGuild _$ToGuildFromJson(Map<String, dynamic> json) => _ToGuild(
|
||||
key: json['key'] as String?,
|
||||
guildsName: json['guilds_name'] as String?,
|
||||
typeActivity: json['type_activity'] as String?,
|
||||
areaActivity: json['area_activity'] as String?,
|
||||
guildsId: json['guilds_id'] as String?,
|
||||
steward: json['steward'] as bool?,
|
||||
user: json['user'] == null
|
||||
? null
|
||||
: User.fromJson(json['user'] as Map<String, dynamic>),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ToGuildToJson(_ToGuild instance) => <String, dynamic>{
|
||||
'key': instance.key,
|
||||
'guilds_name': instance.guildsName,
|
||||
'type_activity': instance.typeActivity,
|
||||
'area_activity': instance.areaActivity,
|
||||
'guilds_id': instance.guildsId,
|
||||
'steward': instance.steward,
|
||||
'user': instance.user,
|
||||
};
|
||||
|
||||
_User _$UserFromJson(Map<String, dynamic> json) => _User(
|
||||
fullname: json['fullname'] as String?,
|
||||
firstName: json['first_name'] as String?,
|
||||
lastName: json['last_name'] as String?,
|
||||
mobile: json['mobile'] as String?,
|
||||
nationalId: json['national_id'] as String?,
|
||||
city: json['city'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$UserToJson(_User instance) => <String, dynamic>{
|
||||
'fullname': instance.fullname,
|
||||
'first_name': instance.firstName,
|
||||
'last_name': instance.lastName,
|
||||
'mobile': instance.mobile,
|
||||
'national_id': instance.nationalId,
|
||||
'city': instance.city,
|
||||
};
|
||||
@@ -0,0 +1,140 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'steward_free_bar.freezed.dart';
|
||||
part 'steward_free_bar.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class StewardFreeBar with _$StewardFreeBar {
|
||||
const factory StewardFreeBar({
|
||||
int? id,
|
||||
Steward? steward,
|
||||
dynamic guild,
|
||||
Product? product,
|
||||
String? key,
|
||||
String? createDate,
|
||||
String? modifyDate,
|
||||
bool? trash,
|
||||
String? killHouseName,
|
||||
String? killHouseMobile,
|
||||
String? killHouseVetName,
|
||||
String? killHouseVetMobile,
|
||||
String? province,
|
||||
String? city,
|
||||
String? driverName,
|
||||
String? driverMobile,
|
||||
dynamic car,
|
||||
String? pelak,
|
||||
int? numberOfCarcasses,
|
||||
double? weightOfCarcasses,
|
||||
String? barImage,
|
||||
String? date,
|
||||
bool? temporaryTrash,
|
||||
bool? temporaryDeleted,
|
||||
String? createdBy,
|
||||
String? modifiedBy,
|
||||
}) = _StewardFreeBar;
|
||||
|
||||
factory StewardFreeBar.fromJson(Map<String, dynamic> json) =>
|
||||
_$StewardFreeBarFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class Steward with _$Steward {
|
||||
const factory Steward({
|
||||
User? user,
|
||||
String? guildsName,
|
||||
bool? steward,
|
||||
int? allocationLimit,
|
||||
Address? address,
|
||||
String? licenseNumber,
|
||||
String? typeActivity,
|
||||
String? areaActivity,
|
||||
String? guildsId,
|
||||
String? createDate,
|
||||
}) = _Steward;
|
||||
|
||||
factory Steward.fromJson(Map<String, dynamic> json) => _$StewardFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class User with _$User {
|
||||
const factory User({
|
||||
String? fullname,
|
||||
String? firstName,
|
||||
String? lastName,
|
||||
int? baseOrder,
|
||||
String? mobile,
|
||||
String? nationalId,
|
||||
String? nationalCode,
|
||||
String? key,
|
||||
City? city,
|
||||
String? unitName,
|
||||
String? unitNationalId,
|
||||
String? unitRegistrationNumber,
|
||||
String? unitEconomicalNumber,
|
||||
String? unitProvince,
|
||||
String? unitCity,
|
||||
String? unitPostalCode,
|
||||
String? unitAddress,
|
||||
}) = _User;
|
||||
|
||||
factory User.fromJson(Map<String, dynamic> json) => _$UserFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class City with _$City {
|
||||
const factory City({
|
||||
int? id,
|
||||
String? key,
|
||||
String? createDate,
|
||||
String? modifyDate,
|
||||
bool? trash,
|
||||
int? provinceIdForeignKey,
|
||||
int? cityIdKey,
|
||||
String? name,
|
||||
double? productPrice,
|
||||
bool? provinceCenter,
|
||||
int? cityNumber,
|
||||
String? cityName,
|
||||
int? provinceNumber,
|
||||
String? provinceName,
|
||||
String? createdBy,
|
||||
String? modifiedBy,
|
||||
int? province,
|
||||
}) = _City;
|
||||
|
||||
factory City.fromJson(Map<String, dynamic> json) => _$CityFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class Address with _$Address {
|
||||
const factory Address({
|
||||
Province? province,
|
||||
City? city,
|
||||
String? address,
|
||||
String? postalCode,
|
||||
}) = _Address;
|
||||
|
||||
factory Address.fromJson(Map<String, dynamic> json) => _$AddressFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class Province with _$Province {
|
||||
const factory Province({
|
||||
String? key,
|
||||
String? name,
|
||||
}) = _Province;
|
||||
|
||||
factory Province.fromJson(Map<String, dynamic> json) =>
|
||||
_$ProvinceFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class Product with _$Product {
|
||||
const factory Product({
|
||||
String? key,
|
||||
String? name,
|
||||
}) = _Product;
|
||||
|
||||
factory Product.fromJson(Map<String, dynamic> json) => _$ProductFromJson(json);
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user