diff --git a/android/local.properties b/android/local.properties index 18ea619..8cd06f6 100644 --- a/android/local.properties +++ b/android/local.properties @@ -1,4 +1,4 @@ -sdk.dir=C:/Users/Housh11/AppData/Local/Android/Sdk +sdk.dir=C:\\Users\\Housh11\\AppData\\Local\\Android\\sdk flutter.sdk=C:\\src\\flutter flutter.buildMode=debug flutter.versionName=1.3.33 diff --git a/integration_test/app_test.dart b/integration_test/app_test.dart index 66f821d..283d43f 100644 --- a/integration_test/app_test.dart +++ b/integration_test/app_test.dart @@ -1,7 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:integration_test/integration_test.dart'; -import 'package:get/get.dart'; import 'package:mocktail/mocktail.dart'; import 'package:rasadyar_app/main.dart' as app; import 'package:rasadyar_core/core.dart'; diff --git a/integration_test/modules_integration_test.dart b/integration_test/modules_integration_test.dart index 04ec1ed..e433050 100644 --- a/integration_test/modules_integration_test.dart +++ b/integration_test/modules_integration_test.dart @@ -1,7 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:integration_test/integration_test.dart'; -import 'package:get/get.dart'; import 'package:mocktail/mocktail.dart'; import 'package:rasadyar_app/presentation/pages/modules/view.dart'; import 'package:rasadyar_app/presentation/pages/modules/logic.dart'; diff --git a/lib/presentation/pages/modules/logic.dart b/lib/presentation/pages/modules/logic.dart index 656eb37..2b65c7b 100644 --- a/lib/presentation/pages/modules/logic.dart +++ b/lib/presentation/pages/modules/logic.dart @@ -66,10 +66,6 @@ class ModulesLogic extends GetxController { getSliders(); } - @override - void onClose() { - super.onClose(); - } @override void dispose() { diff --git a/lib/presentation/pages/system_design/system_design.dart b/lib/presentation/pages/system_design/system_design.dart index 3f8f0cf..95d329a 100644 --- a/lib/presentation/pages/system_design/system_design.dart +++ b/lib/presentation/pages/system_design/system_design.dart @@ -10,7 +10,7 @@ class SystemDesignPage extends StatefulWidget { } class _SystemDesignPageState extends State { - List _isOpen = [false, false, false, false, false, false]; + final List _isOpen = [false, false, false, false, false, false]; @override diff --git a/packages/chicken/lib/data/data_source/remote/kill_house/kill_house_remote.dart b/packages/chicken/lib/data/data_source/remote/kill_house/kill_house_remote.dart index e69de29..facd2c9 100644 --- a/packages/chicken/lib/data/data_source/remote/kill_house/kill_house_remote.dart +++ b/packages/chicken/lib/data/data_source/remote/kill_house/kill_house_remote.dart @@ -0,0 +1,25 @@ +import 'package:rasadyar_chicken/data/models/kill_house_module/register_request/response/chicken_commission_prices/chicken_commission_prices.dart'; +import 'package:rasadyar_chicken/data/models/kill_house_module/register_request/response/kill_house/kill_house_response.dart'; +import 'package:rasadyar_chicken/data/models/kill_house_module/register_request/response/kill_request_list/kill_request_list.dart' + as listModel; + +abstract class KillHouseRemoteDataSource { + Future?> getKillHouseList({ + required String token, + Map? queryParameters, + }); + + Future getCommissionPrice({ + required String token, + Map? queryParameters, + }); + + Future submitKillHouseRequest({required String token, required Map data}); + + Future?> getListKillRequest({ + required String token, + Map? queryParameters, + }); + + Future deleteKillRequest({required String token, required int requestId}); +} diff --git a/packages/chicken/lib/data/data_source/remote/kill_house/kill_house_remote_impl.dart b/packages/chicken/lib/data/data_source/remote/kill_house/kill_house_remote_impl.dart index 4a34581..0a7649d 100644 --- a/packages/chicken/lib/data/data_source/remote/kill_house/kill_house_remote_impl.dart +++ b/packages/chicken/lib/data/data_source/remote/kill_house/kill_house_remote_impl.dart @@ -1,20 +1,80 @@ +import 'package:rasadyar_chicken/data/data_source/remote/kill_house/kill_house_remote.dart'; +import 'package:rasadyar_chicken/data/models/kill_house_module/register_request/response/chicken_commission_prices/chicken_commission_prices.dart'; import 'package:rasadyar_chicken/data/models/kill_house_module/register_request/response/kill_house/kill_house_response.dart'; +import 'package:rasadyar_chicken/data/models/kill_house_module/register_request/response/kill_request_list/kill_request_list.dart' + as listModel; +import 'package:rasadyar_core/core.dart'; -abstract class KillHouseRemoteDataSource { - Future> getKillHouseList({ +class KillHouseRemoteDataSourceImpl extends KillHouseRemoteDataSource { + final DioRemote _httpClient; + + KillHouseRemoteDataSourceImpl(this._httpClient); + + @override + Future getCommissionPrice({ required String token, Map? queryParameters, - }); + }) async { + var res = await _httpClient.get( + '/chicken-commission-prices/', + headers: {'Authorization': 'Bearer $token'}, + fromJson: (json) { + var data = json['results'] as List; + return ChickenCommissionPrices.fromJson(data.first as Map); + }, + ); - Future> getCommissionPrice({ + return res.data; + } + + @override + Future?> getKillHouseList({ required String token, Map? queryParameters, - }); + }) async { + var res = await _httpClient.get( + '/kill_house/?kill_house', + headers: {'Authorization': 'Bearer $token'}, + fromJsonList: (json) => + json.map((e) => KillHouseResponse.fromJson(e as Map)).toList(), + ); + return res.data; + } - Future submitKillHouseReport({ + @override + Future submitKillHouseRequest({ required String token, required Map data, - }); + }) async { + await _httpClient.post( + '/kill_request/', + headers: {'Authorization': 'Bearer $token'}, + data: data, + ); + } + @override + Future?> getListKillRequest({ + required String token, + Map? queryParameters, + }) async { + var res = await _httpClient.get( + '/kill_request/', + headers: {'Authorization': 'Bearer $token'}, + queryParameters: queryParameters, + fromJsonList: (json) => + json.map((e) => listModel.KillRequestList.fromJson(e as Map)).toList(), + ); + + return res.data; + } + + @override + Future deleteKillRequest({required String token, required int requestId}) async { + await _httpClient.delete( + '/kill_request/$requestId/', + headers: {'Authorization': 'Bearer $token'}, + ); + } } diff --git a/packages/chicken/lib/data/di/chicken_di.dart b/packages/chicken/lib/data/di/chicken_di.dart index a997cc0..f8e4ad3 100644 --- a/packages/chicken/lib/data/di/chicken_di.dart +++ b/packages/chicken/lib/data/di/chicken_di.dart @@ -6,12 +6,16 @@ import 'package:rasadyar_chicken/data/data_source/remote/auth/auth_remote.dart'; import 'package:rasadyar_chicken/data/data_source/remote/auth/auth_remote_imp.dart'; import 'package:rasadyar_chicken/data/data_source/remote/chicken/chicken_remote.dart'; import 'package:rasadyar_chicken/data/data_source/remote/chicken/chicken_remote_imp.dart'; +import 'package:rasadyar_chicken/data/data_source/remote/kill_house/kill_house_remote.dart'; +import 'package:rasadyar_chicken/data/data_source/remote/kill_house/kill_house_remote_impl.dart'; import 'package:rasadyar_chicken/data/data_source/remote/poultry_science/poultry_science_remote.dart'; import 'package:rasadyar_chicken/data/data_source/remote/poultry_science/poultry_science_remote_imp.dart'; import 'package:rasadyar_chicken/data/repositories/auth/auth_repository.dart'; import 'package:rasadyar_chicken/data/repositories/auth/auth_repository_imp.dart'; import 'package:rasadyar_chicken/data/repositories/chicken/chicken_repository.dart'; import 'package:rasadyar_chicken/data/repositories/chicken/chicken_repository_imp.dart'; +import 'package:rasadyar_chicken/data/repositories/kill_house/kill_house_repository.dart'; +import 'package:rasadyar_chicken/data/repositories/kill_house/kill_house_repository_impl.dart'; import 'package:rasadyar_chicken/data/repositories/poultry_science/poultry_science_repository.dart'; import 'package:rasadyar_chicken/data/repositories/poultry_science/poultry_science_repository_imp.dart'; import 'package:rasadyar_core/core.dart'; @@ -80,6 +84,15 @@ Future setupChickenDI() async { diChicken.registerLazySingleton( () => PoultryScienceRepositoryImp(diChicken.get()), ); + + //region kill house module DI + diChicken.registerLazySingleton( + () => KillHouseRemoteDataSourceImpl(diChicken.get()), + ); + diChicken.registerLazySingleton( + () => KillHouseRepositoryImpl(diChicken.get()), + ); + //endregion } Future newSetupAuthDI(String newUrl) async { diff --git a/packages/chicken/lib/data/models/kill_house_module/register_request/request/kill_request_response.dart b/packages/chicken/lib/data/models/kill_house_module/register_request/request/kill_request_response.dart index e69de29..817a2f2 100644 --- a/packages/chicken/lib/data/models/kill_house_module/register_request/request/kill_request_response.dart +++ b/packages/chicken/lib/data/models/kill_house_module/register_request/request/kill_request_response.dart @@ -0,0 +1,26 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'kill_request_response.freezed.dart'; +part 'kill_request_response.g.dart'; + +@freezed +abstract class KillRequestResponse with _$KillRequestResponse { + const factory KillRequestResponse({ + int? killCapacity, + String? reciveTime, + String? reciveDate, + bool? lowWeight, + bool? highWeight, + @JsonKey(name: "Index_weight") double? indexWeight, + String? chickenBreed, + bool? cash, + bool? credit, + bool? smsPayment, + String? killHouseKey, + String? killerKillHouseKey, + String? role, + }) = _KillRequestResponse; + + factory KillRequestResponse.fromJson(Map json) => + _$KillRequestResponseFromJson(json); +} diff --git a/packages/chicken/lib/data/models/kill_house_module/register_request/request/kill_request_response.freezed.dart b/packages/chicken/lib/data/models/kill_house_module/register_request/request/kill_request_response.freezed.dart new file mode 100644 index 0000000..7775441 --- /dev/null +++ b/packages/chicken/lib/data/models/kill_house_module/register_request/request/kill_request_response.freezed.dart @@ -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 'kill_request_response.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +// dart format off +T _$identity(T value) => value; + +/// @nodoc +mixin _$KillRequestResponse { + + int? get killCapacity; String? get reciveTime; String? get reciveDate; bool? get lowWeight; bool? get highWeight;@JsonKey(name: "Index_weight") double? get indexWeight; String? get chickenBreed; bool? get cash; bool? get credit; bool? get smsPayment; String? get killHouseKey; String? get killerKillHouseKey; String? get role; +/// Create a copy of KillRequestResponse +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$KillRequestResponseCopyWith get copyWith => _$KillRequestResponseCopyWithImpl(this as KillRequestResponse, _$identity); + + /// Serializes this KillRequestResponse to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is KillRequestResponse&&(identical(other.killCapacity, killCapacity) || other.killCapacity == killCapacity)&&(identical(other.reciveTime, reciveTime) || other.reciveTime == reciveTime)&&(identical(other.reciveDate, reciveDate) || other.reciveDate == reciveDate)&&(identical(other.lowWeight, lowWeight) || other.lowWeight == lowWeight)&&(identical(other.highWeight, highWeight) || other.highWeight == highWeight)&&(identical(other.indexWeight, indexWeight) || other.indexWeight == indexWeight)&&(identical(other.chickenBreed, chickenBreed) || other.chickenBreed == chickenBreed)&&(identical(other.cash, cash) || other.cash == cash)&&(identical(other.credit, credit) || other.credit == credit)&&(identical(other.smsPayment, smsPayment) || other.smsPayment == smsPayment)&&(identical(other.killHouseKey, killHouseKey) || other.killHouseKey == killHouseKey)&&(identical(other.killerKillHouseKey, killerKillHouseKey) || other.killerKillHouseKey == killerKillHouseKey)&&(identical(other.role, role) || other.role == role)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,killCapacity,reciveTime,reciveDate,lowWeight,highWeight,indexWeight,chickenBreed,cash,credit,smsPayment,killHouseKey,killerKillHouseKey,role); + +@override +String toString() { + return 'KillRequestResponse(killCapacity: $killCapacity, reciveTime: $reciveTime, reciveDate: $reciveDate, lowWeight: $lowWeight, highWeight: $highWeight, indexWeight: $indexWeight, chickenBreed: $chickenBreed, cash: $cash, credit: $credit, smsPayment: $smsPayment, killHouseKey: $killHouseKey, killerKillHouseKey: $killerKillHouseKey, role: $role)'; +} + + +} + +/// @nodoc +abstract mixin class $KillRequestResponseCopyWith<$Res> { + factory $KillRequestResponseCopyWith(KillRequestResponse value, $Res Function(KillRequestResponse) _then) = _$KillRequestResponseCopyWithImpl; +@useResult +$Res call({ + int? killCapacity, String? reciveTime, String? reciveDate, bool? lowWeight, bool? highWeight,@JsonKey(name: "Index_weight") double? indexWeight, String? chickenBreed, bool? cash, bool? credit, bool? smsPayment, String? killHouseKey, String? killerKillHouseKey, String? role +}); + + + + +} +/// @nodoc +class _$KillRequestResponseCopyWithImpl<$Res> + implements $KillRequestResponseCopyWith<$Res> { + _$KillRequestResponseCopyWithImpl(this._self, this._then); + + final KillRequestResponse _self; + final $Res Function(KillRequestResponse) _then; + +/// Create a copy of KillRequestResponse +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? killCapacity = freezed,Object? reciveTime = freezed,Object? reciveDate = freezed,Object? lowWeight = freezed,Object? highWeight = freezed,Object? indexWeight = freezed,Object? chickenBreed = freezed,Object? cash = freezed,Object? credit = freezed,Object? smsPayment = freezed,Object? killHouseKey = freezed,Object? killerKillHouseKey = freezed,Object? role = freezed,}) { + return _then(_self.copyWith( +killCapacity: freezed == killCapacity ? _self.killCapacity : killCapacity // ignore: cast_nullable_to_non_nullable +as int?,reciveTime: freezed == reciveTime ? _self.reciveTime : reciveTime // ignore: cast_nullable_to_non_nullable +as String?,reciveDate: freezed == reciveDate ? _self.reciveDate : reciveDate // ignore: cast_nullable_to_non_nullable +as String?,lowWeight: freezed == lowWeight ? _self.lowWeight : lowWeight // ignore: cast_nullable_to_non_nullable +as bool?,highWeight: freezed == highWeight ? _self.highWeight : highWeight // ignore: cast_nullable_to_non_nullable +as bool?,indexWeight: freezed == indexWeight ? _self.indexWeight : indexWeight // ignore: cast_nullable_to_non_nullable +as double?,chickenBreed: freezed == chickenBreed ? _self.chickenBreed : chickenBreed // ignore: cast_nullable_to_non_nullable +as String?,cash: freezed == cash ? _self.cash : cash // ignore: cast_nullable_to_non_nullable +as bool?,credit: freezed == credit ? _self.credit : credit // ignore: cast_nullable_to_non_nullable +as bool?,smsPayment: freezed == smsPayment ? _self.smsPayment : smsPayment // ignore: cast_nullable_to_non_nullable +as bool?,killHouseKey: freezed == killHouseKey ? _self.killHouseKey : killHouseKey // ignore: cast_nullable_to_non_nullable +as String?,killerKillHouseKey: freezed == killerKillHouseKey ? _self.killerKillHouseKey : killerKillHouseKey // ignore: cast_nullable_to_non_nullable +as String?,role: freezed == role ? _self.role : role // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [KillRequestResponse]. +extension KillRequestResponsePatterns on KillRequestResponse { +/// 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 Function( _KillRequestResponse value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _KillRequestResponse() 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 Function( _KillRequestResponse value) $default,){ +final _that = this; +switch (_that) { +case _KillRequestResponse(): +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? Function( _KillRequestResponse value)? $default,){ +final _that = this; +switch (_that) { +case _KillRequestResponse() 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 Function( int? killCapacity, String? reciveTime, String? reciveDate, bool? lowWeight, bool? highWeight, @JsonKey(name: "Index_weight") double? indexWeight, String? chickenBreed, bool? cash, bool? credit, bool? smsPayment, String? killHouseKey, String? killerKillHouseKey, String? role)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _KillRequestResponse() when $default != null: +return $default(_that.killCapacity,_that.reciveTime,_that.reciveDate,_that.lowWeight,_that.highWeight,_that.indexWeight,_that.chickenBreed,_that.cash,_that.credit,_that.smsPayment,_that.killHouseKey,_that.killerKillHouseKey,_that.role);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 Function( int? killCapacity, String? reciveTime, String? reciveDate, bool? lowWeight, bool? highWeight, @JsonKey(name: "Index_weight") double? indexWeight, String? chickenBreed, bool? cash, bool? credit, bool? smsPayment, String? killHouseKey, String? killerKillHouseKey, String? role) $default,) {final _that = this; +switch (_that) { +case _KillRequestResponse(): +return $default(_that.killCapacity,_that.reciveTime,_that.reciveDate,_that.lowWeight,_that.highWeight,_that.indexWeight,_that.chickenBreed,_that.cash,_that.credit,_that.smsPayment,_that.killHouseKey,_that.killerKillHouseKey,_that.role);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? Function( int? killCapacity, String? reciveTime, String? reciveDate, bool? lowWeight, bool? highWeight, @JsonKey(name: "Index_weight") double? indexWeight, String? chickenBreed, bool? cash, bool? credit, bool? smsPayment, String? killHouseKey, String? killerKillHouseKey, String? role)? $default,) {final _that = this; +switch (_that) { +case _KillRequestResponse() when $default != null: +return $default(_that.killCapacity,_that.reciveTime,_that.reciveDate,_that.lowWeight,_that.highWeight,_that.indexWeight,_that.chickenBreed,_that.cash,_that.credit,_that.smsPayment,_that.killHouseKey,_that.killerKillHouseKey,_that.role);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _KillRequestResponse implements KillRequestResponse { + const _KillRequestResponse({this.killCapacity, this.reciveTime, this.reciveDate, this.lowWeight, this.highWeight, @JsonKey(name: "Index_weight") this.indexWeight, this.chickenBreed, this.cash, this.credit, this.smsPayment, this.killHouseKey, this.killerKillHouseKey, this.role}); + factory _KillRequestResponse.fromJson(Map json) => _$KillRequestResponseFromJson(json); + +@override final int? killCapacity; +@override final String? reciveTime; +@override final String? reciveDate; +@override final bool? lowWeight; +@override final bool? highWeight; +@override@JsonKey(name: "Index_weight") final double? indexWeight; +@override final String? chickenBreed; +@override final bool? cash; +@override final bool? credit; +@override final bool? smsPayment; +@override final String? killHouseKey; +@override final String? killerKillHouseKey; +@override final String? role; + +/// Create a copy of KillRequestResponse +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$KillRequestResponseCopyWith<_KillRequestResponse> get copyWith => __$KillRequestResponseCopyWithImpl<_KillRequestResponse>(this, _$identity); + +@override +Map toJson() { + return _$KillRequestResponseToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _KillRequestResponse&&(identical(other.killCapacity, killCapacity) || other.killCapacity == killCapacity)&&(identical(other.reciveTime, reciveTime) || other.reciveTime == reciveTime)&&(identical(other.reciveDate, reciveDate) || other.reciveDate == reciveDate)&&(identical(other.lowWeight, lowWeight) || other.lowWeight == lowWeight)&&(identical(other.highWeight, highWeight) || other.highWeight == highWeight)&&(identical(other.indexWeight, indexWeight) || other.indexWeight == indexWeight)&&(identical(other.chickenBreed, chickenBreed) || other.chickenBreed == chickenBreed)&&(identical(other.cash, cash) || other.cash == cash)&&(identical(other.credit, credit) || other.credit == credit)&&(identical(other.smsPayment, smsPayment) || other.smsPayment == smsPayment)&&(identical(other.killHouseKey, killHouseKey) || other.killHouseKey == killHouseKey)&&(identical(other.killerKillHouseKey, killerKillHouseKey) || other.killerKillHouseKey == killerKillHouseKey)&&(identical(other.role, role) || other.role == role)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,killCapacity,reciveTime,reciveDate,lowWeight,highWeight,indexWeight,chickenBreed,cash,credit,smsPayment,killHouseKey,killerKillHouseKey,role); + +@override +String toString() { + return 'KillRequestResponse(killCapacity: $killCapacity, reciveTime: $reciveTime, reciveDate: $reciveDate, lowWeight: $lowWeight, highWeight: $highWeight, indexWeight: $indexWeight, chickenBreed: $chickenBreed, cash: $cash, credit: $credit, smsPayment: $smsPayment, killHouseKey: $killHouseKey, killerKillHouseKey: $killerKillHouseKey, role: $role)'; +} + + +} + +/// @nodoc +abstract mixin class _$KillRequestResponseCopyWith<$Res> implements $KillRequestResponseCopyWith<$Res> { + factory _$KillRequestResponseCopyWith(_KillRequestResponse value, $Res Function(_KillRequestResponse) _then) = __$KillRequestResponseCopyWithImpl; +@override @useResult +$Res call({ + int? killCapacity, String? reciveTime, String? reciveDate, bool? lowWeight, bool? highWeight,@JsonKey(name: "Index_weight") double? indexWeight, String? chickenBreed, bool? cash, bool? credit, bool? smsPayment, String? killHouseKey, String? killerKillHouseKey, String? role +}); + + + + +} +/// @nodoc +class __$KillRequestResponseCopyWithImpl<$Res> + implements _$KillRequestResponseCopyWith<$Res> { + __$KillRequestResponseCopyWithImpl(this._self, this._then); + + final _KillRequestResponse _self; + final $Res Function(_KillRequestResponse) _then; + +/// Create a copy of KillRequestResponse +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? killCapacity = freezed,Object? reciveTime = freezed,Object? reciveDate = freezed,Object? lowWeight = freezed,Object? highWeight = freezed,Object? indexWeight = freezed,Object? chickenBreed = freezed,Object? cash = freezed,Object? credit = freezed,Object? smsPayment = freezed,Object? killHouseKey = freezed,Object? killerKillHouseKey = freezed,Object? role = freezed,}) { + return _then(_KillRequestResponse( +killCapacity: freezed == killCapacity ? _self.killCapacity : killCapacity // ignore: cast_nullable_to_non_nullable +as int?,reciveTime: freezed == reciveTime ? _self.reciveTime : reciveTime // ignore: cast_nullable_to_non_nullable +as String?,reciveDate: freezed == reciveDate ? _self.reciveDate : reciveDate // ignore: cast_nullable_to_non_nullable +as String?,lowWeight: freezed == lowWeight ? _self.lowWeight : lowWeight // ignore: cast_nullable_to_non_nullable +as bool?,highWeight: freezed == highWeight ? _self.highWeight : highWeight // ignore: cast_nullable_to_non_nullable +as bool?,indexWeight: freezed == indexWeight ? _self.indexWeight : indexWeight // ignore: cast_nullable_to_non_nullable +as double?,chickenBreed: freezed == chickenBreed ? _self.chickenBreed : chickenBreed // ignore: cast_nullable_to_non_nullable +as String?,cash: freezed == cash ? _self.cash : cash // ignore: cast_nullable_to_non_nullable +as bool?,credit: freezed == credit ? _self.credit : credit // ignore: cast_nullable_to_non_nullable +as bool?,smsPayment: freezed == smsPayment ? _self.smsPayment : smsPayment // ignore: cast_nullable_to_non_nullable +as bool?,killHouseKey: freezed == killHouseKey ? _self.killHouseKey : killHouseKey // ignore: cast_nullable_to_non_nullable +as String?,killerKillHouseKey: freezed == killerKillHouseKey ? _self.killerKillHouseKey : killerKillHouseKey // ignore: cast_nullable_to_non_nullable +as String?,role: freezed == role ? _self.role : role // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + +// dart format on diff --git a/packages/chicken/lib/data/models/kill_house_module/register_request/request/kill_request_response.g.dart b/packages/chicken/lib/data/models/kill_house_module/register_request/request/kill_request_response.g.dart new file mode 100644 index 0000000..f76535c --- /dev/null +++ b/packages/chicken/lib/data/models/kill_house_module/register_request/request/kill_request_response.g.dart @@ -0,0 +1,42 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'kill_request_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_KillRequestResponse _$KillRequestResponseFromJson(Map json) => + _KillRequestResponse( + killCapacity: (json['kill_capacity'] as num?)?.toInt(), + reciveTime: json['recive_time'] as String?, + reciveDate: json['recive_date'] as String?, + lowWeight: json['low_weight'] as bool?, + highWeight: json['high_weight'] as bool?, + indexWeight: (json['Index_weight'] as num?)?.toDouble(), + chickenBreed: json['chicken_breed'] as String?, + cash: json['cash'] as bool?, + credit: json['credit'] as bool?, + smsPayment: json['sms_payment'] as bool?, + killHouseKey: json['kill_house_key'] as String?, + killerKillHouseKey: json['killer_kill_house_key'] as String?, + role: json['role'] as String?, + ); + +Map _$KillRequestResponseToJson( + _KillRequestResponse instance, +) => { + 'kill_capacity': instance.killCapacity, + 'recive_time': instance.reciveTime, + 'recive_date': instance.reciveDate, + 'low_weight': instance.lowWeight, + 'high_weight': instance.highWeight, + 'Index_weight': instance.indexWeight, + 'chicken_breed': instance.chickenBreed, + 'cash': instance.cash, + 'credit': instance.credit, + 'sms_payment': instance.smsPayment, + 'kill_house_key': instance.killHouseKey, + 'killer_kill_house_key': instance.killerKillHouseKey, + 'role': instance.role, +}; diff --git a/packages/chicken/lib/data/models/kill_house_module/register_request/response/chicken_commission_prices/chicken_commission_prices.dart b/packages/chicken/lib/data/models/kill_house_module/register_request/response/chicken_commission_prices/chicken_commission_prices.dart index e69de29..61257ef 100644 --- a/packages/chicken/lib/data/models/kill_house_module/register_request/response/chicken_commission_prices/chicken_commission_prices.dart +++ b/packages/chicken/lib/data/models/kill_house_module/register_request/response/chicken_commission_prices/chicken_commission_prices.dart @@ -0,0 +1,12 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'chicken_commission_prices.freezed.dart'; +part 'chicken_commission_prices.g.dart'; + +@freezed +abstract class ChickenCommissionPrices with _$ChickenCommissionPrices { + const factory ChickenCommissionPrices({double? chickenAveragePrice}) = _ChickenCommissionPrices; + + factory ChickenCommissionPrices.fromJson(Map json) => + _$ChickenCommissionPricesFromJson(json); +} diff --git a/packages/chicken/lib/data/models/kill_house_module/register_request/response/chicken_commission_prices/chicken_commission_prices.freezed.dart b/packages/chicken/lib/data/models/kill_house_module/register_request/response/chicken_commission_prices/chicken_commission_prices.freezed.dart new file mode 100644 index 0000000..b379604 --- /dev/null +++ b/packages/chicken/lib/data/models/kill_house_module/register_request/response/chicken_commission_prices/chicken_commission_prices.freezed.dart @@ -0,0 +1,277 @@ +// 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 'chicken_commission_prices.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +// dart format off +T _$identity(T value) => value; + +/// @nodoc +mixin _$ChickenCommissionPrices { + + double? get chickenAveragePrice; +/// Create a copy of ChickenCommissionPrices +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$ChickenCommissionPricesCopyWith get copyWith => _$ChickenCommissionPricesCopyWithImpl(this as ChickenCommissionPrices, _$identity); + + /// Serializes this ChickenCommissionPrices to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is ChickenCommissionPrices&&(identical(other.chickenAveragePrice, chickenAveragePrice) || other.chickenAveragePrice == chickenAveragePrice)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,chickenAveragePrice); + +@override +String toString() { + return 'ChickenCommissionPrices(chickenAveragePrice: $chickenAveragePrice)'; +} + + +} + +/// @nodoc +abstract mixin class $ChickenCommissionPricesCopyWith<$Res> { + factory $ChickenCommissionPricesCopyWith(ChickenCommissionPrices value, $Res Function(ChickenCommissionPrices) _then) = _$ChickenCommissionPricesCopyWithImpl; +@useResult +$Res call({ + double? chickenAveragePrice +}); + + + + +} +/// @nodoc +class _$ChickenCommissionPricesCopyWithImpl<$Res> + implements $ChickenCommissionPricesCopyWith<$Res> { + _$ChickenCommissionPricesCopyWithImpl(this._self, this._then); + + final ChickenCommissionPrices _self; + final $Res Function(ChickenCommissionPrices) _then; + +/// Create a copy of ChickenCommissionPrices +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? chickenAveragePrice = freezed,}) { + return _then(_self.copyWith( +chickenAveragePrice: freezed == chickenAveragePrice ? _self.chickenAveragePrice : chickenAveragePrice // ignore: cast_nullable_to_non_nullable +as double?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [ChickenCommissionPrices]. +extension ChickenCommissionPricesPatterns on ChickenCommissionPrices { +/// 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 Function( _ChickenCommissionPrices value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _ChickenCommissionPrices() 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 Function( _ChickenCommissionPrices value) $default,){ +final _that = this; +switch (_that) { +case _ChickenCommissionPrices(): +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? Function( _ChickenCommissionPrices value)? $default,){ +final _that = this; +switch (_that) { +case _ChickenCommissionPrices() 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 Function( double? chickenAveragePrice)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _ChickenCommissionPrices() when $default != null: +return $default(_that.chickenAveragePrice);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 Function( double? chickenAveragePrice) $default,) {final _that = this; +switch (_that) { +case _ChickenCommissionPrices(): +return $default(_that.chickenAveragePrice);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? Function( double? chickenAveragePrice)? $default,) {final _that = this; +switch (_that) { +case _ChickenCommissionPrices() when $default != null: +return $default(_that.chickenAveragePrice);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _ChickenCommissionPrices implements ChickenCommissionPrices { + const _ChickenCommissionPrices({this.chickenAveragePrice}); + factory _ChickenCommissionPrices.fromJson(Map json) => _$ChickenCommissionPricesFromJson(json); + +@override final double? chickenAveragePrice; + +/// Create a copy of ChickenCommissionPrices +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$ChickenCommissionPricesCopyWith<_ChickenCommissionPrices> get copyWith => __$ChickenCommissionPricesCopyWithImpl<_ChickenCommissionPrices>(this, _$identity); + +@override +Map toJson() { + return _$ChickenCommissionPricesToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ChickenCommissionPrices&&(identical(other.chickenAveragePrice, chickenAveragePrice) || other.chickenAveragePrice == chickenAveragePrice)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,chickenAveragePrice); + +@override +String toString() { + return 'ChickenCommissionPrices(chickenAveragePrice: $chickenAveragePrice)'; +} + + +} + +/// @nodoc +abstract mixin class _$ChickenCommissionPricesCopyWith<$Res> implements $ChickenCommissionPricesCopyWith<$Res> { + factory _$ChickenCommissionPricesCopyWith(_ChickenCommissionPrices value, $Res Function(_ChickenCommissionPrices) _then) = __$ChickenCommissionPricesCopyWithImpl; +@override @useResult +$Res call({ + double? chickenAveragePrice +}); + + + + +} +/// @nodoc +class __$ChickenCommissionPricesCopyWithImpl<$Res> + implements _$ChickenCommissionPricesCopyWith<$Res> { + __$ChickenCommissionPricesCopyWithImpl(this._self, this._then); + + final _ChickenCommissionPrices _self; + final $Res Function(_ChickenCommissionPrices) _then; + +/// Create a copy of ChickenCommissionPrices +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? chickenAveragePrice = freezed,}) { + return _then(_ChickenCommissionPrices( +chickenAveragePrice: freezed == chickenAveragePrice ? _self.chickenAveragePrice : chickenAveragePrice // ignore: cast_nullable_to_non_nullable +as double?, + )); +} + + +} + +// dart format on diff --git a/packages/chicken/lib/data/models/kill_house_module/register_request/response/chicken_commission_prices/chicken_commission_prices.g.dart b/packages/chicken/lib/data/models/kill_house_module/register_request/response/chicken_commission_prices/chicken_commission_prices.g.dart new file mode 100644 index 0000000..1bf6e8f --- /dev/null +++ b/packages/chicken/lib/data/models/kill_house_module/register_request/response/chicken_commission_prices/chicken_commission_prices.g.dart @@ -0,0 +1,17 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'chicken_commission_prices.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_ChickenCommissionPrices _$ChickenCommissionPricesFromJson( + Map json, +) => _ChickenCommissionPrices( + chickenAveragePrice: (json['chicken_average_price'] as num?)?.toDouble(), +); + +Map _$ChickenCommissionPricesToJson( + _ChickenCommissionPrices instance, +) => {'chicken_average_price': instance.chickenAveragePrice}; diff --git a/packages/chicken/lib/data/models/kill_house_module/register_request/response/kill_house/kill_house_response.dart b/packages/chicken/lib/data/models/kill_house_module/register_request/response/kill_house/kill_house_response.dart index e69de29..c71684e 100644 --- a/packages/chicken/lib/data/models/kill_house_module/register_request/response/kill_house/kill_house_response.dart +++ b/packages/chicken/lib/data/models/kill_house_module/register_request/response/kill_house/kill_house_response.dart @@ -0,0 +1,12 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'kill_house_response.freezed.dart'; +part 'kill_house_response.g.dart'; + +@freezed +abstract class KillHouseResponse with _$KillHouseResponse { + const factory KillHouseResponse({String? name, String? key}) = _KillHouseResponse; + + factory KillHouseResponse.fromJson(Map json) => + _$KillHouseResponseFromJson(json); +} diff --git a/packages/chicken/lib/data/models/kill_house_module/register_request/response/kill_house/kill_house_response.freezed.dart b/packages/chicken/lib/data/models/kill_house_module/register_request/response/kill_house/kill_house_response.freezed.dart new file mode 100644 index 0000000..8edb080 --- /dev/null +++ b/packages/chicken/lib/data/models/kill_house_module/register_request/response/kill_house/kill_house_response.freezed.dart @@ -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_response.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +// dart format off +T _$identity(T value) => value; + +/// @nodoc +mixin _$KillHouseResponse { + + String? get name; String? get key; +/// Create a copy of KillHouseResponse +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$KillHouseResponseCopyWith get copyWith => _$KillHouseResponseCopyWithImpl(this as KillHouseResponse, _$identity); + + /// Serializes this KillHouseResponse to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is KillHouseResponse&&(identical(other.name, name) || other.name == name)&&(identical(other.key, key) || other.key == key)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,name,key); + +@override +String toString() { + return 'KillHouseResponse(name: $name, key: $key)'; +} + + +} + +/// @nodoc +abstract mixin class $KillHouseResponseCopyWith<$Res> { + factory $KillHouseResponseCopyWith(KillHouseResponse value, $Res Function(KillHouseResponse) _then) = _$KillHouseResponseCopyWithImpl; +@useResult +$Res call({ + String? name, String? key +}); + + + + +} +/// @nodoc +class _$KillHouseResponseCopyWithImpl<$Res> + implements $KillHouseResponseCopyWith<$Res> { + _$KillHouseResponseCopyWithImpl(this._self, this._then); + + final KillHouseResponse _self; + final $Res Function(KillHouseResponse) _then; + +/// Create a copy of KillHouseResponse +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? name = freezed,Object? key = freezed,}) { + return _then(_self.copyWith( +name: freezed == name ? _self.name : name // 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 [KillHouseResponse]. +extension KillHouseResponsePatterns on KillHouseResponse { +/// 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 Function( _KillHouseResponse value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _KillHouseResponse() 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 Function( _KillHouseResponse value) $default,){ +final _that = this; +switch (_that) { +case _KillHouseResponse(): +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? Function( _KillHouseResponse value)? $default,){ +final _that = this; +switch (_that) { +case _KillHouseResponse() 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 Function( String? name, String? key)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _KillHouseResponse() when $default != null: +return $default(_that.name,_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 Function( String? name, String? key) $default,) {final _that = this; +switch (_that) { +case _KillHouseResponse(): +return $default(_that.name,_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? Function( String? name, String? key)? $default,) {final _that = this; +switch (_that) { +case _KillHouseResponse() when $default != null: +return $default(_that.name,_that.key);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _KillHouseResponse implements KillHouseResponse { + const _KillHouseResponse({this.name, this.key}); + factory _KillHouseResponse.fromJson(Map json) => _$KillHouseResponseFromJson(json); + +@override final String? name; +@override final String? key; + +/// Create a copy of KillHouseResponse +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$KillHouseResponseCopyWith<_KillHouseResponse> get copyWith => __$KillHouseResponseCopyWithImpl<_KillHouseResponse>(this, _$identity); + +@override +Map toJson() { + return _$KillHouseResponseToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _KillHouseResponse&&(identical(other.name, name) || other.name == name)&&(identical(other.key, key) || other.key == key)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,name,key); + +@override +String toString() { + return 'KillHouseResponse(name: $name, key: $key)'; +} + + +} + +/// @nodoc +abstract mixin class _$KillHouseResponseCopyWith<$Res> implements $KillHouseResponseCopyWith<$Res> { + factory _$KillHouseResponseCopyWith(_KillHouseResponse value, $Res Function(_KillHouseResponse) _then) = __$KillHouseResponseCopyWithImpl; +@override @useResult +$Res call({ + String? name, String? key +}); + + + + +} +/// @nodoc +class __$KillHouseResponseCopyWithImpl<$Res> + implements _$KillHouseResponseCopyWith<$Res> { + __$KillHouseResponseCopyWithImpl(this._self, this._then); + + final _KillHouseResponse _self; + final $Res Function(_KillHouseResponse) _then; + +/// Create a copy of KillHouseResponse +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? name = freezed,Object? key = freezed,}) { + return _then(_KillHouseResponse( +name: freezed == name ? _self.name : name // 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 diff --git a/packages/chicken/lib/data/models/kill_house_module/register_request/response/kill_house/kill_house_response.g.dart b/packages/chicken/lib/data/models/kill_house_module/register_request/response/kill_house/kill_house_response.g.dart new file mode 100644 index 0000000..cf54820 --- /dev/null +++ b/packages/chicken/lib/data/models/kill_house_module/register_request/response/kill_house/kill_house_response.g.dart @@ -0,0 +1,16 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'kill_house_response.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_KillHouseResponse _$KillHouseResponseFromJson(Map json) => + _KillHouseResponse( + name: json['name'] as String?, + key: json['key'] as String?, + ); + +Map _$KillHouseResponseToJson(_KillHouseResponse instance) => + {'name': instance.name, 'key': instance.key}; diff --git a/packages/chicken/lib/data/models/kill_house_module/register_request/response/kill_request_list/kill_request_list.dart b/packages/chicken/lib/data/models/kill_house_module/register_request/response/kill_request_list/kill_request_list.dart index e69de29..4d6d601 100644 --- a/packages/chicken/lib/data/models/kill_house_module/register_request/response/kill_request_list/kill_request_list.dart +++ b/packages/chicken/lib/data/models/kill_house_module/register_request/response/kill_request_list/kill_request_list.dart @@ -0,0 +1,125 @@ +import 'package:freezed_annotation/freezed_annotation.dart'; + +part 'kill_request_list.freezed.dart'; +part 'kill_request_list.g.dart'; + +@freezed +abstract class KillRequestList with _$KillRequestList { + const factory KillRequestList({ + int? id, + KillHouseResponse? killHouse, + KillHouseVetResponse? killHouseVet, + int? numberOfAllocated, + String? key, + String? createDate, + String? modifyDate, + bool? trash, + int? killCapacity, + int? previousKillCapacity, + int? remainQuantityForPoultry, + int? remainQuantity, + String? reciveTime, + String? reciveDate, + String? state, + String? provinceState, + BuyTypeResponse? buyType, + WeightTypeResponse? weightType, + String? chickenBreed, + double? indexWeight, + bool? smsPayment, + RegistrarResponse? registrar, + }) = _KillRequestList; + + factory KillRequestList.fromJson(Map json) => _$KillRequestListFromJson(json); +} + +/////////////////////////////////////////////////// +/// SUB MODELS +/////////////////////////////////////////////////// + +@freezed +abstract class KillHouseResponse with _$KillHouseResponse { + const factory KillHouseResponse({ + KillHouseOperator? killHouseOperator, + String? name, + bool? killer, + String? key, + }) = _KillHouseResponse; + + factory KillHouseResponse.fromJson(Map json) => + _$KillHouseResponseFromJson(json); +} + +@freezed +abstract class KillHouseOperator with _$KillHouseOperator { + const factory KillHouseOperator({UserResponse? user}) = _KillHouseOperator; + + factory KillHouseOperator.fromJson(Map json) => + _$KillHouseOperatorFromJson(json); +} + +@freezed +abstract class UserResponse with _$UserResponse { + const factory UserResponse({ + String? fullname, + String? firstName, + String? lastName, + String? mobile, + String? key, + CityResponse? city, + }) = _UserResponse; + + factory UserResponse.fromJson(Map json) => _$UserResponseFromJson(json); +} + +@freezed +abstract class CityResponse with _$CityResponse { + const factory CityResponse({int? id, String? name, String? provinceName}) = _CityResponse; + + factory CityResponse.fromJson(Map json) => _$CityResponseFromJson(json); +} + +@freezed +abstract class KillHouseVetResponse with _$KillHouseVetResponse { + const factory KillHouseVetResponse({ + int? id, + VetResponse? vet, + KillHouseResponse? killHouse, + String? key, + bool? trash, + }) = _KillHouseVetResponse; + + factory KillHouseVetResponse.fromJson(Map json) => + _$KillHouseVetResponseFromJson(json); +} + +@freezed +abstract class VetResponse with _$VetResponse { + const factory VetResponse({UserResponse? user}) = _VetResponse; + + factory VetResponse.fromJson(Map json) => _$VetResponseFromJson(json); +} + +@freezed +abstract class BuyTypeResponse with _$BuyTypeResponse { + const factory BuyTypeResponse({bool? cash, bool? credit}) = _BuyTypeResponse; + + factory BuyTypeResponse.fromJson(Map json) => _$BuyTypeResponseFromJson(json); +} + +@freezed +abstract class WeightTypeResponse with _$WeightTypeResponse { + const factory WeightTypeResponse({bool? lowWeight, bool? highWeight}) = _WeightTypeResponse; + + factory WeightTypeResponse.fromJson(Map json) => + _$WeightTypeResponseFromJson(json); +} + +@freezed +abstract class RegistrarResponse with _$RegistrarResponse { + const factory RegistrarResponse({String? date, String? role, String? fullName}) = + _RegistrarResponse; + + factory RegistrarResponse.fromJson(Map json) => + _$RegistrarResponseFromJson(json); +} diff --git a/packages/chicken/lib/data/models/kill_house_module/register_request/response/kill_request_list/kill_request_list.freezed.dart b/packages/chicken/lib/data/models/kill_house_module/register_request/response/kill_request_list/kill_request_list.freezed.dart new file mode 100644 index 0000000..88f4c2a --- /dev/null +++ b/packages/chicken/lib/data/models/kill_house_module/register_request/response/kill_request_list/kill_request_list.freezed.dart @@ -0,0 +1,3025 @@ +// 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_request_list.dart'; + +// ************************************************************************** +// FreezedGenerator +// ************************************************************************** + +// dart format off +T _$identity(T value) => value; + +/// @nodoc +mixin _$KillRequestList { + + int? get id; KillHouseResponse? get killHouse; KillHouseVetResponse? get killHouseVet; int? get numberOfAllocated; String? get key; String? get createDate; String? get modifyDate; bool? get trash; int? get killCapacity; int? get previousKillCapacity; int? get remainQuantityForPoultry; int? get remainQuantity; String? get reciveTime; String? get reciveDate; String? get state; String? get provinceState; BuyTypeResponse? get buyType; WeightTypeResponse? get weightType; String? get chickenBreed; double? get indexWeight; bool? get smsPayment; RegistrarResponse? get registrar; +/// Create a copy of KillRequestList +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$KillRequestListCopyWith get copyWith => _$KillRequestListCopyWithImpl(this as KillRequestList, _$identity); + + /// Serializes this KillRequestList to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is KillRequestList&&(identical(other.id, id) || other.id == id)&&(identical(other.killHouse, killHouse) || other.killHouse == killHouse)&&(identical(other.killHouseVet, killHouseVet) || other.killHouseVet == killHouseVet)&&(identical(other.numberOfAllocated, numberOfAllocated) || other.numberOfAllocated == numberOfAllocated)&&(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.killCapacity, killCapacity) || other.killCapacity == killCapacity)&&(identical(other.previousKillCapacity, previousKillCapacity) || other.previousKillCapacity == previousKillCapacity)&&(identical(other.remainQuantityForPoultry, remainQuantityForPoultry) || other.remainQuantityForPoultry == remainQuantityForPoultry)&&(identical(other.remainQuantity, remainQuantity) || other.remainQuantity == remainQuantity)&&(identical(other.reciveTime, reciveTime) || other.reciveTime == reciveTime)&&(identical(other.reciveDate, reciveDate) || other.reciveDate == reciveDate)&&(identical(other.state, state) || other.state == state)&&(identical(other.provinceState, provinceState) || other.provinceState == provinceState)&&(identical(other.buyType, buyType) || other.buyType == buyType)&&(identical(other.weightType, weightType) || other.weightType == weightType)&&(identical(other.chickenBreed, chickenBreed) || other.chickenBreed == chickenBreed)&&(identical(other.indexWeight, indexWeight) || other.indexWeight == indexWeight)&&(identical(other.smsPayment, smsPayment) || other.smsPayment == smsPayment)&&(identical(other.registrar, registrar) || other.registrar == registrar)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hashAll([runtimeType,id,killHouse,killHouseVet,numberOfAllocated,key,createDate,modifyDate,trash,killCapacity,previousKillCapacity,remainQuantityForPoultry,remainQuantity,reciveTime,reciveDate,state,provinceState,buyType,weightType,chickenBreed,indexWeight,smsPayment,registrar]); + +@override +String toString() { + return 'KillRequestList(id: $id, killHouse: $killHouse, killHouseVet: $killHouseVet, numberOfAllocated: $numberOfAllocated, key: $key, createDate: $createDate, modifyDate: $modifyDate, trash: $trash, killCapacity: $killCapacity, previousKillCapacity: $previousKillCapacity, remainQuantityForPoultry: $remainQuantityForPoultry, remainQuantity: $remainQuantity, reciveTime: $reciveTime, reciveDate: $reciveDate, state: $state, provinceState: $provinceState, buyType: $buyType, weightType: $weightType, chickenBreed: $chickenBreed, indexWeight: $indexWeight, smsPayment: $smsPayment, registrar: $registrar)'; +} + + +} + +/// @nodoc +abstract mixin class $KillRequestListCopyWith<$Res> { + factory $KillRequestListCopyWith(KillRequestList value, $Res Function(KillRequestList) _then) = _$KillRequestListCopyWithImpl; +@useResult +$Res call({ + int? id, KillHouseResponse? killHouse, KillHouseVetResponse? killHouseVet, int? numberOfAllocated, String? key, String? createDate, String? modifyDate, bool? trash, int? killCapacity, int? previousKillCapacity, int? remainQuantityForPoultry, int? remainQuantity, String? reciveTime, String? reciveDate, String? state, String? provinceState, BuyTypeResponse? buyType, WeightTypeResponse? weightType, String? chickenBreed, double? indexWeight, bool? smsPayment, RegistrarResponse? registrar +}); + + +$KillHouseResponseCopyWith<$Res>? get killHouse;$KillHouseVetResponseCopyWith<$Res>? get killHouseVet;$BuyTypeResponseCopyWith<$Res>? get buyType;$WeightTypeResponseCopyWith<$Res>? get weightType;$RegistrarResponseCopyWith<$Res>? get registrar; + +} +/// @nodoc +class _$KillRequestListCopyWithImpl<$Res> + implements $KillRequestListCopyWith<$Res> { + _$KillRequestListCopyWithImpl(this._self, this._then); + + final KillRequestList _self; + final $Res Function(KillRequestList) _then; + +/// Create a copy of KillRequestList +/// 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? killHouseVet = freezed,Object? numberOfAllocated = freezed,Object? key = freezed,Object? createDate = freezed,Object? modifyDate = freezed,Object? trash = freezed,Object? killCapacity = freezed,Object? previousKillCapacity = freezed,Object? remainQuantityForPoultry = freezed,Object? remainQuantity = freezed,Object? reciveTime = freezed,Object? reciveDate = freezed,Object? state = freezed,Object? provinceState = freezed,Object? buyType = freezed,Object? weightType = freezed,Object? chickenBreed = freezed,Object? indexWeight = freezed,Object? smsPayment = freezed,Object? registrar = 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 KillHouseResponse?,killHouseVet: freezed == killHouseVet ? _self.killHouseVet : killHouseVet // ignore: cast_nullable_to_non_nullable +as KillHouseVetResponse?,numberOfAllocated: freezed == numberOfAllocated ? _self.numberOfAllocated : numberOfAllocated // ignore: cast_nullable_to_non_nullable +as int?,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?,killCapacity: freezed == killCapacity ? _self.killCapacity : killCapacity // ignore: cast_nullable_to_non_nullable +as int?,previousKillCapacity: freezed == previousKillCapacity ? _self.previousKillCapacity : previousKillCapacity // ignore: cast_nullable_to_non_nullable +as int?,remainQuantityForPoultry: freezed == remainQuantityForPoultry ? _self.remainQuantityForPoultry : remainQuantityForPoultry // ignore: cast_nullable_to_non_nullable +as int?,remainQuantity: freezed == remainQuantity ? _self.remainQuantity : remainQuantity // ignore: cast_nullable_to_non_nullable +as int?,reciveTime: freezed == reciveTime ? _self.reciveTime : reciveTime // ignore: cast_nullable_to_non_nullable +as String?,reciveDate: freezed == reciveDate ? _self.reciveDate : reciveDate // ignore: cast_nullable_to_non_nullable +as String?,state: freezed == state ? _self.state : state // ignore: cast_nullable_to_non_nullable +as String?,provinceState: freezed == provinceState ? _self.provinceState : provinceState // ignore: cast_nullable_to_non_nullable +as String?,buyType: freezed == buyType ? _self.buyType : buyType // ignore: cast_nullable_to_non_nullable +as BuyTypeResponse?,weightType: freezed == weightType ? _self.weightType : weightType // ignore: cast_nullable_to_non_nullable +as WeightTypeResponse?,chickenBreed: freezed == chickenBreed ? _self.chickenBreed : chickenBreed // ignore: cast_nullable_to_non_nullable +as String?,indexWeight: freezed == indexWeight ? _self.indexWeight : indexWeight // ignore: cast_nullable_to_non_nullable +as double?,smsPayment: freezed == smsPayment ? _self.smsPayment : smsPayment // ignore: cast_nullable_to_non_nullable +as bool?,registrar: freezed == registrar ? _self.registrar : registrar // ignore: cast_nullable_to_non_nullable +as RegistrarResponse?, + )); +} +/// Create a copy of KillRequestList +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$KillHouseResponseCopyWith<$Res>? get killHouse { + if (_self.killHouse == null) { + return null; + } + + return $KillHouseResponseCopyWith<$Res>(_self.killHouse!, (value) { + return _then(_self.copyWith(killHouse: value)); + }); +}/// Create a copy of KillRequestList +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$KillHouseVetResponseCopyWith<$Res>? get killHouseVet { + if (_self.killHouseVet == null) { + return null; + } + + return $KillHouseVetResponseCopyWith<$Res>(_self.killHouseVet!, (value) { + return _then(_self.copyWith(killHouseVet: value)); + }); +}/// Create a copy of KillRequestList +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BuyTypeResponseCopyWith<$Res>? get buyType { + if (_self.buyType == null) { + return null; + } + + return $BuyTypeResponseCopyWith<$Res>(_self.buyType!, (value) { + return _then(_self.copyWith(buyType: value)); + }); +}/// Create a copy of KillRequestList +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$WeightTypeResponseCopyWith<$Res>? get weightType { + if (_self.weightType == null) { + return null; + } + + return $WeightTypeResponseCopyWith<$Res>(_self.weightType!, (value) { + return _then(_self.copyWith(weightType: value)); + }); +}/// Create a copy of KillRequestList +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$RegistrarResponseCopyWith<$Res>? get registrar { + if (_self.registrar == null) { + return null; + } + + return $RegistrarResponseCopyWith<$Res>(_self.registrar!, (value) { + return _then(_self.copyWith(registrar: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [KillRequestList]. +extension KillRequestListPatterns on KillRequestList { +/// 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 Function( _KillRequestList value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _KillRequestList() 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 Function( _KillRequestList value) $default,){ +final _that = this; +switch (_that) { +case _KillRequestList(): +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? Function( _KillRequestList value)? $default,){ +final _that = this; +switch (_that) { +case _KillRequestList() 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 Function( int? id, KillHouseResponse? killHouse, KillHouseVetResponse? killHouseVet, int? numberOfAllocated, String? key, String? createDate, String? modifyDate, bool? trash, int? killCapacity, int? previousKillCapacity, int? remainQuantityForPoultry, int? remainQuantity, String? reciveTime, String? reciveDate, String? state, String? provinceState, BuyTypeResponse? buyType, WeightTypeResponse? weightType, String? chickenBreed, double? indexWeight, bool? smsPayment, RegistrarResponse? registrar)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _KillRequestList() when $default != null: +return $default(_that.id,_that.killHouse,_that.killHouseVet,_that.numberOfAllocated,_that.key,_that.createDate,_that.modifyDate,_that.trash,_that.killCapacity,_that.previousKillCapacity,_that.remainQuantityForPoultry,_that.remainQuantity,_that.reciveTime,_that.reciveDate,_that.state,_that.provinceState,_that.buyType,_that.weightType,_that.chickenBreed,_that.indexWeight,_that.smsPayment,_that.registrar);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 Function( int? id, KillHouseResponse? killHouse, KillHouseVetResponse? killHouseVet, int? numberOfAllocated, String? key, String? createDate, String? modifyDate, bool? trash, int? killCapacity, int? previousKillCapacity, int? remainQuantityForPoultry, int? remainQuantity, String? reciveTime, String? reciveDate, String? state, String? provinceState, BuyTypeResponse? buyType, WeightTypeResponse? weightType, String? chickenBreed, double? indexWeight, bool? smsPayment, RegistrarResponse? registrar) $default,) {final _that = this; +switch (_that) { +case _KillRequestList(): +return $default(_that.id,_that.killHouse,_that.killHouseVet,_that.numberOfAllocated,_that.key,_that.createDate,_that.modifyDate,_that.trash,_that.killCapacity,_that.previousKillCapacity,_that.remainQuantityForPoultry,_that.remainQuantity,_that.reciveTime,_that.reciveDate,_that.state,_that.provinceState,_that.buyType,_that.weightType,_that.chickenBreed,_that.indexWeight,_that.smsPayment,_that.registrar);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? Function( int? id, KillHouseResponse? killHouse, KillHouseVetResponse? killHouseVet, int? numberOfAllocated, String? key, String? createDate, String? modifyDate, bool? trash, int? killCapacity, int? previousKillCapacity, int? remainQuantityForPoultry, int? remainQuantity, String? reciveTime, String? reciveDate, String? state, String? provinceState, BuyTypeResponse? buyType, WeightTypeResponse? weightType, String? chickenBreed, double? indexWeight, bool? smsPayment, RegistrarResponse? registrar)? $default,) {final _that = this; +switch (_that) { +case _KillRequestList() when $default != null: +return $default(_that.id,_that.killHouse,_that.killHouseVet,_that.numberOfAllocated,_that.key,_that.createDate,_that.modifyDate,_that.trash,_that.killCapacity,_that.previousKillCapacity,_that.remainQuantityForPoultry,_that.remainQuantity,_that.reciveTime,_that.reciveDate,_that.state,_that.provinceState,_that.buyType,_that.weightType,_that.chickenBreed,_that.indexWeight,_that.smsPayment,_that.registrar);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _KillRequestList implements KillRequestList { + const _KillRequestList({this.id, this.killHouse, this.killHouseVet, this.numberOfAllocated, this.key, this.createDate, this.modifyDate, this.trash, this.killCapacity, this.previousKillCapacity, this.remainQuantityForPoultry, this.remainQuantity, this.reciveTime, this.reciveDate, this.state, this.provinceState, this.buyType, this.weightType, this.chickenBreed, this.indexWeight, this.smsPayment, this.registrar}); + factory _KillRequestList.fromJson(Map json) => _$KillRequestListFromJson(json); + +@override final int? id; +@override final KillHouseResponse? killHouse; +@override final KillHouseVetResponse? killHouseVet; +@override final int? numberOfAllocated; +@override final String? key; +@override final String? createDate; +@override final String? modifyDate; +@override final bool? trash; +@override final int? killCapacity; +@override final int? previousKillCapacity; +@override final int? remainQuantityForPoultry; +@override final int? remainQuantity; +@override final String? reciveTime; +@override final String? reciveDate; +@override final String? state; +@override final String? provinceState; +@override final BuyTypeResponse? buyType; +@override final WeightTypeResponse? weightType; +@override final String? chickenBreed; +@override final double? indexWeight; +@override final bool? smsPayment; +@override final RegistrarResponse? registrar; + +/// Create a copy of KillRequestList +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$KillRequestListCopyWith<_KillRequestList> get copyWith => __$KillRequestListCopyWithImpl<_KillRequestList>(this, _$identity); + +@override +Map toJson() { + return _$KillRequestListToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _KillRequestList&&(identical(other.id, id) || other.id == id)&&(identical(other.killHouse, killHouse) || other.killHouse == killHouse)&&(identical(other.killHouseVet, killHouseVet) || other.killHouseVet == killHouseVet)&&(identical(other.numberOfAllocated, numberOfAllocated) || other.numberOfAllocated == numberOfAllocated)&&(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.killCapacity, killCapacity) || other.killCapacity == killCapacity)&&(identical(other.previousKillCapacity, previousKillCapacity) || other.previousKillCapacity == previousKillCapacity)&&(identical(other.remainQuantityForPoultry, remainQuantityForPoultry) || other.remainQuantityForPoultry == remainQuantityForPoultry)&&(identical(other.remainQuantity, remainQuantity) || other.remainQuantity == remainQuantity)&&(identical(other.reciveTime, reciveTime) || other.reciveTime == reciveTime)&&(identical(other.reciveDate, reciveDate) || other.reciveDate == reciveDate)&&(identical(other.state, state) || other.state == state)&&(identical(other.provinceState, provinceState) || other.provinceState == provinceState)&&(identical(other.buyType, buyType) || other.buyType == buyType)&&(identical(other.weightType, weightType) || other.weightType == weightType)&&(identical(other.chickenBreed, chickenBreed) || other.chickenBreed == chickenBreed)&&(identical(other.indexWeight, indexWeight) || other.indexWeight == indexWeight)&&(identical(other.smsPayment, smsPayment) || other.smsPayment == smsPayment)&&(identical(other.registrar, registrar) || other.registrar == registrar)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hashAll([runtimeType,id,killHouse,killHouseVet,numberOfAllocated,key,createDate,modifyDate,trash,killCapacity,previousKillCapacity,remainQuantityForPoultry,remainQuantity,reciveTime,reciveDate,state,provinceState,buyType,weightType,chickenBreed,indexWeight,smsPayment,registrar]); + +@override +String toString() { + return 'KillRequestList(id: $id, killHouse: $killHouse, killHouseVet: $killHouseVet, numberOfAllocated: $numberOfAllocated, key: $key, createDate: $createDate, modifyDate: $modifyDate, trash: $trash, killCapacity: $killCapacity, previousKillCapacity: $previousKillCapacity, remainQuantityForPoultry: $remainQuantityForPoultry, remainQuantity: $remainQuantity, reciveTime: $reciveTime, reciveDate: $reciveDate, state: $state, provinceState: $provinceState, buyType: $buyType, weightType: $weightType, chickenBreed: $chickenBreed, indexWeight: $indexWeight, smsPayment: $smsPayment, registrar: $registrar)'; +} + + +} + +/// @nodoc +abstract mixin class _$KillRequestListCopyWith<$Res> implements $KillRequestListCopyWith<$Res> { + factory _$KillRequestListCopyWith(_KillRequestList value, $Res Function(_KillRequestList) _then) = __$KillRequestListCopyWithImpl; +@override @useResult +$Res call({ + int? id, KillHouseResponse? killHouse, KillHouseVetResponse? killHouseVet, int? numberOfAllocated, String? key, String? createDate, String? modifyDate, bool? trash, int? killCapacity, int? previousKillCapacity, int? remainQuantityForPoultry, int? remainQuantity, String? reciveTime, String? reciveDate, String? state, String? provinceState, BuyTypeResponse? buyType, WeightTypeResponse? weightType, String? chickenBreed, double? indexWeight, bool? smsPayment, RegistrarResponse? registrar +}); + + +@override $KillHouseResponseCopyWith<$Res>? get killHouse;@override $KillHouseVetResponseCopyWith<$Res>? get killHouseVet;@override $BuyTypeResponseCopyWith<$Res>? get buyType;@override $WeightTypeResponseCopyWith<$Res>? get weightType;@override $RegistrarResponseCopyWith<$Res>? get registrar; + +} +/// @nodoc +class __$KillRequestListCopyWithImpl<$Res> + implements _$KillRequestListCopyWith<$Res> { + __$KillRequestListCopyWithImpl(this._self, this._then); + + final _KillRequestList _self; + final $Res Function(_KillRequestList) _then; + +/// Create a copy of KillRequestList +/// 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? killHouseVet = freezed,Object? numberOfAllocated = freezed,Object? key = freezed,Object? createDate = freezed,Object? modifyDate = freezed,Object? trash = freezed,Object? killCapacity = freezed,Object? previousKillCapacity = freezed,Object? remainQuantityForPoultry = freezed,Object? remainQuantity = freezed,Object? reciveTime = freezed,Object? reciveDate = freezed,Object? state = freezed,Object? provinceState = freezed,Object? buyType = freezed,Object? weightType = freezed,Object? chickenBreed = freezed,Object? indexWeight = freezed,Object? smsPayment = freezed,Object? registrar = freezed,}) { + return _then(_KillRequestList( +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 KillHouseResponse?,killHouseVet: freezed == killHouseVet ? _self.killHouseVet : killHouseVet // ignore: cast_nullable_to_non_nullable +as KillHouseVetResponse?,numberOfAllocated: freezed == numberOfAllocated ? _self.numberOfAllocated : numberOfAllocated // ignore: cast_nullable_to_non_nullable +as int?,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?,killCapacity: freezed == killCapacity ? _self.killCapacity : killCapacity // ignore: cast_nullable_to_non_nullable +as int?,previousKillCapacity: freezed == previousKillCapacity ? _self.previousKillCapacity : previousKillCapacity // ignore: cast_nullable_to_non_nullable +as int?,remainQuantityForPoultry: freezed == remainQuantityForPoultry ? _self.remainQuantityForPoultry : remainQuantityForPoultry // ignore: cast_nullable_to_non_nullable +as int?,remainQuantity: freezed == remainQuantity ? _self.remainQuantity : remainQuantity // ignore: cast_nullable_to_non_nullable +as int?,reciveTime: freezed == reciveTime ? _self.reciveTime : reciveTime // ignore: cast_nullable_to_non_nullable +as String?,reciveDate: freezed == reciveDate ? _self.reciveDate : reciveDate // ignore: cast_nullable_to_non_nullable +as String?,state: freezed == state ? _self.state : state // ignore: cast_nullable_to_non_nullable +as String?,provinceState: freezed == provinceState ? _self.provinceState : provinceState // ignore: cast_nullable_to_non_nullable +as String?,buyType: freezed == buyType ? _self.buyType : buyType // ignore: cast_nullable_to_non_nullable +as BuyTypeResponse?,weightType: freezed == weightType ? _self.weightType : weightType // ignore: cast_nullable_to_non_nullable +as WeightTypeResponse?,chickenBreed: freezed == chickenBreed ? _self.chickenBreed : chickenBreed // ignore: cast_nullable_to_non_nullable +as String?,indexWeight: freezed == indexWeight ? _self.indexWeight : indexWeight // ignore: cast_nullable_to_non_nullable +as double?,smsPayment: freezed == smsPayment ? _self.smsPayment : smsPayment // ignore: cast_nullable_to_non_nullable +as bool?,registrar: freezed == registrar ? _self.registrar : registrar // ignore: cast_nullable_to_non_nullable +as RegistrarResponse?, + )); +} + +/// Create a copy of KillRequestList +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$KillHouseResponseCopyWith<$Res>? get killHouse { + if (_self.killHouse == null) { + return null; + } + + return $KillHouseResponseCopyWith<$Res>(_self.killHouse!, (value) { + return _then(_self.copyWith(killHouse: value)); + }); +}/// Create a copy of KillRequestList +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$KillHouseVetResponseCopyWith<$Res>? get killHouseVet { + if (_self.killHouseVet == null) { + return null; + } + + return $KillHouseVetResponseCopyWith<$Res>(_self.killHouseVet!, (value) { + return _then(_self.copyWith(killHouseVet: value)); + }); +}/// Create a copy of KillRequestList +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$BuyTypeResponseCopyWith<$Res>? get buyType { + if (_self.buyType == null) { + return null; + } + + return $BuyTypeResponseCopyWith<$Res>(_self.buyType!, (value) { + return _then(_self.copyWith(buyType: value)); + }); +}/// Create a copy of KillRequestList +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$WeightTypeResponseCopyWith<$Res>? get weightType { + if (_self.weightType == null) { + return null; + } + + return $WeightTypeResponseCopyWith<$Res>(_self.weightType!, (value) { + return _then(_self.copyWith(weightType: value)); + }); +}/// Create a copy of KillRequestList +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$RegistrarResponseCopyWith<$Res>? get registrar { + if (_self.registrar == null) { + return null; + } + + return $RegistrarResponseCopyWith<$Res>(_self.registrar!, (value) { + return _then(_self.copyWith(registrar: value)); + }); +} +} + + +/// @nodoc +mixin _$KillHouseResponse { + + KillHouseOperator? get killHouseOperator; String? get name; bool? get killer; String? get key; +/// Create a copy of KillHouseResponse +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$KillHouseResponseCopyWith get copyWith => _$KillHouseResponseCopyWithImpl(this as KillHouseResponse, _$identity); + + /// Serializes this KillHouseResponse to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is KillHouseResponse&&(identical(other.killHouseOperator, killHouseOperator) || other.killHouseOperator == killHouseOperator)&&(identical(other.name, name) || other.name == name)&&(identical(other.killer, killer) || other.killer == killer)&&(identical(other.key, key) || other.key == key)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,killHouseOperator,name,killer,key); + +@override +String toString() { + return 'KillHouseResponse(killHouseOperator: $killHouseOperator, name: $name, killer: $killer, key: $key)'; +} + + +} + +/// @nodoc +abstract mixin class $KillHouseResponseCopyWith<$Res> { + factory $KillHouseResponseCopyWith(KillHouseResponse value, $Res Function(KillHouseResponse) _then) = _$KillHouseResponseCopyWithImpl; +@useResult +$Res call({ + KillHouseOperator? killHouseOperator, String? name, bool? killer, String? key +}); + + +$KillHouseOperatorCopyWith<$Res>? get killHouseOperator; + +} +/// @nodoc +class _$KillHouseResponseCopyWithImpl<$Res> + implements $KillHouseResponseCopyWith<$Res> { + _$KillHouseResponseCopyWithImpl(this._self, this._then); + + final KillHouseResponse _self; + final $Res Function(KillHouseResponse) _then; + +/// Create a copy of KillHouseResponse +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? killHouseOperator = freezed,Object? name = freezed,Object? killer = freezed,Object? key = freezed,}) { + return _then(_self.copyWith( +killHouseOperator: freezed == killHouseOperator ? _self.killHouseOperator : killHouseOperator // ignore: cast_nullable_to_non_nullable +as KillHouseOperator?,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?,killer: freezed == killer ? _self.killer : killer // ignore: cast_nullable_to_non_nullable +as bool?,key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?, + )); +} +/// Create a copy of KillHouseResponse +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$KillHouseOperatorCopyWith<$Res>? get killHouseOperator { + if (_self.killHouseOperator == null) { + return null; + } + + return $KillHouseOperatorCopyWith<$Res>(_self.killHouseOperator!, (value) { + return _then(_self.copyWith(killHouseOperator: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [KillHouseResponse]. +extension KillHouseResponsePatterns on KillHouseResponse { +/// 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 Function( _KillHouseResponse value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _KillHouseResponse() 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 Function( _KillHouseResponse value) $default,){ +final _that = this; +switch (_that) { +case _KillHouseResponse(): +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? Function( _KillHouseResponse value)? $default,){ +final _that = this; +switch (_that) { +case _KillHouseResponse() 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 Function( KillHouseOperator? killHouseOperator, String? name, bool? killer, String? key)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _KillHouseResponse() when $default != null: +return $default(_that.killHouseOperator,_that.name,_that.killer,_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 Function( KillHouseOperator? killHouseOperator, String? name, bool? killer, String? key) $default,) {final _that = this; +switch (_that) { +case _KillHouseResponse(): +return $default(_that.killHouseOperator,_that.name,_that.killer,_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? Function( KillHouseOperator? killHouseOperator, String? name, bool? killer, String? key)? $default,) {final _that = this; +switch (_that) { +case _KillHouseResponse() when $default != null: +return $default(_that.killHouseOperator,_that.name,_that.killer,_that.key);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _KillHouseResponse implements KillHouseResponse { + const _KillHouseResponse({this.killHouseOperator, this.name, this.killer, this.key}); + factory _KillHouseResponse.fromJson(Map json) => _$KillHouseResponseFromJson(json); + +@override final KillHouseOperator? killHouseOperator; +@override final String? name; +@override final bool? killer; +@override final String? key; + +/// Create a copy of KillHouseResponse +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$KillHouseResponseCopyWith<_KillHouseResponse> get copyWith => __$KillHouseResponseCopyWithImpl<_KillHouseResponse>(this, _$identity); + +@override +Map toJson() { + return _$KillHouseResponseToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _KillHouseResponse&&(identical(other.killHouseOperator, killHouseOperator) || other.killHouseOperator == killHouseOperator)&&(identical(other.name, name) || other.name == name)&&(identical(other.killer, killer) || other.killer == killer)&&(identical(other.key, key) || other.key == key)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,killHouseOperator,name,killer,key); + +@override +String toString() { + return 'KillHouseResponse(killHouseOperator: $killHouseOperator, name: $name, killer: $killer, key: $key)'; +} + + +} + +/// @nodoc +abstract mixin class _$KillHouseResponseCopyWith<$Res> implements $KillHouseResponseCopyWith<$Res> { + factory _$KillHouseResponseCopyWith(_KillHouseResponse value, $Res Function(_KillHouseResponse) _then) = __$KillHouseResponseCopyWithImpl; +@override @useResult +$Res call({ + KillHouseOperator? killHouseOperator, String? name, bool? killer, String? key +}); + + +@override $KillHouseOperatorCopyWith<$Res>? get killHouseOperator; + +} +/// @nodoc +class __$KillHouseResponseCopyWithImpl<$Res> + implements _$KillHouseResponseCopyWith<$Res> { + __$KillHouseResponseCopyWithImpl(this._self, this._then); + + final _KillHouseResponse _self; + final $Res Function(_KillHouseResponse) _then; + +/// Create a copy of KillHouseResponse +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? killHouseOperator = freezed,Object? name = freezed,Object? killer = freezed,Object? key = freezed,}) { + return _then(_KillHouseResponse( +killHouseOperator: freezed == killHouseOperator ? _self.killHouseOperator : killHouseOperator // ignore: cast_nullable_to_non_nullable +as KillHouseOperator?,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable +as String?,killer: freezed == killer ? _self.killer : killer // ignore: cast_nullable_to_non_nullable +as bool?,key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +/// Create a copy of KillHouseResponse +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$KillHouseOperatorCopyWith<$Res>? get killHouseOperator { + if (_self.killHouseOperator == null) { + return null; + } + + return $KillHouseOperatorCopyWith<$Res>(_self.killHouseOperator!, (value) { + return _then(_self.copyWith(killHouseOperator: value)); + }); +} +} + + +/// @nodoc +mixin _$KillHouseOperator { + + UserResponse? get user; +/// Create a copy of KillHouseOperator +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$KillHouseOperatorCopyWith get copyWith => _$KillHouseOperatorCopyWithImpl(this as KillHouseOperator, _$identity); + + /// Serializes this KillHouseOperator to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is KillHouseOperator&&(identical(other.user, user) || other.user == user)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,user); + +@override +String toString() { + return 'KillHouseOperator(user: $user)'; +} + + +} + +/// @nodoc +abstract mixin class $KillHouseOperatorCopyWith<$Res> { + factory $KillHouseOperatorCopyWith(KillHouseOperator value, $Res Function(KillHouseOperator) _then) = _$KillHouseOperatorCopyWithImpl; +@useResult +$Res call({ + UserResponse? user +}); + + +$UserResponseCopyWith<$Res>? get user; + +} +/// @nodoc +class _$KillHouseOperatorCopyWithImpl<$Res> + implements $KillHouseOperatorCopyWith<$Res> { + _$KillHouseOperatorCopyWithImpl(this._self, this._then); + + final KillHouseOperator _self; + final $Res Function(KillHouseOperator) _then; + +/// Create a copy of KillHouseOperator +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? user = freezed,}) { + return _then(_self.copyWith( +user: freezed == user ? _self.user : user // ignore: cast_nullable_to_non_nullable +as UserResponse?, + )); +} +/// Create a copy of KillHouseOperator +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$UserResponseCopyWith<$Res>? get user { + if (_self.user == null) { + return null; + } + + return $UserResponseCopyWith<$Res>(_self.user!, (value) { + return _then(_self.copyWith(user: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [KillHouseOperator]. +extension KillHouseOperatorPatterns on KillHouseOperator { +/// 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 Function( _KillHouseOperator value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _KillHouseOperator() 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 Function( _KillHouseOperator value) $default,){ +final _that = this; +switch (_that) { +case _KillHouseOperator(): +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? Function( _KillHouseOperator value)? $default,){ +final _that = this; +switch (_that) { +case _KillHouseOperator() 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 Function( UserResponse? user)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _KillHouseOperator() when $default != null: +return $default(_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 Function( UserResponse? user) $default,) {final _that = this; +switch (_that) { +case _KillHouseOperator(): +return $default(_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? Function( UserResponse? user)? $default,) {final _that = this; +switch (_that) { +case _KillHouseOperator() when $default != null: +return $default(_that.user);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _KillHouseOperator implements KillHouseOperator { + const _KillHouseOperator({this.user}); + factory _KillHouseOperator.fromJson(Map json) => _$KillHouseOperatorFromJson(json); + +@override final UserResponse? user; + +/// Create a copy of KillHouseOperator +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$KillHouseOperatorCopyWith<_KillHouseOperator> get copyWith => __$KillHouseOperatorCopyWithImpl<_KillHouseOperator>(this, _$identity); + +@override +Map toJson() { + return _$KillHouseOperatorToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _KillHouseOperator&&(identical(other.user, user) || other.user == user)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,user); + +@override +String toString() { + return 'KillHouseOperator(user: $user)'; +} + + +} + +/// @nodoc +abstract mixin class _$KillHouseOperatorCopyWith<$Res> implements $KillHouseOperatorCopyWith<$Res> { + factory _$KillHouseOperatorCopyWith(_KillHouseOperator value, $Res Function(_KillHouseOperator) _then) = __$KillHouseOperatorCopyWithImpl; +@override @useResult +$Res call({ + UserResponse? user +}); + + +@override $UserResponseCopyWith<$Res>? get user; + +} +/// @nodoc +class __$KillHouseOperatorCopyWithImpl<$Res> + implements _$KillHouseOperatorCopyWith<$Res> { + __$KillHouseOperatorCopyWithImpl(this._self, this._then); + + final _KillHouseOperator _self; + final $Res Function(_KillHouseOperator) _then; + +/// Create a copy of KillHouseOperator +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? user = freezed,}) { + return _then(_KillHouseOperator( +user: freezed == user ? _self.user : user // ignore: cast_nullable_to_non_nullable +as UserResponse?, + )); +} + +/// Create a copy of KillHouseOperator +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$UserResponseCopyWith<$Res>? get user { + if (_self.user == null) { + return null; + } + + return $UserResponseCopyWith<$Res>(_self.user!, (value) { + return _then(_self.copyWith(user: value)); + }); +} +} + + +/// @nodoc +mixin _$UserResponse { + + String? get fullname; String? get firstName; String? get lastName; String? get mobile; String? get key; CityResponse? get city; +/// Create a copy of UserResponse +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$UserResponseCopyWith get copyWith => _$UserResponseCopyWithImpl(this as UserResponse, _$identity); + + /// Serializes this UserResponse to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is UserResponse&&(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.key, key) || other.key == key)&&(identical(other.city, city) || other.city == city)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,fullname,firstName,lastName,mobile,key,city); + +@override +String toString() { + return 'UserResponse(fullname: $fullname, firstName: $firstName, lastName: $lastName, mobile: $mobile, key: $key, city: $city)'; +} + + +} + +/// @nodoc +abstract mixin class $UserResponseCopyWith<$Res> { + factory $UserResponseCopyWith(UserResponse value, $Res Function(UserResponse) _then) = _$UserResponseCopyWithImpl; +@useResult +$Res call({ + String? fullname, String? firstName, String? lastName, String? mobile, String? key, CityResponse? city +}); + + +$CityResponseCopyWith<$Res>? get city; + +} +/// @nodoc +class _$UserResponseCopyWithImpl<$Res> + implements $UserResponseCopyWith<$Res> { + _$UserResponseCopyWithImpl(this._self, this._then); + + final UserResponse _self; + final $Res Function(UserResponse) _then; + +/// Create a copy of UserResponse +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? fullname = freezed,Object? firstName = freezed,Object? lastName = freezed,Object? mobile = freezed,Object? key = freezed,Object? city = freezed,}) { + return _then(_self.copyWith( +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?,key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as CityResponse?, + )); +} +/// Create a copy of UserResponse +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$CityResponseCopyWith<$Res>? get city { + if (_self.city == null) { + return null; + } + + return $CityResponseCopyWith<$Res>(_self.city!, (value) { + return _then(_self.copyWith(city: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [UserResponse]. +extension UserResponsePatterns on UserResponse { +/// 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 Function( _UserResponse value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _UserResponse() 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 Function( _UserResponse value) $default,){ +final _that = this; +switch (_that) { +case _UserResponse(): +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? Function( _UserResponse value)? $default,){ +final _that = this; +switch (_that) { +case _UserResponse() 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 Function( String? fullname, String? firstName, String? lastName, String? mobile, String? key, CityResponse? city)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _UserResponse() when $default != null: +return $default(_that.fullname,_that.firstName,_that.lastName,_that.mobile,_that.key,_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 Function( String? fullname, String? firstName, String? lastName, String? mobile, String? key, CityResponse? city) $default,) {final _that = this; +switch (_that) { +case _UserResponse(): +return $default(_that.fullname,_that.firstName,_that.lastName,_that.mobile,_that.key,_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? Function( String? fullname, String? firstName, String? lastName, String? mobile, String? key, CityResponse? city)? $default,) {final _that = this; +switch (_that) { +case _UserResponse() when $default != null: +return $default(_that.fullname,_that.firstName,_that.lastName,_that.mobile,_that.key,_that.city);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _UserResponse implements UserResponse { + const _UserResponse({this.fullname, this.firstName, this.lastName, this.mobile, this.key, this.city}); + factory _UserResponse.fromJson(Map json) => _$UserResponseFromJson(json); + +@override final String? fullname; +@override final String? firstName; +@override final String? lastName; +@override final String? mobile; +@override final String? key; +@override final CityResponse? city; + +/// Create a copy of UserResponse +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$UserResponseCopyWith<_UserResponse> get copyWith => __$UserResponseCopyWithImpl<_UserResponse>(this, _$identity); + +@override +Map toJson() { + return _$UserResponseToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _UserResponse&&(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.key, key) || other.key == key)&&(identical(other.city, city) || other.city == city)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,fullname,firstName,lastName,mobile,key,city); + +@override +String toString() { + return 'UserResponse(fullname: $fullname, firstName: $firstName, lastName: $lastName, mobile: $mobile, key: $key, city: $city)'; +} + + +} + +/// @nodoc +abstract mixin class _$UserResponseCopyWith<$Res> implements $UserResponseCopyWith<$Res> { + factory _$UserResponseCopyWith(_UserResponse value, $Res Function(_UserResponse) _then) = __$UserResponseCopyWithImpl; +@override @useResult +$Res call({ + String? fullname, String? firstName, String? lastName, String? mobile, String? key, CityResponse? city +}); + + +@override $CityResponseCopyWith<$Res>? get city; + +} +/// @nodoc +class __$UserResponseCopyWithImpl<$Res> + implements _$UserResponseCopyWith<$Res> { + __$UserResponseCopyWithImpl(this._self, this._then); + + final _UserResponse _self; + final $Res Function(_UserResponse) _then; + +/// Create a copy of UserResponse +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? fullname = freezed,Object? firstName = freezed,Object? lastName = freezed,Object? mobile = freezed,Object? key = freezed,Object? city = freezed,}) { + return _then(_UserResponse( +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?,key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable +as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable +as CityResponse?, + )); +} + +/// Create a copy of UserResponse +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$CityResponseCopyWith<$Res>? get city { + if (_self.city == null) { + return null; + } + + return $CityResponseCopyWith<$Res>(_self.city!, (value) { + return _then(_self.copyWith(city: value)); + }); +} +} + + +/// @nodoc +mixin _$CityResponse { + + int? get id; String? get name; String? get provinceName; +/// Create a copy of CityResponse +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$CityResponseCopyWith get copyWith => _$CityResponseCopyWithImpl(this as CityResponse, _$identity); + + /// Serializes this CityResponse to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is CityResponse&&(identical(other.id, id) || other.id == id)&&(identical(other.name, name) || other.name == name)&&(identical(other.provinceName, provinceName) || other.provinceName == provinceName)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,id,name,provinceName); + +@override +String toString() { + return 'CityResponse(id: $id, name: $name, provinceName: $provinceName)'; +} + + +} + +/// @nodoc +abstract mixin class $CityResponseCopyWith<$Res> { + factory $CityResponseCopyWith(CityResponse value, $Res Function(CityResponse) _then) = _$CityResponseCopyWithImpl; +@useResult +$Res call({ + int? id, String? name, String? provinceName +}); + + + + +} +/// @nodoc +class _$CityResponseCopyWithImpl<$Res> + implements $CityResponseCopyWith<$Res> { + _$CityResponseCopyWithImpl(this._self, this._then); + + final CityResponse _self; + final $Res Function(CityResponse) _then; + +/// Create a copy of CityResponse +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? name = freezed,Object? provinceName = 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?,provinceName: freezed == provinceName ? _self.provinceName : provinceName // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [CityResponse]. +extension CityResponsePatterns on CityResponse { +/// 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 Function( _CityResponse value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _CityResponse() 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 Function( _CityResponse value) $default,){ +final _that = this; +switch (_that) { +case _CityResponse(): +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? Function( _CityResponse value)? $default,){ +final _that = this; +switch (_that) { +case _CityResponse() 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 Function( int? id, String? name, String? provinceName)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _CityResponse() when $default != null: +return $default(_that.id,_that.name,_that.provinceName);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 Function( int? id, String? name, String? provinceName) $default,) {final _that = this; +switch (_that) { +case _CityResponse(): +return $default(_that.id,_that.name,_that.provinceName);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? Function( int? id, String? name, String? provinceName)? $default,) {final _that = this; +switch (_that) { +case _CityResponse() when $default != null: +return $default(_that.id,_that.name,_that.provinceName);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _CityResponse implements CityResponse { + const _CityResponse({this.id, this.name, this.provinceName}); + factory _CityResponse.fromJson(Map json) => _$CityResponseFromJson(json); + +@override final int? id; +@override final String? name; +@override final String? provinceName; + +/// Create a copy of CityResponse +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$CityResponseCopyWith<_CityResponse> get copyWith => __$CityResponseCopyWithImpl<_CityResponse>(this, _$identity); + +@override +Map toJson() { + return _$CityResponseToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _CityResponse&&(identical(other.id, id) || other.id == id)&&(identical(other.name, name) || other.name == name)&&(identical(other.provinceName, provinceName) || other.provinceName == provinceName)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,id,name,provinceName); + +@override +String toString() { + return 'CityResponse(id: $id, name: $name, provinceName: $provinceName)'; +} + + +} + +/// @nodoc +abstract mixin class _$CityResponseCopyWith<$Res> implements $CityResponseCopyWith<$Res> { + factory _$CityResponseCopyWith(_CityResponse value, $Res Function(_CityResponse) _then) = __$CityResponseCopyWithImpl; +@override @useResult +$Res call({ + int? id, String? name, String? provinceName +}); + + + + +} +/// @nodoc +class __$CityResponseCopyWithImpl<$Res> + implements _$CityResponseCopyWith<$Res> { + __$CityResponseCopyWithImpl(this._self, this._then); + + final _CityResponse _self; + final $Res Function(_CityResponse) _then; + +/// Create a copy of CityResponse +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? name = freezed,Object? provinceName = freezed,}) { + return _then(_CityResponse( +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?,provinceName: freezed == provinceName ? _self.provinceName : provinceName // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + + +/// @nodoc +mixin _$KillHouseVetResponse { + + int? get id; VetResponse? get vet; KillHouseResponse? get killHouse; String? get key; bool? get trash; +/// Create a copy of KillHouseVetResponse +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$KillHouseVetResponseCopyWith get copyWith => _$KillHouseVetResponseCopyWithImpl(this as KillHouseVetResponse, _$identity); + + /// Serializes this KillHouseVetResponse to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is KillHouseVetResponse&&(identical(other.id, id) || other.id == id)&&(identical(other.vet, vet) || other.vet == vet)&&(identical(other.killHouse, killHouse) || other.killHouse == killHouse)&&(identical(other.key, key) || other.key == key)&&(identical(other.trash, trash) || other.trash == trash)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,id,vet,killHouse,key,trash); + +@override +String toString() { + return 'KillHouseVetResponse(id: $id, vet: $vet, killHouse: $killHouse, key: $key, trash: $trash)'; +} + + +} + +/// @nodoc +abstract mixin class $KillHouseVetResponseCopyWith<$Res> { + factory $KillHouseVetResponseCopyWith(KillHouseVetResponse value, $Res Function(KillHouseVetResponse) _then) = _$KillHouseVetResponseCopyWithImpl; +@useResult +$Res call({ + int? id, VetResponse? vet, KillHouseResponse? killHouse, String? key, bool? trash +}); + + +$VetResponseCopyWith<$Res>? get vet;$KillHouseResponseCopyWith<$Res>? get killHouse; + +} +/// @nodoc +class _$KillHouseVetResponseCopyWithImpl<$Res> + implements $KillHouseVetResponseCopyWith<$Res> { + _$KillHouseVetResponseCopyWithImpl(this._self, this._then); + + final KillHouseVetResponse _self; + final $Res Function(KillHouseVetResponse) _then; + +/// Create a copy of KillHouseVetResponse +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? vet = freezed,Object? killHouse = freezed,Object? key = freezed,Object? trash = freezed,}) { + return _then(_self.copyWith( +id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as int?,vet: freezed == vet ? _self.vet : vet // ignore: cast_nullable_to_non_nullable +as VetResponse?,killHouse: freezed == killHouse ? _self.killHouse : killHouse // ignore: cast_nullable_to_non_nullable +as KillHouseResponse?,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?, + )); +} +/// Create a copy of KillHouseVetResponse +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$VetResponseCopyWith<$Res>? get vet { + if (_self.vet == null) { + return null; + } + + return $VetResponseCopyWith<$Res>(_self.vet!, (value) { + return _then(_self.copyWith(vet: value)); + }); +}/// Create a copy of KillHouseVetResponse +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$KillHouseResponseCopyWith<$Res>? get killHouse { + if (_self.killHouse == null) { + return null; + } + + return $KillHouseResponseCopyWith<$Res>(_self.killHouse!, (value) { + return _then(_self.copyWith(killHouse: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [KillHouseVetResponse]. +extension KillHouseVetResponsePatterns on KillHouseVetResponse { +/// 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 Function( _KillHouseVetResponse value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _KillHouseVetResponse() 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 Function( _KillHouseVetResponse value) $default,){ +final _that = this; +switch (_that) { +case _KillHouseVetResponse(): +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? Function( _KillHouseVetResponse value)? $default,){ +final _that = this; +switch (_that) { +case _KillHouseVetResponse() 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 Function( int? id, VetResponse? vet, KillHouseResponse? killHouse, String? key, bool? trash)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _KillHouseVetResponse() when $default != null: +return $default(_that.id,_that.vet,_that.killHouse,_that.key,_that.trash);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 Function( int? id, VetResponse? vet, KillHouseResponse? killHouse, String? key, bool? trash) $default,) {final _that = this; +switch (_that) { +case _KillHouseVetResponse(): +return $default(_that.id,_that.vet,_that.killHouse,_that.key,_that.trash);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? Function( int? id, VetResponse? vet, KillHouseResponse? killHouse, String? key, bool? trash)? $default,) {final _that = this; +switch (_that) { +case _KillHouseVetResponse() when $default != null: +return $default(_that.id,_that.vet,_that.killHouse,_that.key,_that.trash);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _KillHouseVetResponse implements KillHouseVetResponse { + const _KillHouseVetResponse({this.id, this.vet, this.killHouse, this.key, this.trash}); + factory _KillHouseVetResponse.fromJson(Map json) => _$KillHouseVetResponseFromJson(json); + +@override final int? id; +@override final VetResponse? vet; +@override final KillHouseResponse? killHouse; +@override final String? key; +@override final bool? trash; + +/// Create a copy of KillHouseVetResponse +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$KillHouseVetResponseCopyWith<_KillHouseVetResponse> get copyWith => __$KillHouseVetResponseCopyWithImpl<_KillHouseVetResponse>(this, _$identity); + +@override +Map toJson() { + return _$KillHouseVetResponseToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _KillHouseVetResponse&&(identical(other.id, id) || other.id == id)&&(identical(other.vet, vet) || other.vet == vet)&&(identical(other.killHouse, killHouse) || other.killHouse == killHouse)&&(identical(other.key, key) || other.key == key)&&(identical(other.trash, trash) || other.trash == trash)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,id,vet,killHouse,key,trash); + +@override +String toString() { + return 'KillHouseVetResponse(id: $id, vet: $vet, killHouse: $killHouse, key: $key, trash: $trash)'; +} + + +} + +/// @nodoc +abstract mixin class _$KillHouseVetResponseCopyWith<$Res> implements $KillHouseVetResponseCopyWith<$Res> { + factory _$KillHouseVetResponseCopyWith(_KillHouseVetResponse value, $Res Function(_KillHouseVetResponse) _then) = __$KillHouseVetResponseCopyWithImpl; +@override @useResult +$Res call({ + int? id, VetResponse? vet, KillHouseResponse? killHouse, String? key, bool? trash +}); + + +@override $VetResponseCopyWith<$Res>? get vet;@override $KillHouseResponseCopyWith<$Res>? get killHouse; + +} +/// @nodoc +class __$KillHouseVetResponseCopyWithImpl<$Res> + implements _$KillHouseVetResponseCopyWith<$Res> { + __$KillHouseVetResponseCopyWithImpl(this._self, this._then); + + final _KillHouseVetResponse _self; + final $Res Function(_KillHouseVetResponse) _then; + +/// Create a copy of KillHouseVetResponse +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? vet = freezed,Object? killHouse = freezed,Object? key = freezed,Object? trash = freezed,}) { + return _then(_KillHouseVetResponse( +id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as int?,vet: freezed == vet ? _self.vet : vet // ignore: cast_nullable_to_non_nullable +as VetResponse?,killHouse: freezed == killHouse ? _self.killHouse : killHouse // ignore: cast_nullable_to_non_nullable +as KillHouseResponse?,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?, + )); +} + +/// Create a copy of KillHouseVetResponse +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$VetResponseCopyWith<$Res>? get vet { + if (_self.vet == null) { + return null; + } + + return $VetResponseCopyWith<$Res>(_self.vet!, (value) { + return _then(_self.copyWith(vet: value)); + }); +}/// Create a copy of KillHouseVetResponse +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$KillHouseResponseCopyWith<$Res>? get killHouse { + if (_self.killHouse == null) { + return null; + } + + return $KillHouseResponseCopyWith<$Res>(_self.killHouse!, (value) { + return _then(_self.copyWith(killHouse: value)); + }); +} +} + + +/// @nodoc +mixin _$VetResponse { + + UserResponse? get user; +/// Create a copy of VetResponse +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$VetResponseCopyWith get copyWith => _$VetResponseCopyWithImpl(this as VetResponse, _$identity); + + /// Serializes this VetResponse to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is VetResponse&&(identical(other.user, user) || other.user == user)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,user); + +@override +String toString() { + return 'VetResponse(user: $user)'; +} + + +} + +/// @nodoc +abstract mixin class $VetResponseCopyWith<$Res> { + factory $VetResponseCopyWith(VetResponse value, $Res Function(VetResponse) _then) = _$VetResponseCopyWithImpl; +@useResult +$Res call({ + UserResponse? user +}); + + +$UserResponseCopyWith<$Res>? get user; + +} +/// @nodoc +class _$VetResponseCopyWithImpl<$Res> + implements $VetResponseCopyWith<$Res> { + _$VetResponseCopyWithImpl(this._self, this._then); + + final VetResponse _self; + final $Res Function(VetResponse) _then; + +/// Create a copy of VetResponse +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? user = freezed,}) { + return _then(_self.copyWith( +user: freezed == user ? _self.user : user // ignore: cast_nullable_to_non_nullable +as UserResponse?, + )); +} +/// Create a copy of VetResponse +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$UserResponseCopyWith<$Res>? get user { + if (_self.user == null) { + return null; + } + + return $UserResponseCopyWith<$Res>(_self.user!, (value) { + return _then(_self.copyWith(user: value)); + }); +} +} + + +/// Adds pattern-matching-related methods to [VetResponse]. +extension VetResponsePatterns on VetResponse { +/// 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 Function( _VetResponse value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _VetResponse() 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 Function( _VetResponse value) $default,){ +final _that = this; +switch (_that) { +case _VetResponse(): +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? Function( _VetResponse value)? $default,){ +final _that = this; +switch (_that) { +case _VetResponse() 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 Function( UserResponse? user)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _VetResponse() when $default != null: +return $default(_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 Function( UserResponse? user) $default,) {final _that = this; +switch (_that) { +case _VetResponse(): +return $default(_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? Function( UserResponse? user)? $default,) {final _that = this; +switch (_that) { +case _VetResponse() when $default != null: +return $default(_that.user);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _VetResponse implements VetResponse { + const _VetResponse({this.user}); + factory _VetResponse.fromJson(Map json) => _$VetResponseFromJson(json); + +@override final UserResponse? user; + +/// Create a copy of VetResponse +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$VetResponseCopyWith<_VetResponse> get copyWith => __$VetResponseCopyWithImpl<_VetResponse>(this, _$identity); + +@override +Map toJson() { + return _$VetResponseToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _VetResponse&&(identical(other.user, user) || other.user == user)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,user); + +@override +String toString() { + return 'VetResponse(user: $user)'; +} + + +} + +/// @nodoc +abstract mixin class _$VetResponseCopyWith<$Res> implements $VetResponseCopyWith<$Res> { + factory _$VetResponseCopyWith(_VetResponse value, $Res Function(_VetResponse) _then) = __$VetResponseCopyWithImpl; +@override @useResult +$Res call({ + UserResponse? user +}); + + +@override $UserResponseCopyWith<$Res>? get user; + +} +/// @nodoc +class __$VetResponseCopyWithImpl<$Res> + implements _$VetResponseCopyWith<$Res> { + __$VetResponseCopyWithImpl(this._self, this._then); + + final _VetResponse _self; + final $Res Function(_VetResponse) _then; + +/// Create a copy of VetResponse +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? user = freezed,}) { + return _then(_VetResponse( +user: freezed == user ? _self.user : user // ignore: cast_nullable_to_non_nullable +as UserResponse?, + )); +} + +/// Create a copy of VetResponse +/// with the given fields replaced by the non-null parameter values. +@override +@pragma('vm:prefer-inline') +$UserResponseCopyWith<$Res>? get user { + if (_self.user == null) { + return null; + } + + return $UserResponseCopyWith<$Res>(_self.user!, (value) { + return _then(_self.copyWith(user: value)); + }); +} +} + + +/// @nodoc +mixin _$BuyTypeResponse { + + bool? get cash; bool? get credit; +/// Create a copy of BuyTypeResponse +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$BuyTypeResponseCopyWith get copyWith => _$BuyTypeResponseCopyWithImpl(this as BuyTypeResponse, _$identity); + + /// Serializes this BuyTypeResponse to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is BuyTypeResponse&&(identical(other.cash, cash) || other.cash == cash)&&(identical(other.credit, credit) || other.credit == credit)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,cash,credit); + +@override +String toString() { + return 'BuyTypeResponse(cash: $cash, credit: $credit)'; +} + + +} + +/// @nodoc +abstract mixin class $BuyTypeResponseCopyWith<$Res> { + factory $BuyTypeResponseCopyWith(BuyTypeResponse value, $Res Function(BuyTypeResponse) _then) = _$BuyTypeResponseCopyWithImpl; +@useResult +$Res call({ + bool? cash, bool? credit +}); + + + + +} +/// @nodoc +class _$BuyTypeResponseCopyWithImpl<$Res> + implements $BuyTypeResponseCopyWith<$Res> { + _$BuyTypeResponseCopyWithImpl(this._self, this._then); + + final BuyTypeResponse _self; + final $Res Function(BuyTypeResponse) _then; + +/// Create a copy of BuyTypeResponse +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? cash = freezed,Object? credit = freezed,}) { + return _then(_self.copyWith( +cash: freezed == cash ? _self.cash : cash // ignore: cast_nullable_to_non_nullable +as bool?,credit: freezed == credit ? _self.credit : credit // ignore: cast_nullable_to_non_nullable +as bool?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [BuyTypeResponse]. +extension BuyTypeResponsePatterns on BuyTypeResponse { +/// 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 Function( _BuyTypeResponse value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _BuyTypeResponse() 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 Function( _BuyTypeResponse value) $default,){ +final _that = this; +switch (_that) { +case _BuyTypeResponse(): +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? Function( _BuyTypeResponse value)? $default,){ +final _that = this; +switch (_that) { +case _BuyTypeResponse() 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 Function( bool? cash, bool? credit)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _BuyTypeResponse() when $default != null: +return $default(_that.cash,_that.credit);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 Function( bool? cash, bool? credit) $default,) {final _that = this; +switch (_that) { +case _BuyTypeResponse(): +return $default(_that.cash,_that.credit);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? Function( bool? cash, bool? credit)? $default,) {final _that = this; +switch (_that) { +case _BuyTypeResponse() when $default != null: +return $default(_that.cash,_that.credit);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _BuyTypeResponse implements BuyTypeResponse { + const _BuyTypeResponse({this.cash, this.credit}); + factory _BuyTypeResponse.fromJson(Map json) => _$BuyTypeResponseFromJson(json); + +@override final bool? cash; +@override final bool? credit; + +/// Create a copy of BuyTypeResponse +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$BuyTypeResponseCopyWith<_BuyTypeResponse> get copyWith => __$BuyTypeResponseCopyWithImpl<_BuyTypeResponse>(this, _$identity); + +@override +Map toJson() { + return _$BuyTypeResponseToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _BuyTypeResponse&&(identical(other.cash, cash) || other.cash == cash)&&(identical(other.credit, credit) || other.credit == credit)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,cash,credit); + +@override +String toString() { + return 'BuyTypeResponse(cash: $cash, credit: $credit)'; +} + + +} + +/// @nodoc +abstract mixin class _$BuyTypeResponseCopyWith<$Res> implements $BuyTypeResponseCopyWith<$Res> { + factory _$BuyTypeResponseCopyWith(_BuyTypeResponse value, $Res Function(_BuyTypeResponse) _then) = __$BuyTypeResponseCopyWithImpl; +@override @useResult +$Res call({ + bool? cash, bool? credit +}); + + + + +} +/// @nodoc +class __$BuyTypeResponseCopyWithImpl<$Res> + implements _$BuyTypeResponseCopyWith<$Res> { + __$BuyTypeResponseCopyWithImpl(this._self, this._then); + + final _BuyTypeResponse _self; + final $Res Function(_BuyTypeResponse) _then; + +/// Create a copy of BuyTypeResponse +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? cash = freezed,Object? credit = freezed,}) { + return _then(_BuyTypeResponse( +cash: freezed == cash ? _self.cash : cash // ignore: cast_nullable_to_non_nullable +as bool?,credit: freezed == credit ? _self.credit : credit // ignore: cast_nullable_to_non_nullable +as bool?, + )); +} + + +} + + +/// @nodoc +mixin _$WeightTypeResponse { + + bool? get lowWeight; bool? get highWeight; +/// Create a copy of WeightTypeResponse +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$WeightTypeResponseCopyWith get copyWith => _$WeightTypeResponseCopyWithImpl(this as WeightTypeResponse, _$identity); + + /// Serializes this WeightTypeResponse to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is WeightTypeResponse&&(identical(other.lowWeight, lowWeight) || other.lowWeight == lowWeight)&&(identical(other.highWeight, highWeight) || other.highWeight == highWeight)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,lowWeight,highWeight); + +@override +String toString() { + return 'WeightTypeResponse(lowWeight: $lowWeight, highWeight: $highWeight)'; +} + + +} + +/// @nodoc +abstract mixin class $WeightTypeResponseCopyWith<$Res> { + factory $WeightTypeResponseCopyWith(WeightTypeResponse value, $Res Function(WeightTypeResponse) _then) = _$WeightTypeResponseCopyWithImpl; +@useResult +$Res call({ + bool? lowWeight, bool? highWeight +}); + + + + +} +/// @nodoc +class _$WeightTypeResponseCopyWithImpl<$Res> + implements $WeightTypeResponseCopyWith<$Res> { + _$WeightTypeResponseCopyWithImpl(this._self, this._then); + + final WeightTypeResponse _self; + final $Res Function(WeightTypeResponse) _then; + +/// Create a copy of WeightTypeResponse +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? lowWeight = freezed,Object? highWeight = freezed,}) { + return _then(_self.copyWith( +lowWeight: freezed == lowWeight ? _self.lowWeight : lowWeight // ignore: cast_nullable_to_non_nullable +as bool?,highWeight: freezed == highWeight ? _self.highWeight : highWeight // ignore: cast_nullable_to_non_nullable +as bool?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [WeightTypeResponse]. +extension WeightTypeResponsePatterns on WeightTypeResponse { +/// 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 Function( _WeightTypeResponse value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _WeightTypeResponse() 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 Function( _WeightTypeResponse value) $default,){ +final _that = this; +switch (_that) { +case _WeightTypeResponse(): +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? Function( _WeightTypeResponse value)? $default,){ +final _that = this; +switch (_that) { +case _WeightTypeResponse() 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 Function( bool? lowWeight, bool? highWeight)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _WeightTypeResponse() when $default != null: +return $default(_that.lowWeight,_that.highWeight);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 Function( bool? lowWeight, bool? highWeight) $default,) {final _that = this; +switch (_that) { +case _WeightTypeResponse(): +return $default(_that.lowWeight,_that.highWeight);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? Function( bool? lowWeight, bool? highWeight)? $default,) {final _that = this; +switch (_that) { +case _WeightTypeResponse() when $default != null: +return $default(_that.lowWeight,_that.highWeight);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _WeightTypeResponse implements WeightTypeResponse { + const _WeightTypeResponse({this.lowWeight, this.highWeight}); + factory _WeightTypeResponse.fromJson(Map json) => _$WeightTypeResponseFromJson(json); + +@override final bool? lowWeight; +@override final bool? highWeight; + +/// Create a copy of WeightTypeResponse +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$WeightTypeResponseCopyWith<_WeightTypeResponse> get copyWith => __$WeightTypeResponseCopyWithImpl<_WeightTypeResponse>(this, _$identity); + +@override +Map toJson() { + return _$WeightTypeResponseToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _WeightTypeResponse&&(identical(other.lowWeight, lowWeight) || other.lowWeight == lowWeight)&&(identical(other.highWeight, highWeight) || other.highWeight == highWeight)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,lowWeight,highWeight); + +@override +String toString() { + return 'WeightTypeResponse(lowWeight: $lowWeight, highWeight: $highWeight)'; +} + + +} + +/// @nodoc +abstract mixin class _$WeightTypeResponseCopyWith<$Res> implements $WeightTypeResponseCopyWith<$Res> { + factory _$WeightTypeResponseCopyWith(_WeightTypeResponse value, $Res Function(_WeightTypeResponse) _then) = __$WeightTypeResponseCopyWithImpl; +@override @useResult +$Res call({ + bool? lowWeight, bool? highWeight +}); + + + + +} +/// @nodoc +class __$WeightTypeResponseCopyWithImpl<$Res> + implements _$WeightTypeResponseCopyWith<$Res> { + __$WeightTypeResponseCopyWithImpl(this._self, this._then); + + final _WeightTypeResponse _self; + final $Res Function(_WeightTypeResponse) _then; + +/// Create a copy of WeightTypeResponse +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? lowWeight = freezed,Object? highWeight = freezed,}) { + return _then(_WeightTypeResponse( +lowWeight: freezed == lowWeight ? _self.lowWeight : lowWeight // ignore: cast_nullable_to_non_nullable +as bool?,highWeight: freezed == highWeight ? _self.highWeight : highWeight // ignore: cast_nullable_to_non_nullable +as bool?, + )); +} + + +} + + +/// @nodoc +mixin _$RegistrarResponse { + + String? get date; String? get role; String? get fullName; +/// Create a copy of RegistrarResponse +/// with the given fields replaced by the non-null parameter values. +@JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +$RegistrarResponseCopyWith get copyWith => _$RegistrarResponseCopyWithImpl(this as RegistrarResponse, _$identity); + + /// Serializes this RegistrarResponse to a JSON map. + Map toJson(); + + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is RegistrarResponse&&(identical(other.date, date) || other.date == date)&&(identical(other.role, role) || other.role == role)&&(identical(other.fullName, fullName) || other.fullName == fullName)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,date,role,fullName); + +@override +String toString() { + return 'RegistrarResponse(date: $date, role: $role, fullName: $fullName)'; +} + + +} + +/// @nodoc +abstract mixin class $RegistrarResponseCopyWith<$Res> { + factory $RegistrarResponseCopyWith(RegistrarResponse value, $Res Function(RegistrarResponse) _then) = _$RegistrarResponseCopyWithImpl; +@useResult +$Res call({ + String? date, String? role, String? fullName +}); + + + + +} +/// @nodoc +class _$RegistrarResponseCopyWithImpl<$Res> + implements $RegistrarResponseCopyWith<$Res> { + _$RegistrarResponseCopyWithImpl(this._self, this._then); + + final RegistrarResponse _self; + final $Res Function(RegistrarResponse) _then; + +/// Create a copy of RegistrarResponse +/// with the given fields replaced by the non-null parameter values. +@pragma('vm:prefer-inline') @override $Res call({Object? date = freezed,Object? role = freezed,Object? fullName = freezed,}) { + return _then(_self.copyWith( +date: freezed == date ? _self.date : date // ignore: cast_nullable_to_non_nullable +as String?,role: freezed == role ? _self.role : role // ignore: cast_nullable_to_non_nullable +as String?,fullName: freezed == fullName ? _self.fullName : fullName // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + +} + + +/// Adds pattern-matching-related methods to [RegistrarResponse]. +extension RegistrarResponsePatterns on RegistrarResponse { +/// 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 Function( _RegistrarResponse value)? $default,{required TResult orElse(),}){ +final _that = this; +switch (_that) { +case _RegistrarResponse() 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 Function( _RegistrarResponse value) $default,){ +final _that = this; +switch (_that) { +case _RegistrarResponse(): +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? Function( _RegistrarResponse value)? $default,){ +final _that = this; +switch (_that) { +case _RegistrarResponse() 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 Function( String? date, String? role, String? fullName)? $default,{required TResult orElse(),}) {final _that = this; +switch (_that) { +case _RegistrarResponse() when $default != null: +return $default(_that.date,_that.role,_that.fullName);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 Function( String? date, String? role, String? fullName) $default,) {final _that = this; +switch (_that) { +case _RegistrarResponse(): +return $default(_that.date,_that.role,_that.fullName);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? Function( String? date, String? role, String? fullName)? $default,) {final _that = this; +switch (_that) { +case _RegistrarResponse() when $default != null: +return $default(_that.date,_that.role,_that.fullName);case _: + return null; + +} +} + +} + +/// @nodoc +@JsonSerializable() + +class _RegistrarResponse implements RegistrarResponse { + const _RegistrarResponse({this.date, this.role, this.fullName}); + factory _RegistrarResponse.fromJson(Map json) => _$RegistrarResponseFromJson(json); + +@override final String? date; +@override final String? role; +@override final String? fullName; + +/// Create a copy of RegistrarResponse +/// with the given fields replaced by the non-null parameter values. +@override @JsonKey(includeFromJson: false, includeToJson: false) +@pragma('vm:prefer-inline') +_$RegistrarResponseCopyWith<_RegistrarResponse> get copyWith => __$RegistrarResponseCopyWithImpl<_RegistrarResponse>(this, _$identity); + +@override +Map toJson() { + return _$RegistrarResponseToJson(this, ); +} + +@override +bool operator ==(Object other) { + return identical(this, other) || (other.runtimeType == runtimeType&&other is _RegistrarResponse&&(identical(other.date, date) || other.date == date)&&(identical(other.role, role) || other.role == role)&&(identical(other.fullName, fullName) || other.fullName == fullName)); +} + +@JsonKey(includeFromJson: false, includeToJson: false) +@override +int get hashCode => Object.hash(runtimeType,date,role,fullName); + +@override +String toString() { + return 'RegistrarResponse(date: $date, role: $role, fullName: $fullName)'; +} + + +} + +/// @nodoc +abstract mixin class _$RegistrarResponseCopyWith<$Res> implements $RegistrarResponseCopyWith<$Res> { + factory _$RegistrarResponseCopyWith(_RegistrarResponse value, $Res Function(_RegistrarResponse) _then) = __$RegistrarResponseCopyWithImpl; +@override @useResult +$Res call({ + String? date, String? role, String? fullName +}); + + + + +} +/// @nodoc +class __$RegistrarResponseCopyWithImpl<$Res> + implements _$RegistrarResponseCopyWith<$Res> { + __$RegistrarResponseCopyWithImpl(this._self, this._then); + + final _RegistrarResponse _self; + final $Res Function(_RegistrarResponse) _then; + +/// Create a copy of RegistrarResponse +/// with the given fields replaced by the non-null parameter values. +@override @pragma('vm:prefer-inline') $Res call({Object? date = freezed,Object? role = freezed,Object? fullName = freezed,}) { + return _then(_RegistrarResponse( +date: freezed == date ? _self.date : date // ignore: cast_nullable_to_non_nullable +as String?,role: freezed == role ? _self.role : role // ignore: cast_nullable_to_non_nullable +as String?,fullName: freezed == fullName ? _self.fullName : fullName // ignore: cast_nullable_to_non_nullable +as String?, + )); +} + + +} + +// dart format on diff --git a/packages/chicken/lib/data/models/kill_house_module/register_request/response/kill_request_list/kill_request_list.g.dart b/packages/chicken/lib/data/models/kill_house_module/register_request/response/kill_request_list/kill_request_list.g.dart new file mode 100644 index 0000000..f233117 --- /dev/null +++ b/packages/chicken/lib/data/models/kill_house_module/register_request/response/kill_request_list/kill_request_list.g.dart @@ -0,0 +1,209 @@ +// GENERATED CODE - DO NOT MODIFY BY HAND + +part of 'kill_request_list.dart'; + +// ************************************************************************** +// JsonSerializableGenerator +// ************************************************************************** + +_KillRequestList _$KillRequestListFromJson( + Map json, +) => _KillRequestList( + id: (json['id'] as num?)?.toInt(), + killHouse: json['kill_house'] == null + ? null + : KillHouseResponse.fromJson(json['kill_house'] as Map), + killHouseVet: json['kill_house_vet'] == null + ? null + : KillHouseVetResponse.fromJson( + json['kill_house_vet'] as Map, + ), + numberOfAllocated: (json['number_of_allocated'] 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?, + killCapacity: (json['kill_capacity'] as num?)?.toInt(), + previousKillCapacity: (json['previous_kill_capacity'] as num?)?.toInt(), + remainQuantityForPoultry: (json['remain_quantity_for_poultry'] as num?) + ?.toInt(), + remainQuantity: (json['remain_quantity'] as num?)?.toInt(), + reciveTime: json['recive_time'] as String?, + reciveDate: json['recive_date'] as String?, + state: json['state'] as String?, + provinceState: json['province_state'] as String?, + buyType: json['buy_type'] == null + ? null + : BuyTypeResponse.fromJson(json['buy_type'] as Map), + weightType: json['weight_type'] == null + ? null + : WeightTypeResponse.fromJson( + json['weight_type'] as Map, + ), + chickenBreed: json['chicken_breed'] as String?, + indexWeight: (json['index_weight'] as num?)?.toDouble(), + smsPayment: json['sms_payment'] as bool?, + registrar: json['registrar'] == null + ? null + : RegistrarResponse.fromJson(json['registrar'] as Map), +); + +Map _$KillRequestListToJson(_KillRequestList instance) => + { + 'id': instance.id, + 'kill_house': instance.killHouse, + 'kill_house_vet': instance.killHouseVet, + 'number_of_allocated': instance.numberOfAllocated, + 'key': instance.key, + 'create_date': instance.createDate, + 'modify_date': instance.modifyDate, + 'trash': instance.trash, + 'kill_capacity': instance.killCapacity, + 'previous_kill_capacity': instance.previousKillCapacity, + 'remain_quantity_for_poultry': instance.remainQuantityForPoultry, + 'remain_quantity': instance.remainQuantity, + 'recive_time': instance.reciveTime, + 'recive_date': instance.reciveDate, + 'state': instance.state, + 'province_state': instance.provinceState, + 'buy_type': instance.buyType, + 'weight_type': instance.weightType, + 'chicken_breed': instance.chickenBreed, + 'index_weight': instance.indexWeight, + 'sms_payment': instance.smsPayment, + 'registrar': instance.registrar, + }; + +_KillHouseResponse _$KillHouseResponseFromJson(Map json) => + _KillHouseResponse( + killHouseOperator: json['kill_house_operator'] == null + ? null + : KillHouseOperator.fromJson( + json['kill_house_operator'] as Map, + ), + name: json['name'] as String?, + killer: json['killer'] as bool?, + key: json['key'] as String?, + ); + +Map _$KillHouseResponseToJson(_KillHouseResponse instance) => + { + 'kill_house_operator': instance.killHouseOperator, + 'name': instance.name, + 'killer': instance.killer, + 'key': instance.key, + }; + +_KillHouseOperator _$KillHouseOperatorFromJson(Map json) => + _KillHouseOperator( + user: json['user'] == null + ? null + : UserResponse.fromJson(json['user'] as Map), + ); + +Map _$KillHouseOperatorToJson(_KillHouseOperator instance) => + {'user': instance.user}; + +_UserResponse _$UserResponseFromJson(Map json) => + _UserResponse( + fullname: json['fullname'] as String?, + firstName: json['first_name'] as String?, + lastName: json['last_name'] as String?, + mobile: json['mobile'] as String?, + key: json['key'] as String?, + city: json['city'] == null + ? null + : CityResponse.fromJson(json['city'] as Map), + ); + +Map _$UserResponseToJson(_UserResponse instance) => + { + 'fullname': instance.fullname, + 'first_name': instance.firstName, + 'last_name': instance.lastName, + 'mobile': instance.mobile, + 'key': instance.key, + 'city': instance.city, + }; + +_CityResponse _$CityResponseFromJson(Map json) => + _CityResponse( + id: (json['id'] as num?)?.toInt(), + name: json['name'] as String?, + provinceName: json['province_name'] as String?, + ); + +Map _$CityResponseToJson(_CityResponse instance) => + { + 'id': instance.id, + 'name': instance.name, + 'province_name': instance.provinceName, + }; + +_KillHouseVetResponse _$KillHouseVetResponseFromJson( + Map json, +) => _KillHouseVetResponse( + id: (json['id'] as num?)?.toInt(), + vet: json['vet'] == null + ? null + : VetResponse.fromJson(json['vet'] as Map), + killHouse: json['kill_house'] == null + ? null + : KillHouseResponse.fromJson(json['kill_house'] as Map), + key: json['key'] as String?, + trash: json['trash'] as bool?, +); + +Map _$KillHouseVetResponseToJson( + _KillHouseVetResponse instance, +) => { + 'id': instance.id, + 'vet': instance.vet, + 'kill_house': instance.killHouse, + 'key': instance.key, + 'trash': instance.trash, +}; + +_VetResponse _$VetResponseFromJson(Map json) => _VetResponse( + user: json['user'] == null + ? null + : UserResponse.fromJson(json['user'] as Map), +); + +Map _$VetResponseToJson(_VetResponse instance) => + {'user': instance.user}; + +_BuyTypeResponse _$BuyTypeResponseFromJson(Map json) => + _BuyTypeResponse( + cash: json['cash'] as bool?, + credit: json['credit'] as bool?, + ); + +Map _$BuyTypeResponseToJson(_BuyTypeResponse instance) => + {'cash': instance.cash, 'credit': instance.credit}; + +_WeightTypeResponse _$WeightTypeResponseFromJson(Map json) => + _WeightTypeResponse( + lowWeight: json['low_weight'] as bool?, + highWeight: json['high_weight'] as bool?, + ); + +Map _$WeightTypeResponseToJson(_WeightTypeResponse instance) => + { + 'low_weight': instance.lowWeight, + 'high_weight': instance.highWeight, + }; + +_RegistrarResponse _$RegistrarResponseFromJson(Map json) => + _RegistrarResponse( + date: json['date'] as String?, + role: json['role'] as String?, + fullName: json['full_name'] as String?, + ); + +Map _$RegistrarResponseToJson(_RegistrarResponse instance) => + { + 'date': instance.date, + 'role': instance.role, + 'full_name': instance.fullName, + }; diff --git a/packages/chicken/lib/data/models/local/widely_used_local_model.dart b/packages/chicken/lib/data/models/local/widely_used_local_model.dart index 02d89c7..7d6ba38 100644 --- a/packages/chicken/lib/data/models/local/widely_used_local_model.dart +++ b/packages/chicken/lib/data/models/local/widely_used_local_model.dart @@ -1,5 +1,4 @@ import 'package:rasadyar_core/core.dart'; -import 'package:rasadyar_core/utils/utils.dart'; part 'widely_used_local_model.g.dart'; diff --git a/packages/chicken/lib/data/repositories/kill_house/kill_house_repository.dart b/packages/chicken/lib/data/repositories/kill_house/kill_house_repository.dart index e69de29..e6aa2eb 100644 --- a/packages/chicken/lib/data/repositories/kill_house/kill_house_repository.dart +++ b/packages/chicken/lib/data/repositories/kill_house/kill_house_repository.dart @@ -0,0 +1,27 @@ +import 'package:rasadyar_chicken/data/models/kill_house_module/register_request/request/kill_request_response.dart'; +import 'package:rasadyar_chicken/data/models/kill_house_module/register_request/response/chicken_commission_prices/chicken_commission_prices.dart'; +import 'package:rasadyar_chicken/data/models/kill_house_module/register_request/response/kill_house/kill_house_response.dart'; +import 'package:rasadyar_chicken/data/models/kill_house_module/register_request/response/kill_request_list/kill_request_list.dart' + as listModel + show KillRequestList; + +abstract class KillHouseRepository { + Future?> getKillHouseList({ + required String token, + Map? queryParameters, + }); + + Future getCommissionPrice({ + required String token, + Map? queryParameters, + }); + + Future submitKillHouseRequest({required String token, required KillRequestResponse data}); + + Future?> getListKillRequest({ + required String token, + Map? queryParameters, + }); + + Future deleteKillRequest({required String token, required int requestId}); +} diff --git a/packages/chicken/lib/data/repositories/kill_house/kill_house_repository_impl.dart b/packages/chicken/lib/data/repositories/kill_house/kill_house_repository_impl.dart index fdd5bf7..a4ab51e 100644 --- a/packages/chicken/lib/data/repositories/kill_house/kill_house_repository_impl.dart +++ b/packages/chicken/lib/data/repositories/kill_house/kill_house_repository_impl.dart @@ -1,16 +1,58 @@ +import 'package:rasadyar_chicken/data/data_source/remote/kill_house/kill_house_remote.dart'; +import 'package:rasadyar_chicken/data/models/kill_house_module/register_request/request/kill_request_response.dart'; import 'package:rasadyar_chicken/data/models/kill_house_module/register_request/response/chicken_commission_prices/chicken_commission_prices.dart'; import 'package:rasadyar_chicken/data/models/kill_house_module/register_request/response/kill_house/kill_house_response.dart'; +import 'package:rasadyar_chicken/data/models/kill_house_module/register_request/response/kill_request_list/kill_request_list.dart' + as listModel; -abstract class KillHouseRepository { +import 'kill_house_repository.dart'; + +class KillHouseRepositoryImpl extends KillHouseRepository { + final KillHouseRemoteDataSource remoteDataSource; + + KillHouseRepositoryImpl(this.remoteDataSource); + + @override Future?> getKillHouseList({ required String token, Map? queryParameters, - }); + }) async { + return await remoteDataSource.getKillHouseList(token: token, queryParameters: queryParameters); + } + @override Future getCommissionPrice({ required String token, Map? queryParameters, - }); + }) async { + return await remoteDataSource.getCommissionPrice( + token: token, + queryParameters: queryParameters, + ); + } - Future submitKillHouseReport({required String token, required Map data}); + @override + Future submitKillHouseRequest({ + required String token, + required KillRequestResponse data, + }) async { + var jsonData = data.toJson(); + return await remoteDataSource.submitKillHouseRequest(token: token, data: jsonData); + } + + @override + Future?> getListKillRequest({ + required String token, + Map? queryParameters, + }) async { + return await remoteDataSource.getListKillRequest( + token: token, + queryParameters: queryParameters, + ); + } + + @override + Future deleteKillRequest({required String token, required int requestId}) async { + await remoteDataSource.deleteKillRequest(token: token, requestId: requestId); + } } diff --git a/packages/chicken/lib/presentation/pages/common/profile/logic.dart b/packages/chicken/lib/presentation/pages/common/profile/logic.dart index 9da0b72..dc8447b 100644 --- a/packages/chicken/lib/presentation/pages/common/profile/logic.dart +++ b/packages/chicken/lib/presentation/pages/common/profile/logic.dart @@ -37,7 +37,7 @@ class ProfileLogic extends GetxController { GlobalKey formKey = GlobalKey(); ImagePicker imagePicker = ImagePicker(); Rxn selectedImage = Rxn(); - RxnString _base64Image = RxnString(); + final RxnString _base64Image = RxnString(); RxBool isOnLoading = false.obs; RxBool isUserInformationOpen = true.obs; @@ -79,10 +79,6 @@ class ProfileLogic extends GetxController { }); } - @override - void onClose() { - super.onClose(); - } Future getUserProfile() async { userProfile.value = Resource.loading(); diff --git a/packages/chicken/lib/presentation/pages/kill_house/action/logic.dart b/packages/chicken/lib/presentation/pages/kill_house/action/logic.dart index a3ed2ff..774e2ea 100644 --- a/packages/chicken/lib/presentation/pages/kill_house/action/logic.dart +++ b/packages/chicken/lib/presentation/pages/kill_house/action/logic.dart @@ -1,8 +1,13 @@ +import 'package:rasadyar_chicken/presentation/routes/routes.dart'; import 'package:rasadyar_core/core.dart'; class KillHouseActionLogic extends GetxController { List items = [ - GlassMorphismCardItem(title: "ثبت درخواست", icon: Assets.vec.submitRequestSvg.path, route: ''), + GlassMorphismCardItem( + title: "ثبت درخواست", + icon: Assets.vec.submitRequestSvg.path, + route: ChickenRoutes.submitRequestKillHouse, + ), GlassMorphismCardItem( title: "انبار و توزیع", icon: Assets.vec.warehouseDistributionSvg.path, diff --git a/packages/chicken/lib/presentation/pages/kill_house/action/view.dart b/packages/chicken/lib/presentation/pages/kill_house/action/view.dart index 221294f..d47f166 100644 --- a/packages/chicken/lib/presentation/pages/kill_house/action/view.dart +++ b/packages/chicken/lib/presentation/pages/kill_house/action/view.dart @@ -1,4 +1,5 @@ import 'package:flutter/material.dart'; +import 'package:rasadyar_chicken/presentation/utils/nested_keys_utils.dart'; import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart'; import 'package:rasadyar_core/core.dart'; @@ -13,8 +14,8 @@ class KillHouseActionPage extends GetView { isBase: true, child: GlassMorphismGrid( items: controller.items, - onTap: () { - iLog("Hoooooura 😍😍😍😍😍"); + onTap: (item) { + Get.toNamed(item.route, id: killHouseActionKey); }, ), ); diff --git a/packages/chicken/lib/presentation/pages/kill_house/root/logic.dart b/packages/chicken/lib/presentation/pages/kill_house/root/logic.dart index b3d5288..8b551f0 100644 --- a/packages/chicken/lib/presentation/pages/kill_house/root/logic.dart +++ b/packages/chicken/lib/presentation/pages/kill_house/root/logic.dart @@ -1,4 +1,6 @@ import 'package:flutter/material.dart'; +import 'package:rasadyar_chicken/data/di/chicken_di.dart'; +import 'package:rasadyar_chicken/data/repositories/kill_house/kill_house_repository.dart'; import 'package:rasadyar_chicken/presentation/pages/common/profile/view.dart'; import 'package:rasadyar_chicken/presentation/routes/pages.dart'; import 'package:rasadyar_chicken/presentation/routes/routes.dart'; @@ -6,11 +8,21 @@ import 'package:rasadyar_chicken/presentation/utils/nested_keys_utils.dart'; import 'package:rasadyar_core/core.dart'; class KillHouseRootLogic extends GetxController { - RxInt currentPage = 2.obs; + RxInt currentPage = 1.obs; + + var tokenService = Get.find(); + + late KillHouseRepository killHouseRepository; + + @override + void onInit() { + super.onInit(); + killHouseRepository = diChicken.get(); + } final pages = [ Navigator( - key: Get.nestedKey(killHouseFirstKey), + key: Get.nestedKey(killHouseActionKey), onGenerateRoute: (settings) { final page = ChickenPages.pages.firstWhere( (e) => e.name == settings.name, diff --git a/packages/chicken/lib/presentation/pages/kill_house/submit_request/add_request_bottom_sheet.dart b/packages/chicken/lib/presentation/pages/kill_house/submit_request/add_request_bottom_sheet.dart index e69de29..560c5c2 100644 --- a/packages/chicken/lib/presentation/pages/kill_house/submit_request/add_request_bottom_sheet.dart +++ b/packages/chicken/lib/presentation/pages/kill_house/submit_request/add_request_bottom_sheet.dart @@ -0,0 +1,378 @@ +import 'package:flutter/material.dart'; +import 'package:flutter/services.dart'; +import 'package:rasadyar_core/core.dart'; + +import 'logic.dart'; + +Widget addKillRequestBottomSheet(SubmitRequestKillHouseLogic controller) { + return ObxValue( + (data) => AnimatedContainer( + duration: Duration(milliseconds: 300), + height: data.value ? 680.h : 580.h, + child: BaseBottomSheet( + child: Column( + children: [ + Row( + children: [ + SizedBox(width: 12), + Text( + "ثبت درخواست کشتار", + style: AppFonts.yekan18Bold.copyWith(color: AppColor.iconColor), + ), + ], + ), + Divider(), + SizedBox(height: 8), + + InformationTag( + data: InformationTagData( + labelTitle: 'قیمت روز مرغ (${Jalali.now().formatCompactDate()})', + labelTitleStyle: AppFonts.yekan14, + isLoading: false, + height: 40.h, + value: controller.commissionPrices.chickenAveragePrice.separatedByComma.addReal, + valueStyle: AppFonts.yekan14, + borderColor: AppColor.greenNormal, + radiusWidth: 1, + valueBgColor: Colors.white, + labelGradient: LinearGradient( + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + colors: [AppColor.greenLightActive, Colors.white], + ), + ), + ), + SizedBox(height: 12), + ResourceOverlayDropdown( + height: 40.h, + items: controller.killHouseList, + itemBuilder: (item) => Text(item.name ?? 'بدون نام'), + labelBuilder: (selected) => Text(selected?.name ?? 'محل کشتار'), + onChanged: controller.setKillHouse, + ), + + SizedBox(height: 8), + + UnitTextField( + controller: controller.breedCountController, + keyboardType: TextInputType.number, + maxLines: 1, + minLines: 1, + inputFormatters: [FilteringTextInputFormatter.digitsOnly, SeparatorInputFormatter()], + unit: 'قطعه', + hint: 'حجم کشتار', + initialValue: 0.separatedByComma, + ), + + SizedBox(height: 8), + ResourceOverlayDropdown( + items: controller.timeFrameOfKilling, + itemBuilder: (item) => Text(item), + labelBuilder: (selected) => Text(selected ?? 'زمان دریافت'), + onChanged: (selected) => controller.setTimeFrameOfKilling(selected), + ), + + SizedBox(height: 8), + RTextField( + controller: controller.dateOfSlaughterTextEditor, + hintText: 'تاریخ کشتار', + filled: true, + filledColor: AppColor.bgLight, + prefixIcon: Padding( + padding: const EdgeInsets.all(8.0), + child: Assets.vec.calendarSvg.svg( + width: 16.w, + height: 16.h, + colorFilter: ColorFilter.mode(AppColor.bgIcon, BlendMode.srcIn), + ), + ), + readonly: true, + onTap: () { + Get.bottomSheet( + modalDatePicker( + onDateSelected: (value) { + controller.dateOfSlaughterTextEditor.text = value.formatCompactDate(); + controller.dateOfSlaughter = value; + }, + ), + isScrollControlled: true, + isDismissible: true, + ignoreSafeArea: false, + ); + }, + ), + SizedBox(height: 8), + buildAnimatedLabelContainer(controller), + SizedBox(height: 8), + Container( + height: 40.h, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + border: Border.all(color: AppColor.blueDark, width: 0.5), + ), + child: GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () { + if (controller.isAgreedUndertaking.value == false) { + undertakingDialog(controller); + } + else{ + controller.toggleAgreeUndertaking(false); + } + }, + child: Row( + spacing: 2, + children: [ + ObxValue((data) { + return Checkbox( + value: data.value, + onChanged: (value) { + if (controller.isAgreedUndertaking.value == false) { + undertakingDialog(controller); + } + else { + controller.toggleAgreeUndertaking(false); + } + }, + ); + }, controller.isAgreedUndertaking), + + Text( + "با تعهدنامه موافق هستم !", + style: AppFonts.yekan14Bold.copyWith(color: AppColor.blueDark), + ), + ], + ), + ), + ), + SizedBox(height: 8), + Container( + height: 40.h, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + border: Border.all(color: AppColor.mediumGrey, width: 1), + ), + child: GestureDetector( + behavior: HitTestBehavior.opaque, + onTap: () => controller.toggleAgreeSmsNotification(), + child: Row( + spacing: 2, + children: [ + ObxValue((selected) { + return Checkbox( + value: selected.value, + onChanged: (value) => controller.toggleAgreeSmsNotification(), + ); + }, controller.isAgreedSmsNotification), + Text( + "دریافت پیامک اطلاع رسانی", + style: AppFonts.yekan14Bold.copyWith(color: AppColor.textColor2), + ), + ], + ), + ), + ), + SizedBox(height: 16), + Row( + spacing: 16, + mainAxisAlignment: .center, + children: [ + RElevated( + width: 160.w, + height: 40.h, + backgroundColor: AppColor.greenNormal, + text: 'ثبت', + onPressed: () async { + await controller.submitKillRequest(); + }, + ), + + ROutlinedElevated( + height: 40, + text: 'انصراف', + borderColor: AppColor.redNormal, + onPressed: () { + Get.back(); + }, + ), + ], + ), + ], + ), + ), + ), + controller.isBreedWeightSelected, + ); +} + +void undertakingDialog(SubmitRequestKillHouseLogic controller) { + Get.dialog( + AlertDialog( + title: Text("تعهد نامه", textAlign: TextAlign.center), + titleTextStyle: AppFonts.yekan20.copyWith(color: AppColor.textColor3), + content: Column( + mainAxisSize: .min, + spacing: 10, + children: [ + Text( + "اینجانب ${controller.baseLogic.userProfile.value.data?.fullname} موافقت خود را نسبت به موارد ذکر شده اعلام می نمایم.", + style: AppFonts.yekan13.copyWith(color: AppColor.textColor3), + ), + Text( + "✅ بر اساس این توافق نامه در صورت لغو کشتار جریمه خواهم شد.", + style: AppFonts.yekan13.copyWith(color: AppColor.textColor3), + ), + ], + ), + actions: [ + Row( + spacing: 10, + children: [ + Expanded( + child: RElevated( + text: 'موافقم', + height: 32.h, + onPressed: () { + controller.toggleAgreeUndertaking(true); + Get.back(); + }, + textStyle: AppFonts.yekan20Bold.copyWith(color: Colors.white), + backgroundColor: AppColor.greenNormal, + ), + ), + Expanded( + child: ROutlinedElevated( + text: 'رد', + textStyle: AppFonts.yekan20.copyWith(color: AppColor.redNormal), + height: 32.h, + onPressed: () { + controller.toggleAgreeUndertaking(false); + Get.back(); + }, + borderColor: AppColor.redNormal, + ), + ), + ], + ), + ], + ), + ); +} + +Widget buildAnimatedLabelContainer(SubmitRequestKillHouseLogic controller) { + return ObxValue((data) { + return AnimatedCrossFade( + firstChild: GestureDetector( + onTap: () { + controller.toggleBreedWeightSelection(); + }, + child: Container( + height: 40.h, + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + border: Border.all(color: AppColor.mediumGrey, width: 0.5), + ), + child: Row( + spacing: 7, + children: [ + Directionality( + textDirection: TextDirection.ltr, + child: Switch( + value: data.value, + onChanged: (data) => controller.toggleBreedWeightSelection(), + ), + ), + Text( + "تعیین نژاد / وزن مرغ", + style: AppFonts.yekan14Bold.copyWith(color: AppColor.textColor2), + ), + ], + ), + ), + ), + secondChild: SizedBox( + height: 140.h, + child: Stack( + fit: StackFit.passthrough, + children: [ + Positioned( + bottom: 0, + left: 0, + right: 0, + child: Container( + height: 121.h, + padding: EdgeInsets.fromLTRB(8.r, 18.r, 8.r, 8.r), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + border: Border.all(color: AppColor.mediumGrey, width: (0.5).w), + ), + child: Column( + spacing: 8, + children: [ + ResourceOverlayDropdown( + items: controller.chickenBreedList, + itemBuilder: (item) => Text(item), + labelBuilder: (selected) => Text(selected ?? 'نژاد مرغ'), + onChanged: (selected) => controller.setChickenBreed(selected), + ), + + RTextField( + controller: controller.chickenWeight, + label: ' وزن مرغ (کیلوگرم) ', + filled: true, + filledColor: AppColor.bgLight, + keyboardType: TextInputType.number, + inputFormatters: [ + FilteringTextInputFormatter.digitsOnly, + SeparatorInputFormatter(), + ], + ), + ], + ), + ), + ), + Positioned( + top: 0, + right: 7, + child: GestureDetector( + onTap: () { + controller.toggleBreedWeightSelection(); + }, + child: Container( + height: 30.h, + padding: EdgeInsets.symmetric(horizontal: 4.w, vertical: 4.h), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + border: Border.all(color: AppColor.mediumGrey, width: 0.5), + ), + child: Row( + spacing: 7, + children: [ + Directionality( + textDirection: TextDirection.ltr, + child: FittedBox( + fit: BoxFit.scaleDown, + child: Switch( + value: data.value, + onChanged: (_) => controller.toggleBreedWeightSelection(), + ), + ), + ), + Text( + "تعیین نژاد / وزن مرغ", + style: AppFonts.yekan14Bold.copyWith(color: AppColor.textColor2), + ), + ], + ), + ), + ), + ), + ], + ), + ), + crossFadeState: data.value ? CrossFadeState.showSecond : CrossFadeState.showFirst, + duration: Duration(milliseconds: 500), + ); + }, controller.isBreedWeightSelected); +} diff --git a/packages/chicken/lib/presentation/pages/kill_house/submit_request/logic.dart b/packages/chicken/lib/presentation/pages/kill_house/submit_request/logic.dart new file mode 100644 index 0000000..9787110 --- /dev/null +++ b/packages/chicken/lib/presentation/pages/kill_house/submit_request/logic.dart @@ -0,0 +1,225 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_chicken/data/models/kill_house_module/register_request/request/kill_request_response.dart'; +import 'package:rasadyar_chicken/data/models/kill_house_module/register_request/response/chicken_commission_prices/chicken_commission_prices.dart'; +import 'package:rasadyar_chicken/data/models/kill_house_module/register_request/response/kill_house/kill_house_response.dart'; +import 'package:rasadyar_chicken/data/models/kill_house_module/register_request/response/kill_request_list/kill_request_list.dart' + as listModel; +import 'package:rasadyar_chicken/presentation/pages/kill_house/root/logic.dart'; +import 'package:rasadyar_chicken/presentation/widget/base_page/logic.dart'; +import 'package:rasadyar_core/core.dart'; + +class SubmitRequestKillHouseLogic extends GetxController { + ChickenBaseLogic baseLogic = Get.find(); + RxList routesName = ["عملیات", "ثبت درخواست کشتار"].obs; + late KillHouseRootLogic rootLogic; + + RxInt expandedItemIndex = RxInt(-1); + Rx fromDateFilter = Jalali.now().obs; + Rx toDateFilter = Jalali.now().obs; + RxnString searchedValue = RxnString(); + + RxBool isBreedWeightSelected = false.obs; + + TextEditingController breedCountController = TextEditingController(); + TextEditingController dateOfSlaughterTextEditor = TextEditingController(); + Jalali dateOfSlaughter = Jalali.now(); + TextEditingController chickenWeight = TextEditingController(); + + Resource> timeFrameOfKilling = Resource.success([ + '12 - 14', + '14 - 16', + '16 - 18', + '18 - 20', + '20 - 22', + '22 - 24', + ]); + + RxString timeFrameOfKillingSelected = ''.obs; + + Resource> chickenBreedList = Resource.success([ + 'آرین', + 'راس', + 'آربراکوز (آیلاس)', + 'کاب', + 'هوبارد', + 'ترکیبی', + 'وارداتی', + ]); + + RxString chickenBreedSelected = ''.obs; + RxBool isAgreedUndertaking = false.obs; + RxBool isAgreedSmsNotification = false.obs; + + KillHouseResponse? selectedKillHouse; + late Resource> killHouseList; + late ChickenCommissionPrices commissionPrices; + + Rx>> killRequestList = Rx( + Resource.initial(), + ); + + @override + void onInit() { + super.onInit(); + rootLogic = Get.find(); + + getCommissionPrice(); + getKillHouseList(); + getListOfKillRequests(); + dateOfSlaughterTextEditor.text = Jalali.now().formatCompactDate(); + dateOfSlaughter = Jalali.now(); + chickenWeight.text = '2.7'; + } + + @override + void onClose() { + // TODO: implement onClose + super.onClose(); + } + + void onRefresh() { + getCommissionPrice(); + getKillHouseList(); + getListOfKillRequests(); + } + + void toggleExpandedItem(int index) { + if (expandedItemIndex.value == index) { + expandedItemIndex.value = -1; + } else { + expandedItemIndex.value = index; + } + } + + void toggleBreedWeightSelection() { + isBreedWeightSelected.value = !isBreedWeightSelected.value; + } + + void clearPage() { + expandedItemIndex.value = -1; + isBreedWeightSelected.value = false; + isAgreedUndertaking.value = false; + isAgreedSmsNotification.value = false; + breedCountController.clear(); + dateOfSlaughter = Jalali.now(); + dateOfSlaughterTextEditor.text = Jalali.now().formatCompactDate(); + chickenWeight.text = '2.7'; + timeFrameOfKillingSelected.value = ''; + chickenBreedSelected.value = ''; + } + + void setKillHouse(KillHouseResponse killHouse) { + selectedKillHouse = killHouse; + iLog(selectedKillHouse?.key); + } + + void setTimeFrameOfKilling(String timeFrame) { + timeFrameOfKillingSelected.value = timeFrame; + } + + void setChickenBreed(String breed) { + chickenBreedSelected.value = breed; + } + + void toggleAgreeUndertaking(bool item) { + isAgreedUndertaking.value = item; + } + + void toggleAgreeSmsNotification() { + isAgreedSmsNotification.value = !isAgreedSmsNotification.value; + } + + Future getKillHouseList() async { + await safeCall( + call: () => rootLogic.killHouseRepository.getKillHouseList( + token: rootLogic.tokenService.accessToken.value ?? '', + ), + onSuccess: (result) => killHouseList = Resource.success(result ?? []), + ); + } + + Future getCommissionPrice() async { + await safeCall( + call: () => rootLogic.killHouseRepository.getCommissionPrice( + token: rootLogic.tokenService.accessToken.value ?? '', + ), + onSuccess: (result) => commissionPrices = + result ?? ChickenCommissionPrices(chickenAveragePrice: 0), + ); + } + + Future submitKillRequest() async { + KillRequestResponse request = KillRequestResponse( + killCapacity: int.parse(breedCountController.text), + reciveTime: timeFrameOfKillingSelected.value, + reciveDate: dateOfSlaughter + .toDateTime() + .formattedGregorianDateWithoutMillisecond, + lowWeight: false, + highWeight: false, + indexWeight: double.parse(chickenWeight.text), + chickenBreed: chickenBreedSelected.value, + cash: true, + credit: false, + smsPayment: isAgreedSmsNotification.value, + killHouseKey: selectedKillHouse?.key, + killerKillHouseKey: null, + role: 'KillHouse', + ); + await safeCall( + showError: true, + + call: () => rootLogic.killHouseRepository.submitKillHouseRequest( + token: rootLogic.tokenService.accessToken.value ?? '', + data: request, + ), + onSuccess: (result) { + onRefresh(); + Get.back(); + Future.delayed( + Duration(seconds: 3), + () => defaultShowSuccessMessage("عملیات با موفقیت انجام شد"), + ); + }, + ); + } + + Future getListOfKillRequests() async { + await safeCall( + showError: true, + call: () => rootLogic.killHouseRepository.getListKillRequest( + token: rootLogic.tokenService.accessToken.value ?? '', + queryParameters: buildRawQueryParams( + role: 'KillHouse', + fromDate: fromDateFilter.value.toDateTime(), + toDate: toDateFilter.value.toDateTime(), + ), + ), + onSuccess: (result) { + if (result == null || result.isEmpty) { + killRequestList.value = Resource.empty(); + return; + } + killRequestList.value = Resource.success(result); + }, + onError: (error, stackTrace) { + killRequestList.value = Resource.error(error); + }, + ); + } + + Future deleteRequest(int id) async { + await safeCall( + showError: true, + + call: () => rootLogic.killHouseRepository.deleteKillRequest( + token: rootLogic.tokenService.accessToken.value ?? '', + requestId: id, + ), + onSuccess: (result) { + onRefresh(); + Get.back(); + }, + ); + } +} diff --git a/packages/chicken/lib/presentation/pages/kill_house/submit_request/view.dart b/packages/chicken/lib/presentation/pages/kill_house/submit_request/view.dart new file mode 100644 index 0000000..18bc36f --- /dev/null +++ b/packages/chicken/lib/presentation/pages/kill_house/submit_request/view.dart @@ -0,0 +1,232 @@ +import 'package:flutter/material.dart'; +import 'package:rasadyar_chicken/data/models/kill_house_module/register_request/response/kill_request_list/kill_request_list.dart' + as listModel + show KillRequestList; +import 'package:rasadyar_chicken/presentation/utils/nested_keys_utils.dart'; +import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart'; +import 'package:rasadyar_core/core.dart'; + +import 'add_request_bottom_sheet.dart'; +import 'logic.dart'; + +class SubmitRequestKillHousePage extends GetView { + const SubmitRequestKillHousePage({super.key}); + + @override + Widget build(BuildContext context) { + return ChickenBasePage( + hasBack: true, + hasFilter: true, + hasSearch: true, + onBackTap: () => Get.back(id: killHouseActionKey), + onSearchChanged: (data) { + //Todo + }, + onRefresh: () async => controller.onRefresh(), + routesWidget: ContainerBreadcrumb(rxRoutes: controller.routesName), + child: Stack( + fit: .expand, + children: [ + Positioned.fill( + right: 13, + left: 14, + child: Obx(() { + return RListView.separated( + itemCount: controller.killRequestList.value.data?.length ?? 0, + itemBuilder: (context, index) { + var item = controller.killRequestList.value.data![index]; + return ObxValue((data) { + return ExpandableListItem2( + index: index, + child: itemListWidget(item), + secondChild: itemListExpandedWidget(item), + onTap: () => controller.toggleExpandedItem(index), + selected: data.value == index, + labelColor: AppColor.blueLight, + labelIcon: Assets.vec.virtualSvg.path, + ); + }, controller.expandedItemIndex); + }, + separatorBuilder: (context, index) => SizedBox(height: 8), + resource: controller.killRequestList.value, + ); + }), + ), + + Positioned( + right: 8, + bottom: 92, + child: RFab.add( + onPressed: () { + Get.bottomSheet( + isScrollControlled: true, + addKillRequestBottomSheet(controller), + ).then((value) { + controller.clearPage(); + }); + }, + ), + ), + ], + ), + ); + } + + Row itemListWidget(listModel.KillRequestList item) { + return Row( + children: [ + SizedBox(width: 30), + Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + item.killHouse?.name ?? 'بدون نام', + style: AppFonts.yekan14Bold.copyWith(color: AppColor.blueNormal), + ), + SizedBox(height: 4), + Text( + item.createDate?.toJalali.formatCompactDate() ?? "-", + style: AppFonts.yekan14.copyWith(color: AppColor.bgDark), + ), + ], + ), + Spacer(), + Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + 'درخواست ${item.killCapacity}'.addCountEXT, + style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal), + ), + SizedBox(height: 4), + Text( + 'تعداد مورد تایید 150 قطعه', + style: AppFonts.yekan14.copyWith(color: AppColor.bgDark), + ), + ], + ), + + Spacer(), + Assets.vec.scanSvg.svg( + width: 32.w, + height: 32.h, + colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn), + ), + SizedBox(width: 12), + ], + ); + } + + Container itemListExpandedWidget(listModel.KillRequestList item) { + Jalali date = item.createDate.toJalali; + return Container( + padding: EdgeInsets.symmetric(horizontal: 8), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + ), + child: Column( + spacing: 8, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text( + item.killHouse?.name ?? 'بدون نام', + textAlign: TextAlign.center, + style: AppFonts.yekan16.copyWith(color: AppColor.greenDark), + ), + Spacer(), + //todo + Text( + 'در انتظار تایید استان', + textAlign: TextAlign.center, + style: AppFonts.yekan10.copyWith(color: AppColor.darkGreyDark), + ), + SizedBox(width: 7), + Assets.vec.clockSvg.svg(width: 16.w, height: 16.h), + ], + ), + Container( + height: 32, + padding: EdgeInsets.symmetric(horizontal: 8), + decoration: ShapeDecoration( + color: AppColor.blueLight, + shape: RoundedRectangleBorder( + side: BorderSide(width: 1, color: AppColor.blueLightHover), + borderRadius: BorderRadius.circular(8), + ), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Row( + spacing: 3, + children: [ + Text( + date.formatter.wN, + style: AppFonts.yekan14.copyWith( + color: AppColor.textColor, + ), + ), + + Text( + '${date.formatter.d} ${date.formatter.mN ?? 'N/A'}', + style: AppFonts.yekan14.copyWith( + color: AppColor.blueNormal, + ), + ), + ], + ), + + Text( + date.formatter.y, + style: AppFonts.yekan20.copyWith(color: AppColor.textColor), + ), + + Text( + '${date.formatter.tHH}:${date.formatter.tMM ?? 'N/A'}', + style: AppFonts.yekan14.copyWith(color: AppColor.textColor), + ), + ], + ), + ), + + buildRow( + title: 'تعداد درخواست اولیه', + value: item.killCapacity.separatedByComma.addCountEXT, + ), + //todo + buildRow( + title: 'تعداد مورد تایید', + value: item.numberOfAllocated.separatedByComma.addCountEXT, + ), + buildRow(title: 'زمان دریافت', value: item.reciveTime ?? '-'), + buildRow( + title: 'تاریخ درخواستی کشتار', + value: item.reciveDate.toJalali.formatCompactDate(), + ), + ROutlinedElevated( + text: 'حذف', + height: 40.h, + textStyle: AppFonts.yekan20.copyWith(color: AppColor.redNormal), + isFullWidth: true, + onPressed: () { + buildWarningDialog( + title: 'اخطار', + middleText: 'آیا از حذف شدن این مورد اطمینان دارید؟', + onConfirm: () async { + controller.deleteRequest(item.id!); + }, + onRefresh: () async { + controller.onRefresh(); + }, + ); + }, + borderColor: AppColor.redNormal, + ), + ], + ), + ); + } +} diff --git a/packages/chicken/lib/presentation/pages/poultry_farm_inspection/home/logic.dart b/packages/chicken/lib/presentation/pages/poultry_farm_inspection/home/logic.dart index ac81519..9b7757a 100644 --- a/packages/chicken/lib/presentation/pages/poultry_farm_inspection/home/logic.dart +++ b/packages/chicken/lib/presentation/pages/poultry_farm_inspection/home/logic.dart @@ -1,7 +1,6 @@ import 'package:flutter/material.dart'; import 'package:rasadyar_core/core.dart'; -import '../widgets/step1_page.dart'; class PoultryFarmInspectionHomeLogic extends GetxController with GetTickerProviderStateMixin { diff --git a/packages/chicken/lib/presentation/pages/poultry_science/root/logic.dart b/packages/chicken/lib/presentation/pages/poultry_science/root/logic.dart index c12b9c0..811d2d3 100644 --- a/packages/chicken/lib/presentation/pages/poultry_science/root/logic.dart +++ b/packages/chicken/lib/presentation/pages/poultry_science/root/logic.dart @@ -49,10 +49,6 @@ class PoultryScienceRootLogic extends GetxController { poultryRepository = diChicken.get(); } - @override - void onClose() { - super.onClose(); - } void toggleExpanded(int index) { if (homeExpandedList.keys.contains(index)) { diff --git a/packages/chicken/lib/presentation/pages/steward/buy/logic.dart b/packages/chicken/lib/presentation/pages/steward/buy/logic.dart index 3b7dc5e..61ae021 100644 --- a/packages/chicken/lib/presentation/pages/steward/buy/logic.dart +++ b/packages/chicken/lib/presentation/pages/steward/buy/logic.dart @@ -5,10 +5,6 @@ class BuyLogic extends GetxController { List routesName = ['خرید']; DateTime? _lastBackPressed; - @override - void onInit() { - super.onInit(); - } @override void onReady() { diff --git a/packages/chicken/lib/presentation/pages/steward/buy_in_province_all/view.dart b/packages/chicken/lib/presentation/pages/steward/buy_in_province_all/view.dart index 900ea8b..609ee56 100644 --- a/packages/chicken/lib/presentation/pages/steward/buy_in_province_all/view.dart +++ b/packages/chicken/lib/presentation/pages/steward/buy_in_province_all/view.dart @@ -133,7 +133,7 @@ class BuyInProvinceAllPage extends GetView { ), Spacer(), Text( - item.receiverState?.faItem, + item.receiverState?.faItem ?? 'N/A', textAlign: TextAlign.center, style: AppFonts.yekan10.copyWith(color: AppColor.darkGreyDark), ), diff --git a/packages/chicken/lib/presentation/pages/steward/buy_out_of_province/logic.dart b/packages/chicken/lib/presentation/pages/steward/buy_out_of_province/logic.dart index 52e0a59..e465673 100644 --- a/packages/chicken/lib/presentation/pages/steward/buy_out_of_province/logic.dart +++ b/packages/chicken/lib/presentation/pages/steward/buy_out_of_province/logic.dart @@ -29,7 +29,7 @@ class BuyOutOfProvinceLogic extends GetxController { Rxn selectedProvince = Rxn(); Rxn selectedCity = Rxn(); Rxn selectedImage = Rxn(); - RxnString _base64Image = RxnString(); + final RxnString _base64Image = RxnString(); RxnString editImageUrl = RxnString(); RxnString editFreeBarKey = RxnString(); diff --git a/packages/chicken/lib/presentation/pages/steward/sales_in_province/logic.dart b/packages/chicken/lib/presentation/pages/steward/sales_in_province/logic.dart index 3958640..9ef9ed9 100644 --- a/packages/chicken/lib/presentation/pages/steward/sales_in_province/logic.dart +++ b/packages/chicken/lib/presentation/pages/steward/sales_in_province/logic.dart @@ -464,7 +464,7 @@ class SalesInProvinceLogic extends GetxController { } Steward? getBuyerInformation(AllocatedMadeModel model) { - if (model.allocationType?.buyerIsGuild) { + if (model.allocationType?.buyerIsGuild ?? false) { return model.toGuilds; } else { return model.steward; diff --git a/packages/chicken/lib/presentation/pages/steward/sales_out_of_province/view.dart b/packages/chicken/lib/presentation/pages/steward/sales_out_of_province/view.dart index 5db4b13..9ece4a9 100644 --- a/packages/chicken/lib/presentation/pages/steward/sales_out_of_province/view.dart +++ b/packages/chicken/lib/presentation/pages/steward/sales_out_of_province/view.dart @@ -111,7 +111,7 @@ class SalesOutOfProvincePage extends GetView { onSubmit: () => controller.submitFilter(), ); - itemListWidget(StewardFreeSaleBar item) { + Row itemListWidget(StewardFreeSaleBar item) { return Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ @@ -182,7 +182,7 @@ class SalesOutOfProvincePage extends GetView { ); } - itemListExpandedWidget(StewardFreeSaleBar item, int index) { + Container itemListExpandedWidget(StewardFreeSaleBar item, int index) { return Container( padding: EdgeInsets.symmetric(horizontal: 8), decoration: BoxDecoration( diff --git a/packages/chicken/lib/presentation/pages/steward/sales_out_of_province_buyers/view.dart b/packages/chicken/lib/presentation/pages/steward/sales_out_of_province_buyers/view.dart index 61c3de0..6bd61f9 100644 --- a/packages/chicken/lib/presentation/pages/steward/sales_out_of_province_buyers/view.dart +++ b/packages/chicken/lib/presentation/pages/steward/sales_out_of_province_buyers/view.dart @@ -277,7 +277,7 @@ class SalesOutOfProvinceBuyersPage extends GetView { onSubmit: () => controller.getAllSegmentation(), ); - itemListWidget(SegmentationModel item) { + Row itemListWidget(SegmentationModel item) { return Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, children: [ @@ -160,7 +160,7 @@ class SegmentationPage extends GetView { ); } - itemListExpandedWidget(SegmentationModel item, int index) { + Container itemListExpandedWidget(SegmentationModel item, int index) { return Container( padding: EdgeInsets.symmetric(horizontal: 8), decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(8)), diff --git a/packages/chicken/lib/presentation/routes/pages.dart b/packages/chicken/lib/presentation/routes/pages.dart index 2379288..77f4ef4 100644 --- a/packages/chicken/lib/presentation/routes/pages.dart +++ b/packages/chicken/lib/presentation/routes/pages.dart @@ -6,6 +6,8 @@ import 'package:rasadyar_chicken/presentation/pages/kill_house/action/logic.dart import 'package:rasadyar_chicken/presentation/pages/kill_house/action/view.dart'; import 'package:rasadyar_chicken/presentation/pages/kill_house/root/logic.dart'; import 'package:rasadyar_chicken/presentation/pages/kill_house/root/view.dart'; +import 'package:rasadyar_chicken/presentation/pages/kill_house/submit_request/logic.dart'; +import 'package:rasadyar_chicken/presentation/pages/kill_house/submit_request/view.dart'; import 'package:rasadyar_chicken/presentation/pages/poultry_farm_inspection/poultry_farm_inspection.dart'; import 'package:rasadyar_chicken/presentation/pages/poultry_science/active_hatching/logic.dart'; import 'package:rasadyar_chicken/presentation/pages/poultry_science/active_hatching/view.dart'; @@ -25,6 +27,7 @@ import 'package:rasadyar_chicken/presentation/pages/poultry_science/root/view.da import 'package:rasadyar_chicken/presentation/pages/steward/steward.dart'; import 'package:rasadyar_chicken/presentation/routes/global_binding.dart'; import 'package:rasadyar_chicken/presentation/routes/routes.dart'; +import 'package:rasadyar_chicken/presentation/widget/base_page/logic.dart'; import 'package:rasadyar_chicken/presentation/widget/captcha/logic.dart'; import 'package:rasadyar_core/core.dart'; @@ -38,7 +41,7 @@ sealed class ChickenPages { binding: BindingsBuilder(() { Get.lazyPut(() => AuthLogic()); Get.lazyPut(() => CaptchaWidgetLogic()); - Get.lazyPut(() => BaseLogic(), fenix: true); + Get.lazyPut(() => ChickenBaseLogic(), fenix: true); }), ), @@ -47,7 +50,7 @@ sealed class ChickenPages { page: () => RolePage(), binding: BindingsBuilder(() { Get.lazyPut(() => RoleLogic()); - Get.lazyPut(() => BaseLogic(), fenix: true); + Get.lazyPut(() => ChickenBaseLogic(), fenix: true); }), ), @@ -59,7 +62,7 @@ sealed class ChickenPages { bindings: [ GlobalBinding(), BindingsBuilder(() { - Get.lazyPut(() => BaseLogic(), fenix: true); + Get.lazyPut(() => ChickenBaseLogic(), fenix: true); Get.lazyPut(() => StewardRootLogic()); Get.lazyPut(() => HomeLogic()); Get.lazyPut(() => BuyLogic()); @@ -75,7 +78,7 @@ sealed class ChickenPages { middlewares: [AuthMiddleware()], binding: BindingsBuilder(() { Get.put(HomeLogic()); - Get.lazyPut(() => BaseLogic()); + Get.lazyPut(() => ChickenBaseLogic()); }), ), @@ -86,7 +89,7 @@ sealed class ChickenPages { middlewares: [AuthMiddleware()], binding: BindingsBuilder(() { Get.lazyPut(() => SaleLogic()); - Get.lazyPut(() => BaseLogic()); + Get.lazyPut(() => ChickenBaseLogic()); Get.lazyPut(() => SalesOutOfProvinceLogic()); Get.lazyPut(() => SalesOutOfProvinceBuyersLogic()); Get.lazyPut(() => StewardRootLogic()); @@ -117,7 +120,7 @@ sealed class ChickenPages { page: () => SalesInProvincePage(), middlewares: [AuthMiddleware()], binding: BindingsBuilder(() { - Get.lazyPut(() => BaseLogic()); + Get.lazyPut(() => ChickenBaseLogic()); Get.lazyPut(() => SalesInProvinceLogic()); }), ), @@ -128,7 +131,7 @@ sealed class ChickenPages { page: () => BuyPage(), middlewares: [AuthMiddleware()], binding: BindingsBuilder(() { - Get.lazyPut(() => BaseLogic()); + Get.lazyPut(() => ChickenBaseLogic()); Get.lazyPut(() => BuyLogic()); }), ), @@ -137,7 +140,7 @@ sealed class ChickenPages { page: () => BuyOutOfProvincePage(), middlewares: [AuthMiddleware()], binding: BindingsBuilder(() { - Get.lazyPut(() => BaseLogic()); + Get.lazyPut(() => ChickenBaseLogic()); Get.lazyPut(() => BuyOutOfProvinceLogic()); }), ), @@ -146,7 +149,7 @@ sealed class ChickenPages { page: () => BuyInProvincePage(), middlewares: [AuthMiddleware()], binding: BindingsBuilder(() { - Get.lazyPut(() => BaseLogic()); + Get.lazyPut(() => ChickenBaseLogic()); Get.lazyPut(() => BuyInProvinceLogic()); Get.lazyPut(() => BuyInProvinceWaitingLogic()); Get.lazyPut(() => BuyInProvinceAllLogic()); @@ -234,7 +237,7 @@ sealed class ChickenPages { page: () => PoultryFarmInspectionHomePage(), binding: BindingsBuilder(() { Get.lazyPut(() => PoultryFarmInspectionHomeLogic()); - Get.lazyPut(() => BaseLogic(), fenix: true); + Get.lazyPut(() => ChickenBaseLogic(), fenix: true); }), ), //endregion @@ -245,7 +248,7 @@ sealed class ChickenPages { page: () => KillHouseRootPage(), binding: BindingsBuilder(() { Get.lazyPut(() => KillHouseRootLogic()); - Get.lazyPut(() => BaseLogic(), fenix: true); + Get.lazyPut(() => ChickenBaseLogic(), fenix: true); }), ), GetPage( @@ -255,7 +258,19 @@ sealed class ChickenPages { GlobalBinding(), BindingsBuilder(() { Get.lazyPut(() => KillHouseActionLogic()); - Get.lazyPut(() => BaseLogic(), fenix: true); + Get.lazyPut(() => ChickenBaseLogic(), fenix: true); + }), + ], + ), + + GetPage( + name: ChickenRoutes.submitRequestKillHouse, + page: () => SubmitRequestKillHousePage(), + bindings: [ + GlobalBinding(), + BindingsBuilder(() { + Get.lazyPut(() => SubmitRequestKillHouseLogic()); + Get.lazyPut(() => ChickenBaseLogic(), fenix: true); }), ], ), diff --git a/packages/chicken/lib/presentation/routes/routes.dart b/packages/chicken/lib/presentation/routes/routes.dart index 58c7414..3e56af0 100644 --- a/packages/chicken/lib/presentation/routes/routes.dart +++ b/packages/chicken/lib/presentation/routes/routes.dart @@ -48,6 +48,7 @@ sealed class ChickenRoutes { static const _killHouse = '$_base/killHouse'; static const initKillHouse = '$_killHouse/home'; static const actionKillHouse = '$_killHouse/action'; + static const submitRequestKillHouse = '$actionKillHouse/submitRequest'; //endregion } diff --git a/packages/chicken/lib/presentation/utils/nested_keys_utils.dart b/packages/chicken/lib/presentation/utils/nested_keys_utils.dart index d816541..df770c2 100644 --- a/packages/chicken/lib/presentation/utils/nested_keys_utils.dart +++ b/packages/chicken/lib/presentation/utils/nested_keys_utils.dart @@ -13,6 +13,6 @@ const int poultryThirdKey = 107; //endregion //region kill house Keys -const int killHouseFirstKey = 108; +const int killHouseActionKey = 108; //endregion diff --git a/packages/chicken/lib/presentation/utils/string_utils.dart b/packages/chicken/lib/presentation/utils/string_utils.dart index 68c0976..c3d21c3 100644 --- a/packages/chicken/lib/presentation/utils/string_utils.dart +++ b/packages/chicken/lib/presentation/utils/string_utils.dart @@ -1,5 +1,5 @@ extension XStringUtils on String { - get faAllocationType { + String get faAllocationType { final tmp = split('_'); tmp.insert(1, '_'); if (tmp.length > 1) { @@ -9,9 +9,9 @@ extension XStringUtils on String { } } - get faItem => utilsMap[this] ?? this; + String get faItem => utilsMap[this] ?? this; - get buyerIsGuild { + bool get buyerIsGuild { final tmp = split('_'); if (tmp.length > 1) { return tmp.last == 'guild'; diff --git a/packages/chicken/lib/presentation/widget/base_page/logic.dart b/packages/chicken/lib/presentation/widget/base_page/logic.dart index e69de29..1c63f60 100644 --- a/packages/chicken/lib/presentation/widget/base_page/logic.dart +++ b/packages/chicken/lib/presentation/widget/base_page/logic.dart @@ -0,0 +1,32 @@ +import 'package:rasadyar_chicken/data/di/chicken_di.dart'; +import 'package:rasadyar_chicken/data/repositories/chicken/chicken_repository.dart'; +import 'package:rasadyar_core/core.dart'; + +import '../../../data/models/response/user_profile/user_profile.dart'; + +class ChickenBaseLogic extends BasePageLogic { + var tokenService = Get.find(); + ChickenRepository chickenRepository = diChicken.get(); + + Rx> userProfile = Rx>(Resource.loading()); + + @override + void onInit() { + super.onInit(); + getUserProfile(); + } + + Future getUserProfile() async { + userProfile.value = Resource.loading(); + await safeCall( + call: () async => + await chickenRepository.getUserProfile(token: tokenService.accessToken.value!), + onSuccess: (result) { + if (result != null) { + userProfile.value = Resource.success(result); + } + }, + onError: (error, stackTrace) {}, + ); + } +} diff --git a/packages/chicken/lib/presentation/widget/base_page/view.dart b/packages/chicken/lib/presentation/widget/base_page/view.dart index 84930be..5ccbd95 100644 --- a/packages/chicken/lib/presentation/widget/base_page/view.dart +++ b/packages/chicken/lib/presentation/widget/base_page/view.dart @@ -3,7 +3,9 @@ import 'package:rasadyar_chicken/presentation/widget/app_bar.dart'; import 'package:rasadyar_chicken/presentation/widget/base_page/back_ground.dart'; import 'package:rasadyar_core/core.dart'; -class ChickenBasePage extends GetView { +import 'logic.dart'; + +class ChickenBasePage extends GetView { const ChickenBasePage({ super.key, this.hasBack = true, diff --git a/packages/chicken/lib/presentation/widget/steward/inventory_widget.dart b/packages/chicken/lib/presentation/widget/steward/inventory_widget.dart index f96f465..e5c16e5 100644 --- a/packages/chicken/lib/presentation/widget/steward/inventory_widget.dart +++ b/packages/chicken/lib/presentation/widget/steward/inventory_widget.dart @@ -62,7 +62,7 @@ Widget _itemList({required String title, required String? value, String? unit,Co mainAxisAlignment: MainAxisAlignment.center, children: [ Text( - value!, + value, textAlign: TextAlign.right, style: AppFonts.yekan16.copyWith(color: const Color(0xFF5B5B5B)), ), diff --git a/packages/chicken/lib/presentation/widget/steward/widely_used/logic.dart b/packages/chicken/lib/presentation/widget/steward/widely_used/logic.dart index 40729eb..7964db0 100644 --- a/packages/chicken/lib/presentation/widget/steward/widely_used/logic.dart +++ b/packages/chicken/lib/presentation/widget/steward/widely_used/logic.dart @@ -9,10 +9,6 @@ class WidelyUsedLogic extends GetxController { StewardRootLogic rootLogic = Get.find(); - @override - void onReady() { - super.onReady(); - } @override void onClose() { diff --git a/packages/chicken/test/data/common/dio_error_handler_test.dart b/packages/chicken/test/data/common/dio_error_handler_test.dart index 3353a8a..71a9953 100644 --- a/packages/chicken/test/data/common/dio_error_handler_test.dart +++ b/packages/chicken/test/data/common/dio_error_handler_test.dart @@ -1,4 +1,3 @@ -import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mocktail/mocktail.dart'; import 'package:rasadyar_chicken/data/common/dio_error_handler.dart'; diff --git a/packages/chicken/test/data/data_source/remote/auth/auth_remote_imp_test.dart b/packages/chicken/test/data/data_source/remote/auth/auth_remote_imp_test.dart index bb1fa65..707a977 100644 --- a/packages/chicken/test/data/data_source/remote/auth/auth_remote_imp_test.dart +++ b/packages/chicken/test/data/data_source/remote/auth/auth_remote_imp_test.dart @@ -4,7 +4,6 @@ import 'package:rasadyar_chicken/data/data_source/remote/auth/auth_remote_imp.da import 'package:rasadyar_chicken/data/models/response/user_info/user_info_model.dart'; import 'package:rasadyar_chicken/data/models/response/user_profile_model/user_profile_model.dart'; import 'package:rasadyar_core/core.dart'; -import 'package:dio/dio.dart'; class MockDioRemote extends Mock implements DioRemote {} diff --git a/packages/core/lib/presentation/common/app_color.dart b/packages/core/lib/presentation/common/app_color.dart index 6e61427..be4e680 100644 --- a/packages/core/lib/presentation/common/app_color.dart +++ b/packages/core/lib/presentation/common/app_color.dart @@ -4,319 +4,137 @@ class AppColor { AppColor._(); //region --- Blue Colors --- - static const Color blueLight = Color( - 0xFFeaefff, - ); // #eaefff rgb(234, 239, 255) - static const Color blueLightHover = Color( - 0xFFe0e7ff, - ); // #e0e7ff rgb(224, 231, 255) - static const Color blueLightActive = Color( - 0xFFbecdff, - ); // #becdff rgb(190, 205, 255) - static const Color blueNormalOld = Color( - 0xFF2d5fff, - ); // #2d5fff rgb(45, 95, 255) + static const Color blueLight = Color(0xFFeaefff); // #eaefff rgb(234, 239, 255) + static const Color blueLightHover = Color(0xFFe0e7ff); // #e0e7ff rgb(224, 231, 255) + static const Color blueLightActive = Color(0xFFbecdff); // #becdff rgb(190, 205, 255) + static const Color blueNormalOld = Color(0xFF2d5fff); // #2d5fff rgb(45, 95, 255) static const Color blueNormal = blueDark; - static const Color blueNormalHover = Color( - 0xFF2956e6, - ); // #2956e6 rgb(41, 86, 230) - static const Color blueNormalActive = Color( - 0xFF244ccc, - ); // #244ccc rgb(36, 76, 204) + static const Color blueNormalHover = Color(0xFF2956e6); // #2956e6 rgb(41, 86, 230) + static const Color blueNormalActive = Color(0xFF244ccc); // #244ccc rgb(36, 76, 204) static const Color blueDark = Color(0xFF2247bf); // #2247bf rgb(34, 71, 191) - static const Color blueDarkHover = Color( - 0xFF1b3999, - ); // #1b3999 rgb(27, 57, 153) - static const Color blueDarkActive = Color( - 0xFF142b73, - ); // #142b73 rgb(20, 43, 115) + static const Color blueDarkHover = Color(0xFF1b3999); // #1b3999 rgb(27, 57, 153) + static const Color blueDarkActive = Color(0xFF142b73); // #142b73 rgb(20, 43, 115) static const Color blueDarker = Color(0xFF102159); // #102159 rgb(16, 33, 89) - static const Color blueFlashing = Color( - 0xFF6F91FF, - ); // #6F91FF rgb(111, 145, 255) + static const Color blueFlashing = Color(0xFF6F91FF); // #6F91FF rgb(111, 145, 255) //endregion //region --- Green Colors --- - static const Color greenLight = Color( - 0xFFe6faf5, - ); // #e6faf5 rgb(230, 250, 245) - static const Color greenLightHover = Color( - 0xFFd9f7f0, - ); // #d9f7f0 rgb(217, 247, 240) - static const Color greenLightActive = Color( - 0xFFb0efdf, - ); // #b0efdf rgb(176, 239, 223) - static const Color greenNormal = Color( - 0xFF00cc99, - ); // #00cc99 rgb(0, 204, 153) - static const Color greenNormalHover = Color( - 0xFF00b88a, - ); // #00b88a rgb(0, 184, 138) - static const Color greenNormalActive = Color( - 0xFF00a37a, - ); // #00a37a rgb(0, 163, 122) + static const Color greenLight = Color(0xFFe6faf5); // #e6faf5 rgb(230, 250, 245) + static const Color greenLightHover = Color(0xFFd9f7f0); // #d9f7f0 rgb(217, 247, 240) + static const Color greenLightActive = Color(0xFFb0efdf); // #b0efdf rgb(176, 239, 223) + static const Color greenNormal = Color(0xFF00cc99); // #00cc99 rgb(0, 204, 153) + static const Color greenNormalHover = Color(0xFF00b88a); // #00b88a rgb(0, 184, 138) + static const Color greenNormalActive = Color(0xFF00a37a); // #00a37a rgb(0, 163, 122) static const Color greenDark = Color(0xFF009973); // #009973 rgb(0, 153, 115) - static const Color greenDarkHover = Color( - 0xFF007a5c, - ); // #007a5c rgb(0, 122, 92) - static const Color greenDarkActive = Color( - 0xFF005c45, - ); // #005c45 rgb(0, 92, 69) + static const Color greenDarkHover = Color(0xFF007a5c); // #007a5c rgb(0, 122, 92) + static const Color greenDarkActive = Color(0xFF005c45); // #005c45 rgb(0, 92, 69) static const Color greenDarker = Color(0xFF004736); // #004736 rgb(0, 71, 54) //endregion //region --- Black Colors --- - static const Color blackLight = Color( - 0xFFe6e6e6, - ); // #e6e6e6 rgb(230, 230, 230) - static const Color blackLightHover = Color( - 0xFFd9d9d9, - ); // #d9d9d9 rgb(217, 217, 217) - static const Color blackLightActive = Color( - 0xFFb0b0b0, - ); // #b0b0b0 rgb(176, 176, 176) + static const Color blackLight = Color(0xFFe6e6e6); // #e6e6e6 rgb(230, 230, 230) + static const Color blackLightHover = Color(0xFFd9d9d9); // #d9d9d9 rgb(217, 217, 217) + static const Color blackLightActive = Color(0xFFb0b0b0); // #b0b0b0 rgb(176, 176, 176) static const Color blackNormal = Color(0xFF000000); // #000000 rgb(0, 0, 0) - static const Color blackNormalHover = Color( - 0xFF000000, - ); // #000000 rgb(0, 0, 0) - static const Color blackNormalActive = Color( - 0xFF000000, - ); // #000000 rgb(0, 0, 0) + static const Color blackNormalHover = Color(0xFF000000); // #000000 rgb(0, 0, 0) + static const Color blackNormalActive = Color(0xFF000000); // #000000 rgb(0, 0, 0) static const Color blackDark = Color(0xFF000000); // #000000 rgb(0, 0, 0) static const Color blackDarkHover = Color(0xFF000000); // #000000 rgb(0, 0, 0) - static const Color blackDarkActive = Color( - 0xFF000000, - ); // #000000 rgb(0, 0, 0) + static const Color blackDarkActive = Color(0xFF000000); // #000000 rgb(0, 0, 0) static const Color blackDarker = Color(0xFF000000); // #000000 rgb(0, 0, 0) //endregion //region --- Grey Colors --- - static const Color darkGreyLight = Color( - 0xFFeaeaea, - ); // #eaeaea rgb(234, 234, 234) - static const Color darkGreyLightHover = Color( - 0xFFdfdfdf, - ); // #dfdfdf rgb(223, 223, 223) - static const Color darkGreyLightActive = Color( - 0xFFbdbdbd, - ); // #bdbdbd rgb(189, 189, 189) - static const Color darkGreyNormal = Color( - 0xFF2a2a2a, - ); // #2a2a2a rgb(42, 42, 42) - static const Color darkGreyNormalHover = Color( - 0xFF262626, - ); // #262626 rgb(38, 38, 38) - static const Color darkGreyNormalActive = Color( - 0xFF222222, - ); // #222222 rgb(34, 34, 34) - static const Color darkGreyDark = Color( - 0xFF202020, - ); // #202020 rgb(32, 32, 32) - static const Color darkGreyDarkHover = Color( - 0xFF191919, - ); // #191919 rgb(25, 25, 25) - static const Color darkGreyDarkActive = Color( - 0xFF131313, - ); // #131313 rgb(19, 19, 19) - static const Color darkGreyDarker = Color( - 0xFF0f0f0f, - ); // #0f0f0f rgb(15, 15, 15) + static const Color darkGreyLight = Color(0xFFeaeaea); // #eaeaea rgb(234, 234, 234) + static const Color darkGreyLightHover = Color(0xFFdfdfdf); // #dfdfdf rgb(223, 223, 223) + static const Color darkGreyLightActive = Color(0xFFbdbdbd); // #bdbdbd rgb(189, 189, 189) + static const Color darkGreyNormal = Color(0xFF2a2a2a); // #2a2a2a rgb(42, 42, 42) + static const Color darkGreyNormalHover = Color(0xFF262626); // #262626 rgb(38, 38, 38) + static const Color darkGreyNormalActive = Color(0xFF222222); // #222222 rgb(34, 34, 34) + static const Color darkGreyDark = Color(0xFF202020); // #202020 rgb(32, 32, 32) + static const Color darkGreyDarkHover = Color(0xFF191919); // #191919 rgb(25, 25, 25) + static const Color darkGreyDarkActive = Color(0xFF131313); // #131313 rgb(19, 19, 19) + static const Color darkGreyDarker = Color(0xFF0f0f0f); // #0f0f0f rgb(15, 15, 15) //endregion //region ---Medium Grey Colors --- - static const Color mediumGrey = Color( - 0xFF979797, - ); // #979797 rgb(151, 151, 151) - static const Color mediumGreyLight = Color( - 0xFFf4f4f4, - ); // #f4f4f4 rgb(244, 244, 244) - static const Color mediumGreyLightHover = Color( - 0xFFeeeeee, - ); // #eeeeee rgb(238, 238, 238) - static const Color mediumGreyLightActive = Color( - 0xFFdcdcdc, - ); // #dcdcdc rgb(220, 220, 220) - static const Color mediumGreyNormal = Color( - 0xFF8f8f8f, - ); // #8f8f8f rgb(143, 143, 143) - static const Color mediumGreyNormalHover = Color( - 0xFF818181, - ); // #818181 rgb(129, 129, 129) - static const Color mediumGreyNormalActive = Color( - 0xFF727272, - ); // #727272 rgb(114, 114, 114) - static const Color mediumGreyDark = Color( - 0xFF6b6b6b, - ); // #6b6b6b rgb(107, 107, 107) - static const Color mediumGreyDarkHover = Color( - 0xFF565656, - ); // #565656 rgb(86, 86, 86) - static const Color mediumGreyDarkActive = Color( - 0xFF404040, - ); // #404040 rgb(64, 64, 64) - static const Color mediumGreyDarker = Color( - 0xFF323232, - ); // #323232 rgb(50, 50, 50) - static const Color customGrey = Color( - 0xFF808081, - ); // #808081 rgb(128, 128, 129) + static const Color mediumGrey = Color(0xFF979797); // #979797 rgb(151, 151, 151) + static const Color mediumGreyLight = Color(0xFFf4f4f4); // #f4f4f4 rgb(244, 244, 244) + static const Color mediumGreyLightHover = Color(0xFFeeeeee); // #eeeeee rgb(238, 238, 238) + static const Color mediumGreyLightActive = Color(0xFFdcdcdc); // #dcdcdc rgb(220, 220, 220) + static const Color mediumGreyNormal = Color(0xFF8f8f8f); // #8f8f8f rgb(143, 143, 143) + static const Color mediumGreyNormalHover = Color(0xFF818181); // #818181 rgb(129, 129, 129) + static const Color mediumGreyNormalActive = Color(0xFF727272); // #727272 rgb(114, 114, 114) + static const Color mediumGreyDark = Color(0xFF6b6b6b); // #6b6b6b rgb(107, 107, 107) + static const Color mediumGreyDarkHover = Color(0xFF565656); // #565656 rgb(86, 86, 86) + static const Color mediumGreyDarkActive = Color(0xFF404040); // #404040 rgb(64, 64, 64) + static const Color mediumGreyDarker = Color(0xFF323232); // #323232 rgb(50, 50, 50) + static const Color customGrey = Color(0xFF808081); // #808081 rgb(128, 128, 129) //endregion //region ---Light Grey Colors --- - static const Color lightGreyLight = Color( - 0xFFfdfdfd, - ); // #fdfdfd rgb(253, 253, 253) - static const Color lightGreyLightHover = Color( - 0xFFfcfcfc, - ); // #fcfcfc rgb(252, 252, 252) - static const Color lightGreyLightActive = Color( - 0xFFfafafa, - ); // #fafafa rgb(250, 250, 250) - static const Color lightGreyNormal = Color( - 0xFFeeeeee, - ); // #eeeeee rgb(238, 238, 238) - static const Color lightGreyNormalHover = Color( - 0xFFd6d6d6, - ); // #d6d6d6 rgb(214, 214, 214) - static const Color lightGreyNormalActive = Color( - 0xFFbebebe, - ); // #bebebe rgb(190, 190, 190) - static const Color lightGreyDark = Color( - 0xFFb3b3b3, - ); // #b3b3b3 rgb(179, 179, 179) - static const Color lightGreyDarkHover = Color( - 0xFF8f8f8f, - ); // #8f8f8f rgb(143, 143, 143) - static const Color lightGreyDarkActive = Color( - 0xFF6b6b6b, - ); // #6b6b6b rgb(107, 107, 107) - static const Color lightGreyDarker = Color( - 0xFF535353, - ); // #535353 rgb(83, 83, 83) + static const Color lightGreyLight = Color(0xFFfdfdfd); // #fdfdfd rgb(253, 253, 253) + static const Color lightGreyLightHover = Color(0xFFfcfcfc); // #fcfcfc rgb(252, 252, 252) + static const Color lightGreyLightActive = Color(0xFFfafafa); // #fafafa rgb(250, 250, 250) + static const Color lightGreyNormal = Color(0xFFeeeeee); // #eeeeee rgb(238, 238, 238) + static const Color lightGreyNormalHover = Color(0xFFd6d6d6); // #d6d6d6 rgb(214, 214, 214) + static const Color lightGreyNormalActive = Color(0xFFbebebe); // #bebebe rgb(190, 190, 190) + static const Color lightGreyDark = Color(0xFFb3b3b3); // #b3b3b3 rgb(179, 179, 179) + static const Color lightGreyDarkHover = Color(0xFF8f8f8f); // #8f8f8f rgb(143, 143, 143) + static const Color lightGreyDarkActive = Color(0xFF6b6b6b); // #6b6b6b rgb(107, 107, 107) + static const Color lightGreyDarker = Color(0xFF535353); // #535353 rgb(83, 83, 83) //endregion //region ---WhiteGrey Colors --- - static const Color whiteGreyLight = Color( - 0xFFfefefe, - ); // #fefefe rgb(254, 254, 254) - static const Color whiteGreyLightHover = Color( - 0xFFfefefe, - ); // #fefefe rgb(254, 254, 254) - static const Color whiteGreyLightActive = Color( - 0xFFfdfdfd, - ); // #fdfdfd rgb(253, 253, 253) - static const Color whiteGreyNormal = Color( - 0xFFf9f9f9, - ); // #f9f9f9 rgb(249, 249, 249) - static const Color whiteGreyNormalHover = Color( - 0xFFe0e0e0, - ); // #e0e0e0 rgb(224, 224, 224) - static const Color whiteGreyNormalActive = Color( - 0xFFc7c7c7, - ); // #c7c7c7 rgb(199, 199, 199) - static const Color whiteGreyDark = Color( - 0xFFbbbbbb, - ); // #bbbbbb rgb(187, 187, 187) - static const Color whiteGreyDarkHover = Color( - 0xFF959595, - ); // #959595 rgb(149, 149, 149) - static const Color whiteGreyDarkActive = Color( - 0xFF707070, - ); // #707070 rgb(112, 112, 112) - static const Color whiteGreyDarker = Color( - 0xFF575757, - ); // #575757 rgb(87, 87, 87) + static const Color whiteGreyLight = Color(0xFFfefefe); // #fefefe rgb(254, 254, 254) + static const Color whiteGreyLightHover = Color(0xFFfefefe); // #fefefe rgb(254, 254, 254) + static const Color whiteGreyLightActive = Color(0xFFfdfdfd); // #fdfdfd rgb(253, 253, 253) + static const Color whiteGreyNormal = Color(0xFFf9f9f9); // #f9f9f9 rgb(249, 249, 249) + static const Color whiteGreyNormalHover = Color(0xFFe0e0e0); // #e0e0e0 rgb(224, 224, 224) + static const Color whiteGreyNormalActive = Color(0xFFc7c7c7); // #c7c7c7 rgb(199, 199, 199) + static const Color whiteGreyDark = Color(0xFFbbbbbb); // #bbbbbb rgb(187, 187, 187) + static const Color whiteGreyDarkHover = Color(0xFF959595); // #959595 rgb(149, 149, 149) + static const Color whiteGreyDarkActive = Color(0xFF707070); // #707070 rgb(112, 112, 112) + static const Color whiteGreyDarker = Color(0xFF575757); // #575757 rgb(87, 87, 87) //endregion //region ---White Colors --- - static const Color whiteLight = Color( - 0xFFffffff, - ); // #ffffff rgb(255, 255, 255) - static const Color whiteLightHover = Color( - 0xFFffffff, - ); // #ffffff rgb(255, 255, 255) - static const Color whiteLightActive = Color( - 0xFFffffff, - ); // #ffffff rgb(255, 255, 255) - static const Color whiteNormal = Color( - 0xFFffffff, - ); // #ffffff rgb(255, 255, 255) - static const Color whiteNormalHover = Color( - 0xFFe6e6e6, - ); // #e6e6e6 rgb(230, 230, 230) - static const Color whiteNormalActive = Color( - 0xFFcccccc, - ); // #cccccc rgb(204, 204, 204) - static const Color whiteDark = Color( - 0xFFbfbfbf, - ); // #bfbfbf rgb(191, 191, 191) - static const Color whiteDarkHover = Color( - 0xFF999999, - ); // #999999 rgb(153, 153, 153) - static const Color whiteDarkActive = Color( - 0xFF737373, - ); // #737373 rgb(115, 115, 115) + static const Color whiteLight = Color(0xFFffffff); // #ffffff rgb(255, 255, 255) + static const Color whiteLightHover = Color(0xFFffffff); // #ffffff rgb(255, 255, 255) + static const Color whiteLightActive = Color(0xFFffffff); // #ffffff rgb(255, 255, 255) + static const Color whiteNormal = Color(0xFFffffff); // #ffffff rgb(255, 255, 255) + static const Color whiteNormalHover = Color(0xFFe6e6e6); // #e6e6e6 rgb(230, 230, 230) + static const Color whiteNormalActive = Color(0xFFcccccc); // #cccccc rgb(204, 204, 204) + static const Color whiteDark = Color(0xFFbfbfbf); // #bfbfbf rgb(191, 191, 191) + static const Color whiteDarkHover = Color(0xFF999999); // #999999 rgb(153, 153, 153) + static const Color whiteDarkActive = Color(0xFF737373); // #737373 rgb(115, 115, 115) static const Color whiteDarker = Color(0xFF595959); // #595959 rgb(89, 89, 89) //endregion //region --- green1 Colors --- - static const Color green1Light = Color( - 0xFFe6f6f4, - ); // #e6f6f4 rgb(230, 246, 244) - static const Color green1LightHover = Color( - 0xFFd9f2ef, - ); // #d9f2ef rgb(217, 242, 239) - static const Color green1LightActive = Color( - 0xFFb0e4dd, - ); // #b0e4dd rgb(176, 228, 221) - static const Color green1Normal = Color( - 0xFF00a991, - ); // #00a991 rgb(0, 169, 145) - static const Color green1NormalHover = Color( - 0xFF009883, - ); // #009883 rgb(0, 152, 131) - static const Color green1NormalActive = Color( - 0xFF008774, - ); // #008774 rgb(0, 135, 116) + static const Color green1Light = Color(0xFFe6f6f4); // #e6f6f4 rgb(230, 246, 244) + static const Color green1LightHover = Color(0xFFd9f2ef); // #d9f2ef rgb(217, 242, 239) + static const Color green1LightActive = Color(0xFFb0e4dd); // #b0e4dd rgb(176, 228, 221) + static const Color green1Normal = Color(0xFF00a991); // #00a991 rgb(0, 169, 145) + static const Color green1NormalHover = Color(0xFF009883); // #009883 rgb(0, 152, 131) + static const Color green1NormalActive = Color(0xFF008774); // #008774 rgb(0, 135, 116) static const Color green1Dark = Color(0xFF007f6d); // #007f6d rgb(0, 127, 109) - static const Color green1DarkHover = Color( - 0xFF006557, - ); // #006557 rgb(0, 101, 87) - static const Color green1DarkActive = Color( - 0xFF004c41, - ); // #004c41 rgb(0, 76, 65) + static const Color green1DarkHover = Color(0xFF006557); // #006557 rgb(0, 101, 87) + static const Color green1DarkActive = Color(0xFF004c41); // #004c41 rgb(0, 76, 65) static const Color green1Darker = Color(0xFF003b33); // #003b33 rgb(0, 59, 51) //endregion //region --- Yellow Colors --- - static const Color yellowLight = Color( - 0xFFfff9e6, - ); // #fff9e6 rgb(255, 249, 230) - static const Color yellowLightHover = Color( - 0xFFfff6da, - ); // #fff6da rgb(255, 246, 218) - static const Color yellowLightActive = Color( - 0xFFffecb2, - ); // #ffecb2 rgb(255, 236, 178) - static const Color yellowNormal = Color( - 0xFFffc107, - ); // #ffc107 rgb(255, 193, 7) - static const Color yellowNormal2 = Color( - 0xFFFF9800, - ); // #FF9800 rgb(255, 152, 0) - static const Color yellowNormalHover = Color( - 0xFFe6ae06, - ); // #e6ae06 rgb(230, 174, 6) - static const Color yellowNormalActive = Color( - 0xFFcc9a06, - ); // #cc9a06 rgb(204, 154, 6) + static const Color yellowLight = Color(0xFFfff9e6); // #fff9e6 rgb(255, 249, 230) + static const Color yellowLightHover = Color(0xFFfff6da); // #fff6da rgb(255, 246, 218) + static const Color yellowLightActive = Color(0xFFffecb2); // #ffecb2 rgb(255, 236, 178) + static const Color yellowNormal = Color(0xFFffc107); // #ffc107 rgb(255, 193, 7) + static const Color yellowNormal2 = Color(0xFFFF9800); // #FF9800 rgb(255, 152, 0) + static const Color yellowNormalHover = Color(0xFFe6ae06); // #e6ae06 rgb(230, 174, 6) + static const Color yellowNormalActive = Color(0xFFcc9a06); // #cc9a06 rgb(204, 154, 6) static const Color yellowDark = Color(0xFFbf9105); // #bf9105 rgb(191, 145, 5) - static const Color yellowDarkHover = Color( - 0xFF997404, - ); // #997404 rgb(153, 116, 4) - static const Color yellowDarkActive = Color( - 0xFF735703, - ); // #735703 rgb(115, 87, 3) + static const Color yellowDarkHover = Color(0xFF997404); // #997404 rgb(153, 116, 4) + static const Color yellowDarkActive = Color(0xFF735703); // #735703 rgb(115, 87, 3) static const Color yellowDarker = Color(0xFF594402); // #594402 rgb(89, 68, 2) // #594402 rgb(89, 68, 2) @@ -324,65 +142,31 @@ class AppColor { //region --- red Colors --- static const Color redLight = Color(0xFFfdeeee); // #fdeeee rgb(253, 238, 238) - static const Color redLightHover = Color( - 0xFFfce6e6, - ); // #fce6e6 rgb(252, 230, 230) - static const Color redLightActive = Color( - 0xFFf9cbcb, - ); // #f9cbcb rgb(249, 203, 203) + static const Color redLightHover = Color(0xFFfce6e6); // #fce6e6 rgb(252, 230, 230) + static const Color redLightActive = Color(0xFFf9cbcb); // #f9cbcb rgb(249, 203, 203) static const Color redNormal = Color(0xFFeb5757); // #eb5757 rgb(235, 87, 87) - static const Color redNormalHover = Color( - 0xFFd44e4e, - ); // #d44e4e rgb(212, 78, 78) - static const Color redNormalActive = Color( - 0xFFbc4646, - ); // #bc4646 rgb(188, 70, 70) + static const Color redNormalHover = Color(0xFFd44e4e); // #d44e4e rgb(212, 78, 78) + static const Color redNormalActive = Color(0xFFbc4646); // #bc4646 rgb(188, 70, 70) static const Color redDark = Color(0xFFb04141); // #b04141 rgb(176, 65, 65) - static const Color redDarkHover = Color( - 0xFF8d3434, - ); // #8d3434 rgb(141, 52, 52) - static const Color redDarkActive = Color( - 0xFF6a2727, - ); // #6a2727 rgb(106, 39, 39) + static const Color redDarkHover = Color(0xFF8d3434); // #8d3434 rgb(141, 52, 52) + static const Color redDarkActive = Color(0xFF6a2727); // #6a2727 rgb(106, 39, 39) static const Color redDarker = Color(0xFF521e1e); // #521e1e rgb(82, 30, 30) - static const Color redDarkerText = Color( - 0xFFD24E4E, - ); // #D34E4E rgba(211, 78, 78, 1) + static const Color redDarkerText = Color(0xFFD24E4E); // #D34E4E rgba(211, 78, 78, 1) - static const Color redLight2 = Color( - 0xFFEDDCE0, - ); // #EDDCE0 rgb(237, 220, 224) - static const Color redLightActive2 = Color( - 0xFFE0BCC5, - ); // #E0BCC5 rgb(224, 188, 197) + static const Color redLight2 = Color(0xFFEDDCE0); // #EDDCE0 rgb(237, 220, 224) + static const Color redLightActive2 = Color(0xFFE0BCC5); // #E0BCC5 rgb(224, 188, 197) //endregion //region --- Teal Colors --- - static const Color tealLight = Color( - 0xFFe8f6f8, - ); // #e8f6f8 rgb(232, 246, 248) - static const Color tealLightHover = Color( - 0xFFdcf1f4, - ); // #dcf1f4 rgb(220, 241, 244) - static const Color tealLightActive = Color( - 0xFFb7e2e9, - ); // #b7e2e9 rgb(183, 226, 233) - static const Color tealNormal = Color( - 0xFF17a2b8, - ); // #17a2b8 rgb(23, 162, 184) - static const Color tealNormalHover = Color( - 0xFF1592a6, - ); // #1592a6 rgb(21, 146, 166) - static const Color tealNormalActive = Color( - 0xFF128293, - ); // #128293 rgb(18, 130, 147) + static const Color tealLight = Color(0xFFe8f6f8); // #e8f6f8 rgb(232, 246, 248) + static const Color tealLightHover = Color(0xFFdcf1f4); // #dcf1f4 rgb(220, 241, 244) + static const Color tealLightActive = Color(0xFFb7e2e9); // #b7e2e9 rgb(183, 226, 233) + static const Color tealNormal = Color(0xFF17a2b8); // #17a2b8 rgb(23, 162, 184) + static const Color tealNormalHover = Color(0xFF1592a6); // #1592a6 rgb(21, 146, 166) + static const Color tealNormalActive = Color(0xFF128293); // #128293 rgb(18, 130, 147) static const Color tealDark = Color(0xFF117a8a); // #117a8a rgb(17, 122, 138) - static const Color tealDarkHover = Color( - 0xFF0e616e, - ); // #0e616e rgb(14, 97, 110) - static const Color tealDarkActive = Color( - 0xFF0a4953, - ); // #0a4953 rgb(10, 73, 83) + static const Color tealDarkHover = Color(0xFF0e616e); // #0e616e rgb(14, 97, 110) + static const Color tealDarkActive = Color(0xFF0a4953); // #0a4953 rgb(10, 73, 83) static const Color tealDarker = Color(0xFF083940); // #083940 rgb(8, 57, 64) static const Color bgLight = Color(0xFFF5F5F5); // #083940 rgb(8, 57, 64) @@ -390,12 +174,11 @@ class AppColor { static const Color bgDark = Color(0xFF979797); // #083940 rgb(8, 57, 64) static const Color textColor = Color(0xFF5B5B5B); // #083940 rgb(8, 57, 64) static const Color textColor2 = Color(0xFF636363); // #636363 rgb(99, 99, 99) + static const Color textColor3 = Color(0xFF717171); // #717171 rgb(113, 113, 113) static const Color labelTextColor = Color(0xFF808080); static const Color textColorLight = Color(0xFFB2B2B2); static const Color iconColor = Color(0xFF444444); // #444444 rgb(68, 68, 68) - static const Color borderColor = Color( - 0xFFC7CFCD, - ); // #C7CFCD rgb(199, 207, 205)` + static const Color borderColor = Color(0xFFC7CFCD); // #C7CFCD rgb(199, 207, 205)` static const Color unselectTextColor = Color(0xFF888888); // static const Color accent1 = Color(0xffffe5ce); // static const Color bgLight2 = Color(0xFFEFEFEF); // #EFEFEF rgb(239, 239, 239) diff --git a/packages/core/lib/presentation/utils/color_utils.dart b/packages/core/lib/presentation/utils/color_utils.dart index 19bea54..359b8db 100644 --- a/packages/core/lib/presentation/utils/color_utils.dart +++ b/packages/core/lib/presentation/utils/color_utils.dart @@ -9,15 +9,15 @@ extension ColorUtils on Color { return hslDarkerColor.toColor(); } - get disabledColor{ + Color get disabledColor{ return withAlpha(38); } - get hoverColor{ + Color get hoverColor{ return _darken(0.5); } - get pressedColor{ + Color get pressedColor{ return _darken(0.10); } diff --git a/packages/core/lib/presentation/utils/data_time_utils.dart b/packages/core/lib/presentation/utils/data_time_utils.dart index f62a641..eac4355 100644 --- a/packages/core/lib/presentation/utils/data_time_utils.dart +++ b/packages/core/lib/presentation/utils/data_time_utils.dart @@ -1,13 +1,15 @@ +import 'package:intl/intl.dart'; + extension XDataTime on DateTime { String get formattedGregorianDate { - return "$year/${month.toString().padLeft(2, '0')}/${day.toString().padLeft(2, '0')}"; } String get formattedDashedGregorian { - return "$year-${month.toString().padLeft(2, '0')}-${day.toString().padLeft(2, '0')}"; } - -} \ No newline at end of file + String get formattedGregorianDateWithoutMillisecond { + return DateFormat('yyyy-MM-dd HH:mm:ss').format(this).toString(); + } +} diff --git a/packages/core/lib/presentation/widget/buttons/core_button.dart b/packages/core/lib/presentation/widget/buttons/core_button.dart index b7f97b6..3b4c251 100644 --- a/packages/core/lib/presentation/widget/buttons/core_button.dart +++ b/packages/core/lib/presentation/widget/buttons/core_button.dart @@ -1,4 +1,3 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:rasadyar_core/core.dart'; diff --git a/packages/core/lib/presentation/widget/buttons/outline_elevated.dart b/packages/core/lib/presentation/widget/buttons/outline_elevated.dart index 5e116e4..4331b29 100644 --- a/packages/core/lib/presentation/widget/buttons/outline_elevated.dart +++ b/packages/core/lib/presentation/widget/buttons/outline_elevated.dart @@ -17,6 +17,7 @@ class ROutlinedElevated extends StatefulWidget { this.width, this.height, this.enabled = true, + this.isFullWidth = false, }) : assert(text != null || child != null, 'Either text or child must be provided'); final String? text; @@ -32,6 +33,7 @@ class ROutlinedElevated extends StatefulWidget { TextStyle? textStyle; Widget? child; bool enabled; + final bool isFullWidth; @override State createState() => _ROutlinedElevatedState(); @@ -67,65 +69,65 @@ class _ROutlinedElevatedState extends State { @override Widget build(BuildContext context) { - return ConstrainedBox( - constraints: BoxConstraints.tightFor( - width: widget.width ?? 150.w, - height: widget.height ?? 40.h, - ), - child: OutlinedButton( - key: _widgetKey, - statesController: _statesController, - onPressed: widget.enabled ? widget.onPressed : null, - style: ButtonStyle( - side: WidgetStateProperty.resolveWith((states) { - if (states.contains(WidgetState.pressed)) { - return BorderSide(color: widget.borderColor ?? AppColor.blueNormal, width: 2); - } else if (states.contains(WidgetState.disabled)) { - return BorderSide( - color: widget.borderColor?.disabledColor ?? AppColor.blueNormal.withAlpha(38), - width: 2, - ); - } + return OutlinedButton( + key: _widgetKey, + statesController: _statesController, + onPressed: widget.enabled ? widget.onPressed : null, + style: ButtonStyle( + side: WidgetStateProperty.resolveWith((states) { + if (states.contains(WidgetState.pressed)) { return BorderSide(color: widget.borderColor ?? AppColor.blueNormal, width: 2); - }), - backgroundColor: WidgetStateProperty.resolveWith((states) { - if (states.contains(WidgetState.pressed)) { - if (widget.pressedBackgroundColor != null) { - return widget.pressedBackgroundColor; - } - return widget.backgroundColor?.pressedColor ?? widget.borderColor?.pressedColor; - } else if (states.contains(WidgetState.hovered)) { - return widget.backgroundColor?.hoverColor ?? AppColor.blueNormal.hoverColor; - } else if (states.contains(WidgetState.disabled)) { - return widget.backgroundColor?.disabledColor ?? Colors.transparent; + } else if (states.contains(WidgetState.disabled)) { + return BorderSide( + color: widget.borderColor?.disabledColor ?? AppColor.blueNormal.withAlpha(38), + width: 2, + ); + } + return BorderSide(color: widget.borderColor ?? AppColor.blueNormal, width: 2); + }), + backgroundColor: WidgetStateProperty.resolveWith((states) { + if (states.contains(WidgetState.pressed)) { + if (widget.pressedBackgroundColor != null) { + return widget.pressedBackgroundColor; } - return widget.backgroundColor; - }), - foregroundColor: WidgetStateProperty.resolveWith((states) { - if (states.contains(WidgetState.pressed)) { - return Colors.white; - } else if (states.contains(WidgetState.disabled)) { - return widget.foregroundColor?.disabledColor ?? - widget.borderColor?.disabledColor ?? - AppColor.blueNormal.disabledColor; - } - return widget.foregroundColor ?? widget.borderColor ?? AppColor.blueNormal; - }), - shape: WidgetStatePropertyAll( - RoundedRectangleBorder(borderRadius: BorderRadius.circular(widget.radius ?? 8)), - ), - fixedSize: WidgetStatePropertyAll(Size(widget.width ?? 150.w, widget.height ?? 56.h)), - padding: WidgetStatePropertyAll(EdgeInsets.zero), - textStyle: WidgetStateProperty.resolveWith((states) { - if (states.contains(WidgetState.pressed)) { - return widget.textStyle?.copyWith(color: Colors.white) ?? - AppFonts.yekan18.copyWith(color: Colors.white); - } - return widget.textStyle ?? AppFonts.yekan18.copyWith(color: AppColor.blueNormal); - }), + return widget.backgroundColor?.pressedColor ?? widget.borderColor?.pressedColor; + } else if (states.contains(WidgetState.hovered)) { + return widget.backgroundColor?.hoverColor ?? AppColor.blueNormal.hoverColor; + } else if (states.contains(WidgetState.disabled)) { + return widget.backgroundColor?.disabledColor ?? Colors.transparent; + } + return widget.backgroundColor; + }), + foregroundColor: WidgetStateProperty.resolveWith((states) { + if (states.contains(WidgetState.pressed)) { + return Colors.white; + } else if (states.contains(WidgetState.disabled)) { + return widget.foregroundColor?.disabledColor ?? + widget.borderColor?.disabledColor ?? + AppColor.blueNormal.disabledColor; + } + return widget.foregroundColor ?? widget.borderColor ?? AppColor.blueNormal; + }), + shape: WidgetStatePropertyAll( + RoundedRectangleBorder(borderRadius: BorderRadius.circular(widget.radius ?? 8)), + ), + fixedSize: WidgetStatePropertyAll(Size(widget.width ?? 150.w, widget.height ?? 56.h)), + padding: WidgetStatePropertyAll(EdgeInsets.zero), + textStyle: WidgetStateProperty.resolveWith((states) { + if (states.contains(WidgetState.pressed)) { + return widget.textStyle?.copyWith(color: Colors.white) ?? + AppFonts.yekan18.copyWith(color: Colors.white); + } + return widget.textStyle ?? AppFonts.yekan18.copyWith(color: AppColor.blueNormal); + }), + minimumSize: WidgetStatePropertyAll( + Size( + widget.isFullWidth ? double.maxFinite : (widget.width ?? 150.w), + widget.height ?? 40.h, + ), ), - child: widget.child ?? Text(widget.text ?? ''), ), + child: widget.child ?? Text(widget.text ?? ''), ); } } diff --git a/packages/core/lib/presentation/widget/buttons/outline_elevated_icon.dart b/packages/core/lib/presentation/widget/buttons/outline_elevated_icon.dart index 4052f6e..10bd28b 100644 --- a/packages/core/lib/presentation/widget/buttons/outline_elevated_icon.dart +++ b/packages/core/lib/presentation/widget/buttons/outline_elevated_icon.dart @@ -2,7 +2,7 @@ import 'package:flutter/material.dart'; import 'package:rasadyar_core/core.dart'; class ROutlinedElevatedIcon extends StatefulWidget { - ROutlinedElevatedIcon({ + const ROutlinedElevatedIcon({ super.key, required this.text, required this.onPressed, diff --git a/packages/core/lib/presentation/widget/card/card_icon_widget.dart b/packages/core/lib/presentation/widget/card/card_icon_widget.dart index 9a04a6a..474d337 100644 --- a/packages/core/lib/presentation/widget/card/card_icon_widget.dart +++ b/packages/core/lib/presentation/widget/card/card_icon_widget.dart @@ -238,7 +238,7 @@ class GlassMorphismGrid extends StatelessWidget { const GlassMorphismGrid({super.key, required this.items, required this.onTap}); final List items; - final VoidCallback onTap; + final void Function(GlassMorphismCardItem item) onTap; @override Widget build(BuildContext context) { @@ -254,7 +254,11 @@ class GlassMorphismGrid extends StatelessWidget { hitTestBehavior: HitTestBehavior.opaque, itemBuilder: (BuildContext context, int index) { var item = items[index]; - return GlassMorphismCardIcon(title: item.title, vecIcon: item.icon, onTap: onTap); + return GlassMorphismCardIcon( + title: item.title, + vecIcon: item.icon, + onTap: () => onTap(item), + ); }, ); } diff --git a/packages/core/lib/presentation/widget/custom/information_tag_widget.dart b/packages/core/lib/presentation/widget/custom/information_tag_widget.dart index efb7e7b..f0b678b 100644 --- a/packages/core/lib/presentation/widget/custom/information_tag_widget.dart +++ b/packages/core/lib/presentation/widget/custom/information_tag_widget.dart @@ -30,7 +30,9 @@ class InformationTagData { //global final int? width; - final int? height; + final double? height; + final Color borderColor; + final double radiusWidth; InformationTagData({ this.labelVecIcon, @@ -55,9 +57,11 @@ class InformationTagData { this.heightIcon, this.widthIcon, this.blendMode, + this.borderColor = const Color(0xFFA9A9A9), + this.radiusWidth = 0.5, }) : assert( - (labelVecIcon != null) ^ (labelSvgIcon != null), - 'Either labelVecIcon or labelSvgIcon must be provided, but not both.', + labelVecIcon == null || labelSvgIcon == null, + 'You cannot provide both labelVecIcon and labelSvgIcon.', ), assert(isLoading || value != null, 'When isLoading is false, value must not be null.'), assert( @@ -91,8 +95,10 @@ class InformationTagData { TextStyle? unitStyle, Color? unitColor, int? width, - int? height, + double? height, BlendMode? blendMode, + Color? borderColor, + double? radiusWidth, }) { return InformationTagData( labelVecIcon: labelVecIcon ?? this.labelVecIcon, @@ -117,6 +123,8 @@ class InformationTagData { width: width ?? this.width, height: height ?? this.height, blendMode: blendMode ?? this.blendMode, + borderColor: borderColor ?? this.borderColor, + radiusWidth: radiusWidth ?? this.radiusWidth, ); } } @@ -131,8 +139,9 @@ class InformationTag extends StatelessWidget { return Container( height: (data.height ?? 82).h, decoration: BoxDecoration( - border: Border.all(color: const Color(0xFFA9A9A9) ,width:0.50), - borderRadius: BorderRadius.circular(8)), + border: Border.all(color: data.borderColor, width: data.radiusWidth), + borderRadius: BorderRadius.circular(8), + ), clipBehavior: Clip.hardEdge, child: Row( children: [ @@ -151,26 +160,29 @@ class InformationTag extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.center, spacing: 4, children: [ - data.labelVecIcon != null - ? ClipRRect( - borderRadius: BorderRadius.circular(8), - child: SvgGenImage.vec(data.labelVecIcon!).svg( - width: (data.widthIcon ?? 24).w, - height: (data.heightIcon ?? 24).h, - colorFilter: ColorFilter.mode( - data.iconColor ?? AppColor.mediumGreyDarkActive, - data.blendMode ?? BlendMode.srcIn, - ), - ), - ) - : SvgGenImage(data.labelSvgIcon!).svg( - width: (data.widthIcon ?? 24).w, - height: (data.heightIcon ?? 24).h, - colorFilter: ColorFilter.mode( - data.iconColor ?? AppColor.mediumGreyDarkActive, - data.blendMode ?? BlendMode.srcIn, - ), + if (data.labelVecIcon != null) + ClipRRect( + borderRadius: BorderRadius.circular(8), + child: SvgGenImage.vec(data.labelVecIcon!).svg( + width: (data.widthIcon ?? 24).w, + height: (data.heightIcon ?? 24).h, + colorFilter: ColorFilter.mode( + data.iconColor ?? AppColor.mediumGreyDarkActive, + data.blendMode ?? BlendMode.srcIn, ), + ), + ), + + if (data.labelSvgIcon != null) + SvgGenImage(data.labelSvgIcon!).svg( + width: (data.widthIcon ?? 24).w, + height: (data.heightIcon ?? 24).h, + colorFilter: ColorFilter.mode( + data.iconColor ?? AppColor.mediumGreyDarkActive, + data.blendMode ?? BlendMode.srcIn, + ), + ), + Visibility( visible: data.labelTitle != null, child: Text( diff --git a/packages/core/lib/presentation/widget/draggable_bottom_sheet/draggable_bottom_sheet_controller.dart b/packages/core/lib/presentation/widget/draggable_bottom_sheet/draggable_bottom_sheet_controller.dart index 2bf39e1..f3264f2 100644 --- a/packages/core/lib/presentation/widget/draggable_bottom_sheet/draggable_bottom_sheet_controller.dart +++ b/packages/core/lib/presentation/widget/draggable_bottom_sheet/draggable_bottom_sheet_controller.dart @@ -1,7 +1,6 @@ import 'package:flutter/material.dart'; import 'package:get/get.dart'; import 'package:rasadyar_core/core.dart'; -import 'draggable_bottom_sheet.dart'; /*class DraggableBottomSheetController extends GetxController { final RxList bottomSheets = diff --git a/packages/core/lib/presentation/widget/inputs/r_input.dart b/packages/core/lib/presentation/widget/inputs/r_input.dart index a013f89..f46631e 100644 --- a/packages/core/lib/presentation/widget/inputs/r_input.dart +++ b/packages/core/lib/presentation/widget/inputs/r_input.dart @@ -47,7 +47,7 @@ class RTextField extends StatefulWidget { final bool? autocorrect; final bool? enableSuggestions; final TextInputAction? textInputAction; - final double? height; + final double height; final Iterable? autofillHints; final InputBorder? focusedBorder; @@ -61,7 +61,7 @@ class RTextField extends StatefulWidget { this.onChanged, this.onSubmitted, this.onTap, - this.height, + this.height = 40, // 🔸 Behavior this.obscure = false, @@ -158,7 +158,9 @@ class _RTextFieldState extends State { obscure = widget.obscure; textDirection = _detectDirection( - widget.controller.text.isNotEmpty ? widget.controller.text : widget.initText ?? 'سلام', + widget.controller.text.isNotEmpty + ? widget.controller.text + : widget.initText ?? 'سلام', ); widget.controller.addListener(_debouncedUpdateTextDirection); @@ -195,7 +197,7 @@ class _RTextFieldState extends State { @override Widget build(BuildContext context) { return SizedBox( - height: widget.height, + height: (widget.height).h, child: Padding( padding: widget.padding ?? EdgeInsets.zero, child: TextFormField( @@ -218,7 +220,8 @@ class _RTextFieldState extends State { textDirection: textDirection, style: widget.style, keyboardType: widget.keyboardType, - autovalidateMode: widget.autoValidateMode ?? AutovalidateMode.disabled, + autovalidateMode: + widget.autoValidateMode ?? AutovalidateMode.disabled, cursorColor: widget.cursorColor, textCapitalization: widget.textCapitalization, autocorrect: widget.autocorrect ?? true, @@ -241,7 +244,8 @@ class _RTextFieldState extends State { labelStyle: AppFonts.yekan14 .copyWith(color: AppColor.lightGreyDarkActive) .merge(widget.labelStyle), - filled: widget.filled || widget._noBorder || widget._passwordNoBorder, + filled: + widget.filled || widget._noBorder || widget._passwordNoBorder, fillColor: widget.filledColor, counter: widget.showCounter ? null : const SizedBox(), hintStyle: widget.hintStyle, diff --git a/packages/core/lib/presentation/widget/list_item/list_item.dart b/packages/core/lib/presentation/widget/list_item/list_item.dart index 01a146d..b9478a2 100644 --- a/packages/core/lib/presentation/widget/list_item/list_item.dart +++ b/packages/core/lib/presentation/widget/list_item/list_item.dart @@ -85,7 +85,7 @@ class ListItem extends StatelessWidget { duration: Duration(milliseconds: 300), ), ), - Container( + SizedBox( width: 20, child: Center( child: SvgGenImage.vec(labelIcon).svg( diff --git a/packages/core/lib/presentation/widget/list_item/list_item2.dart b/packages/core/lib/presentation/widget/list_item/list_item2.dart index 6361e01..11a957f 100644 --- a/packages/core/lib/presentation/widget/list_item/list_item2.dart +++ b/packages/core/lib/presentation/widget/list_item/list_item2.dart @@ -190,7 +190,7 @@ class ListItem2 extends StatelessWidget { child: child, ), ), - Container( + SizedBox( width: 20, child: Center( child: SvgGenImage.vec(labelIcon).svg( diff --git a/packages/core/lib/presentation/widget/list_item/list_item_with_out_number.dart b/packages/core/lib/presentation/widget/list_item/list_item_with_out_number.dart index 5e392e0..be92024 100644 --- a/packages/core/lib/presentation/widget/list_item/list_item_with_out_number.dart +++ b/packages/core/lib/presentation/widget/list_item/list_item_with_out_number.dart @@ -81,7 +81,7 @@ class ListItemWithOutCounter extends StatelessWidget { ), Visibility( visible: selected==false, - child: Container( + child: SizedBox( width: 20, child: Center( child: SvgGenImage.vec(labelIcon).svg( diff --git a/packages/core/lib/presentation/widget/list_view/r_paginated_list_view.dart b/packages/core/lib/presentation/widget/list_view/r_paginated_list_view.dart index 281b333..5aaa168 100644 --- a/packages/core/lib/presentation/widget/list_view/r_paginated_list_view.dart +++ b/packages/core/lib/presentation/widget/list_view/r_paginated_list_view.dart @@ -1,5 +1,4 @@ import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; import 'package:rasadyar_core/core.dart'; enum ListType { builder, separated } diff --git a/packages/core/lib/presentation/widget/overlay_dropdown_widget/resource_overlay_dropdown.dart b/packages/core/lib/presentation/widget/overlay_dropdown_widget/resource_overlay_dropdown.dart index b146c6a..1cc11fb 100644 --- a/packages/core/lib/presentation/widget/overlay_dropdown_widget/resource_overlay_dropdown.dart +++ b/packages/core/lib/presentation/widget/overlay_dropdown_widget/resource_overlay_dropdown.dart @@ -6,7 +6,7 @@ class ResourceOverlayDropdown extends StatefulWidget { final Resource> items; final T? selectedItem; final T? initialValue; - final int? height; + final double? height; final Color? background; final bool? hasDropIcon; final Widget Function(T item) itemBuilder; @@ -31,10 +31,12 @@ class ResourceOverlayDropdown extends StatefulWidget { }); @override - State> createState() => _ResourceOverlayDropdownState(); + State> createState() => + _ResourceOverlayDropdownState(); } -class _ResourceOverlayDropdownState extends State> { +class _ResourceOverlayDropdownState + extends State> { final GlobalKey _key = GlobalKey(); OverlayEntry? _overlayEntry; bool _isOpen = false; @@ -100,7 +102,10 @@ class _ResourceOverlayDropdownState extends State> child: Padding( padding: widget.contentPadding ?? - const EdgeInsets.symmetric(horizontal: 8, vertical: 4), + const EdgeInsets.symmetric( + horizontal: 8, + vertical: 4, + ), child: widget.itemBuilder(item), ), ); @@ -139,13 +144,15 @@ class _ResourceOverlayDropdownState extends State> builder: (context, constraints) { return GestureDetector( key: _key, - onTap: (widget.isDisabled || widget.items.status == ResourceStatus.loading) + onTap: + (widget.isDisabled || + widget.items.status == ResourceStatus.loading) ? null : () { _isOpen ? _removeOverlay() : _showOverlay(); }, child: Container( - height: widget.height?.toDouble() ?? 40, + height: widget.height?.toDouble() ?? 40.h, width: constraints.maxWidth, padding: const EdgeInsets.symmetric(horizontal: 12), decoration: BoxDecoration( @@ -171,14 +178,25 @@ class _ResourceOverlayDropdownState extends State> children: [ Expanded(child: widget.labelBuilder(selectedItem)), if (widget.hasDropIcon ?? true) - Icon(_isOpen ? CupertinoIcons.chevron_up : CupertinoIcons.chevron_down, size: 14), + Icon( + _isOpen + ? CupertinoIcons.chevron_up + : CupertinoIcons.chevron_down, + size: 14, + ), ], ); case ResourceStatus.error: - return Text('Error', style: AppFonts.yekan12.copyWith(color: AppColor.redNormal)); + return Text( + 'Error', + style: AppFonts.yekan12.copyWith(color: AppColor.redNormal), + ); case ResourceStatus.empty: - return Text('بدون نتیجه', style: AppFonts.yekan12.copyWith(color: AppColor.textColor)); + return Text( + 'بدون نتیجه', + style: AppFonts.yekan12.copyWith(color: AppColor.textColor), + ); } } } diff --git a/packages/core/lib/presentation/widget/pagination/pagination_from_until.dart b/packages/core/lib/presentation/widget/pagination/pagination_from_until.dart index 63c1ac0..72a9a4b 100644 --- a/packages/core/lib/presentation/widget/pagination/pagination_from_until.dart +++ b/packages/core/lib/presentation/widget/pagination/pagination_from_until.dart @@ -75,7 +75,7 @@ class _PaginationFromUntilState extends State { Positioned( left: 4, top: 4, - child: Container( + child: SizedBox( width: 40, height: 40, child: Stack( @@ -95,7 +95,7 @@ class _PaginationFromUntilState extends State { Positioned( left: 0, top: 0, - child: Container( + child: SizedBox( width: 40, height: 40, child: Stack( @@ -103,7 +103,7 @@ class _PaginationFromUntilState extends State { Positioned( left: 0, top: 0, - child: Container( + child: SizedBox( width: 40, height: 40, child: Stack( @@ -147,7 +147,7 @@ class _PaginationFromUntilState extends State { Positioned( left: 8, top: 8, - child: Container(width: 24, height: 24, child: Stack()), + child: SizedBox(width: 24, height: 24, child: Stack()), ), ], ), @@ -156,7 +156,7 @@ class _PaginationFromUntilState extends State { Positioned( left: 120, top: 3, - child: Container( + child: SizedBox( width: 40, height: 40, child: Stack( @@ -176,7 +176,7 @@ class _PaginationFromUntilState extends State { Positioned( left: 0, top: 0, - child: Container( + child: SizedBox( width: 40, height: 40, child: Stack( @@ -184,7 +184,7 @@ class _PaginationFromUntilState extends State { Positioned( left: 0, top: 0, - child: Container( + child: SizedBox( width: 40, height: 40, child: Stack( @@ -229,7 +229,7 @@ class _PaginationFromUntilState extends State { Positioned( left: 8, top: 8, - child: Container(width: 24, height: 24, child: Stack()), + child: SizedBox(width: 24, height: 24, child: Stack()), ), ], ), diff --git a/packages/core/lib/presentation/widget/pagination/show_more.dart b/packages/core/lib/presentation/widget/pagination/show_more.dart index 757e952..0c3cae2 100644 --- a/packages/core/lib/presentation/widget/pagination/show_more.dart +++ b/packages/core/lib/presentation/widget/pagination/show_more.dart @@ -1,5 +1,4 @@ import 'package:flutter/cupertino.dart'; -import 'package:flutter/material.dart'; import 'package:rasadyar_core/presentation/common/app_color.dart'; import 'package:rasadyar_core/presentation/common/app_fonts.dart'; diff --git a/packages/core/lib/presentation/widget/vec_widget.dart b/packages/core/lib/presentation/widget/vec_widget.dart index f462774..f479328 100644 --- a/packages/core/lib/presentation/widget/vec_widget.dart +++ b/packages/core/lib/presentation/widget/vec_widget.dart @@ -1,8 +1,5 @@ import 'package:flutter/material.dart'; -import 'package:flutter_svg/flutter_svg.dart'; -import 'package:vector_graphics/vector_graphics.dart'; -import '../common/assets.gen.dart'; Widget vecWidgetWithOnTap({ diff --git a/packages/core/lib/utils/apk_updater.dart b/packages/core/lib/utils/apk_updater.dart index a741e8f..8f9530d 100644 --- a/packages/core/lib/utils/apk_updater.dart +++ b/packages/core/lib/utils/apk_updater.dart @@ -1,4 +1,3 @@ -import 'dart:io'; import 'package:dio/dio.dart'; import 'package:flutter/services.dart'; diff --git a/packages/core/lib/utils/network/safe_call_utils.dart b/packages/core/lib/utils/network/safe_call_utils.dart index 11e8cd4..94dc4e0 100644 --- a/packages/core/lib/utils/network/safe_call_utils.dart +++ b/packages/core/lib/utils/network/safe_call_utils.dart @@ -171,6 +171,25 @@ void defaultShowSuccessMessage( ); } +void rawShowSuccessMessage( + String message, { + int durationInSeconds = 1500, + VoidCallback? onDismissed, +}) { + Get.rawSnackbar( + titleText: Text('موفقیت', style: AppFonts.yekan14.copyWith(color: Colors.white)), + messageText: Text(message, style: AppFonts.yekan12.copyWith(color: Colors.white)), + duration: Duration(milliseconds: durationInSeconds), + snackPosition: SnackPosition.TOP, + backgroundColor: Colors.green, + snackbarStatus: (status) { + if (status == SnackbarStatus.CLOSED) { + onDismissed?.call(); + } + }, + ); +} + void defaultShowErrorMessage(String message) { Get.snackbar( 'خطا', diff --git a/packages/core/test/presentation/widget/overlay_dropdown_widget/multi_select_dropdown/searchable_dropdown_widget_test.dart b/packages/core/test/presentation/widget/overlay_dropdown_widget/multi_select_dropdown/searchable_dropdown_widget_test.dart index 3c836c7..011257a 100644 --- a/packages/core/test/presentation/widget/overlay_dropdown_widget/multi_select_dropdown/searchable_dropdown_widget_test.dart +++ b/packages/core/test/presentation/widget/overlay_dropdown_widget/multi_select_dropdown/searchable_dropdown_widget_test.dart @@ -1,4 +1,3 @@ -import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:rasadyar_core/presentation/widget/overlay_dropdown_widget/multi_select_dropdown/multi_select_dropdown.dart'; diff --git a/packages/inspection/lib/data/data_source/remote/auth/auth_remote_imp.dart b/packages/inspection/lib/data/data_source/remote/auth/auth_remote_imp.dart index ff1b37e..4c6912d 100644 --- a/packages/inspection/lib/data/data_source/remote/auth/auth_remote_imp.dart +++ b/packages/inspection/lib/data/data_source/remote/auth/auth_remote_imp.dart @@ -1,7 +1,6 @@ import 'package:rasadyar_core/core.dart'; import 'package:rasadyar_inspection/data/model/response/auth/auth_response_model.dart'; import 'package:rasadyar_inspection/data/model/response/captcha/captcha_response_model.dart'; -import 'package:rasadyar_inspection/data/model/response/user_profile/user_profile_model.dart'; import 'auth_remote.dart'; diff --git a/packages/inspection/lib/data/utils/marker_generator.dart b/packages/inspection/lib/data/utils/marker_generator.dart index af3ad4a..d0cff2f 100644 --- a/packages/inspection/lib/data/utils/marker_generator.dart +++ b/packages/inspection/lib/data/utils/marker_generator.dart @@ -1,5 +1,4 @@ import 'dart:async'; -import 'dart:convert'; import 'dart:math'; import 'package:flutter/foundation.dart'; diff --git a/packages/inspection/lib/presentation/pages/action/logic.dart b/packages/inspection/lib/presentation/pages/action/logic.dart index 3d2a504..22d39e1 100644 --- a/packages/inspection/lib/presentation/pages/action/logic.dart +++ b/packages/inspection/lib/presentation/pages/action/logic.dart @@ -1,4 +1,3 @@ -import 'package:flutter/material.dart'; import 'package:rasadyar_core/core.dart'; class ActionLogic extends GetxController with GetTickerProviderStateMixin { diff --git a/packages/inspection/lib/presentation/pages/add_mobile_inspector/view.dart b/packages/inspection/lib/presentation/pages/add_mobile_inspector/view.dart index eeebe98..e8e960a 100644 --- a/packages/inspection/lib/presentation/pages/add_mobile_inspector/view.dart +++ b/packages/inspection/lib/presentation/pages/add_mobile_inspector/view.dart @@ -1,6 +1,5 @@ import 'package:flutter/material.dart'; import 'package:rasadyar_core/core.dart'; -import 'package:rasadyar_core/presentation/widget/buttons/fab.dart'; import 'package:rasadyar_inspection/presentation/routes/app_routes.dart'; import 'logic.dart'; diff --git a/packages/inspection/lib/presentation/pages/add_supervision/logic.dart b/packages/inspection/lib/presentation/pages/add_supervision/logic.dart index 4f308bb..719550b 100644 --- a/packages/inspection/lib/presentation/pages/add_supervision/logic.dart +++ b/packages/inspection/lib/presentation/pages/add_supervision/logic.dart @@ -53,13 +53,6 @@ List routes = [ - @override - void onReady() { - - super.onReady(); - - - } @override void onClose() { diff --git a/packages/inspection/lib/presentation/pages/auth/logic.dart b/packages/inspection/lib/presentation/pages/auth/logic.dart index 49a2ab4..e4d5182 100644 --- a/packages/inspection/lib/presentation/pages/auth/logic.dart +++ b/packages/inspection/lib/presentation/pages/auth/logic.dart @@ -61,11 +61,6 @@ class AuthLogic extends GetxController with GetTickerProviderStateMixin { textAnimation = CurvedAnimation(parent: _textAnimationController, curve: Curves.easeInOut); } - @override - void onReady() { - super.onReady(); - //_textAnimationController.forward(); - } @override void onClose() { diff --git a/packages/inspection/lib/presentation/pages/filter/view.dart b/packages/inspection/lib/presentation/pages/filter/view.dart index 65787c9..6ea7f4c 100644 --- a/packages/inspection/lib/presentation/pages/filter/view.dart +++ b/packages/inspection/lib/presentation/pages/filter/view.dart @@ -1,6 +1,5 @@ import 'package:flutter/material.dart'; import 'package:rasadyar_core/core.dart'; -import 'package:rasadyar_core/presentation/widget/buttons/fab.dart'; import 'package:rasadyar_inspection/presentation/routes/app_routes.dart'; import 'package:rasadyar_inspection/presentation/widget/custom_chips.dart'; diff --git a/packages/inspection/lib/presentation/pages/inspection_map/logic.dart b/packages/inspection/lib/presentation/pages/inspection_map/logic.dart index 8e71b78..7875532 100644 --- a/packages/inspection/lib/presentation/pages/inspection_map/logic.dart +++ b/packages/inspection/lib/presentation/pages/inspection_map/logic.dart @@ -42,16 +42,7 @@ class InspectionMapLogic extends GetxController { }, time: Duration(seconds: 2)); } - @override - void onReady() { - super.onReady(); - //determineCurrentPosition(); - } - @override - void onClose() { - super.onClose(); - } Future fetchAllPoultryLocations() async { allPoultryLocation.value = Resource>.loading(); diff --git a/packages/inspection/lib/presentation/pages/location_details/view.dart b/packages/inspection/lib/presentation/pages/location_details/view.dart index 584d1c0..b1aaff4 100644 --- a/packages/inspection/lib/presentation/pages/location_details/view.dart +++ b/packages/inspection/lib/presentation/pages/location_details/view.dart @@ -1,8 +1,6 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:rasadyar_core/core.dart'; -import 'package:rasadyar_core/presentation/utils/color_utils.dart'; -import 'package:rasadyar_core/presentation/widget/tabs/new_tab.dart'; import 'logic.dart'; class LocationDetailsPage extends GetView { diff --git a/packages/inspection/lib/presentation/pages/profile/view.dart b/packages/inspection/lib/presentation/pages/profile/view.dart index 510f243..0f891d8 100644 --- a/packages/inspection/lib/presentation/pages/profile/view.dart +++ b/packages/inspection/lib/presentation/pages/profile/view.dart @@ -25,7 +25,7 @@ class ProfilePage extends GetView { final status = data.value.status; if (status == ResourceStatus.loading) { - return Container( + return SizedBox( width: 128.w, height: 128.h, child: Center(child: CupertinoActivityIndicator(color: AppColor.greenNormal)), @@ -33,7 +33,7 @@ class ProfilePage extends GetView { } if (status == ResourceStatus.error) { - return Container( + return SizedBox( width: 128.w, height: 128.h, child: Center(child: Text('خطا در دریافت اطلاعات')), diff --git a/packages/inspection/lib/presentation/widget/base_page/view.dart b/packages/inspection/lib/presentation/widget/base_page/view.dart index 63bef54..29ade7c 100644 --- a/packages/inspection/lib/presentation/widget/base_page/view.dart +++ b/packages/inspection/lib/presentation/widget/base_page/view.dart @@ -49,7 +49,7 @@ class BasePage extends StatefulWidget { class _BasePageState extends State { BaseLogic get controller => Get.find(); Worker? filterWorker; - bool _isBottomSheetOpen = false; + final bool _isBottomSheetOpen = false; @override void initState() { diff --git a/packages/inspection/lib/presentation/widget/search.dart b/packages/inspection/lib/presentation/widget/search.dart index 3b18be6..f3b0ec0 100644 --- a/packages/inspection/lib/presentation/widget/search.dart +++ b/packages/inspection/lib/presentation/widget/search.dart @@ -1,6 +1,5 @@ import 'package:flutter/material.dart'; import 'package:rasadyar_core/core.dart'; -import 'package:rasadyar_inspection/presentation/widget/base_page/logic.dart' hide BaseLogic; class SearchWidget2 extends StatefulWidget { diff --git a/packages/livestock/lib/data/common/checkk_di_middleware.dart b/packages/livestock/lib/data/common/checkk_di_middleware.dart index 32c9f0f..7ca3e64 100644 --- a/packages/livestock/lib/data/common/checkk_di_middleware.dart +++ b/packages/livestock/lib/data/common/checkk_di_middleware.dart @@ -3,13 +3,5 @@ import 'package:rasadyar_core/core.dart'; import 'package:rasadyar_livestock/injection/live_stock_di.dart'; class CheckDiMiddleWare extends GetMiddleware { - @override - Future redirectDelegate(GetNavConfig route) async { - return super.redirectDelegate(route); - } - @override - GetPage? onPageCalled(GetPage? page) { - return super.onPageCalled(page); - } } diff --git a/packages/livestock/lib/data/repository/auth/auth_repository.dart b/packages/livestock/lib/data/repository/auth/auth_repository.dart index 52fa9d5..8b8fc16 100644 --- a/packages/livestock/lib/data/repository/auth/auth_repository.dart +++ b/packages/livestock/lib/data/repository/auth/auth_repository.dart @@ -1,4 +1,3 @@ -import 'package:rasadyar_livestock/data/model/response/address/address.dart'; import 'package:rasadyar_livestock/data/model/response/auth/auth_response_model.dart'; import 'package:rasadyar_livestock/data/model/response/captcha/captcha_response_model.dart'; diff --git a/packages/livestock/lib/data/repository/auth/auth_repository_imp.dart b/packages/livestock/lib/data/repository/auth/auth_repository_imp.dart index 11a7c60..84d15e8 100644 --- a/packages/livestock/lib/data/repository/auth/auth_repository_imp.dart +++ b/packages/livestock/lib/data/repository/auth/auth_repository_imp.dart @@ -1,6 +1,4 @@ import 'package:rasadyar_livestock/data/data_source/remote/auth/auth_remote.dart'; -import 'package:rasadyar_livestock/data/data_source/remote/livestock/livestock_remote.dart'; -import 'package:rasadyar_livestock/data/model/response/address/address.dart'; import 'package:rasadyar_livestock/data/model/response/auth/auth_response_model.dart'; import 'package:rasadyar_livestock/data/model/response/captcha/captcha_response_model.dart'; diff --git a/packages/livestock/lib/presentation/page/auth/logic.dart b/packages/livestock/lib/presentation/page/auth/logic.dart index 78f9782..e219606 100644 --- a/packages/livestock/lib/presentation/page/auth/logic.dart +++ b/packages/livestock/lib/presentation/page/auth/logic.dart @@ -62,11 +62,6 @@ class AuthLogic extends GetxController with GetTickerProviderStateMixin { textAnimation = CurvedAnimation(parent: _textAnimationController, curve: Curves.easeInOut); } - @override - void onReady() { - super.onReady(); - //_textAnimationController.forward(); - } @override void onClose() { diff --git a/packages/livestock/lib/presentation/page/map/logic.dart b/packages/livestock/lib/presentation/page/map/logic.dart index cf293d5..3768580 100644 --- a/packages/livestock/lib/presentation/page/map/logic.dart +++ b/packages/livestock/lib/presentation/page/map/logic.dart @@ -1,5 +1,4 @@ import 'package:rasadyar_core/core.dart'; -import 'package:rasadyar_livestock/presentation/widgets/base_page/logic.dart' hide BaseLogic; class MapLogic extends GetxController { BaseLogic baseLogic = Get.find(); diff --git a/packages/livestock/lib/presentation/page/map/widget/map_widget/logic.dart b/packages/livestock/lib/presentation/page/map/widget/map_widget/logic.dart index 3b02375..7f52f0e 100644 --- a/packages/livestock/lib/presentation/page/map/widget/map_widget/logic.dart +++ b/packages/livestock/lib/presentation/page/map/widget/map_widget/logic.dart @@ -3,7 +3,6 @@ import 'dart:math'; import 'package:flutter/material.dart'; import 'package:rasadyar_core/core.dart'; -import 'package:rasadyar_livestock/data/common/constant.dart'; import 'package:rasadyar_livestock/data/repository/livestock/livestock_repository.dart'; import 'package:rasadyar_livestock/injection/live_stock_di.dart'; import 'package:rasadyar_livestock/presentation/page/root/logic.dart'; diff --git a/packages/livestock/lib/presentation/page/profile/logic.dart b/packages/livestock/lib/presentation/page/profile/logic.dart index bf982cb..0daf049 100644 --- a/packages/livestock/lib/presentation/page/profile/logic.dart +++ b/packages/livestock/lib/presentation/page/profile/logic.dart @@ -28,7 +28,7 @@ class ProfileLogic extends GetxController { GlobalKey formKey = GlobalKey(); ImagePicker imagePicker = ImagePicker(); Rxn selectedImage = Rxn(); - RxnString _base64Image = RxnString(); + final RxnString _base64Image = RxnString(); RxBool isOnLoading = false.obs; @override @@ -65,10 +65,6 @@ class ProfileLogic extends GetxController { });*/ } - @override - void onClose() { - super.onClose(); - } Future getUserProfile() async { /*userProfile.value = Resource.loading(); diff --git a/packages/livestock/lib/presentation/page/request_tagging/logic.dart b/packages/livestock/lib/presentation/page/request_tagging/logic.dart index 0625a2c..9105b5f 100644 --- a/packages/livestock/lib/presentation/page/request_tagging/logic.dart +++ b/packages/livestock/lib/presentation/page/request_tagging/logic.dart @@ -110,10 +110,6 @@ class RequestTaggingLogic extends GetxController { livestockList.addAll(s); } - @override - void onClose() { - super.onClose(); - } void onNext() async { if (currentIndex.value < maxStep) { diff --git a/packages/livestock/lib/presentation/page/request_tagging/view.dart b/packages/livestock/lib/presentation/page/request_tagging/view.dart index f6d3b4e..5f1132f 100644 --- a/packages/livestock/lib/presentation/page/request_tagging/view.dart +++ b/packages/livestock/lib/presentation/page/request_tagging/view.dart @@ -1083,7 +1083,7 @@ class RequestTaggingPage extends GetView { ), Text( - '${Jalali.now().formatter.y}', + Jalali.now().formatter.y, style: AppFonts.yekan20.copyWith(color: AppColor.textColor), ), diff --git a/packages/livestock/lib/presentation/page/requests/logic.dart b/packages/livestock/lib/presentation/page/requests/logic.dart index bf98dd3..626a7f2 100644 --- a/packages/livestock/lib/presentation/page/requests/logic.dart +++ b/packages/livestock/lib/presentation/page/requests/logic.dart @@ -1,5 +1,4 @@ import 'package:rasadyar_core/core.dart'; -import 'package:rasadyar_livestock/presentation/page/root/logic.dart'; class RequestsLogic extends GetxController { RxList filterSelected = [].obs; diff --git a/packages/livestock/lib/presentation/page/root/logic.dart b/packages/livestock/lib/presentation/page/root/logic.dart index 7d0443e..3b3a76f 100644 --- a/packages/livestock/lib/presentation/page/root/logic.dart +++ b/packages/livestock/lib/presentation/page/root/logic.dart @@ -45,21 +45,9 @@ class RootLogic extends GetxController { RxInt currentIndex = 0.obs; TokenStorageService tokenService = Get.find(); - @override - void onInit() { - super.onInit(); - } - @override - void onReady() { - super.onReady(); - } - @override - void onClose() { - super.onClose(); - } void changePage(int index) { if (index == currentIndex.value) { diff --git a/packages/livestock/lib/presentation/page/root/view.dart b/packages/livestock/lib/presentation/page/root/view.dart index 50d0863..e3a6473 100644 --- a/packages/livestock/lib/presentation/page/root/view.dart +++ b/packages/livestock/lib/presentation/page/root/view.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; -import 'package:flutter/services.dart'; import 'package:rasadyar_core/core.dart'; import 'logic.dart'; diff --git a/packages/livestock/lib/presentation/page/tagging/view.dart b/packages/livestock/lib/presentation/page/tagging/view.dart index 9fd30f0..f12deed 100644 --- a/packages/livestock/lib/presentation/page/tagging/view.dart +++ b/packages/livestock/lib/presentation/page/tagging/view.dart @@ -1,7 +1,6 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:rasadyar_core/core.dart'; -import 'package:rasadyar_core/presentation/widget/buttons/fab.dart'; import 'logic.dart'; diff --git a/packages/livestock/lib/presentation/routes/app_pages.dart b/packages/livestock/lib/presentation/routes/app_pages.dart index ba73dd3..7050ae6 100644 --- a/packages/livestock/lib/presentation/routes/app_pages.dart +++ b/packages/livestock/lib/presentation/routes/app_pages.dart @@ -14,7 +14,6 @@ import 'package:rasadyar_livestock/presentation/page/tagging/view.dart'; import 'package:rasadyar_livestock/presentation/widgets/base_page/logic.dart'; import 'package:rasadyar_livestock/presentation/widgets/captcha/logic.dart'; -import '../../injection/live_stock_di.dart'; part 'app_routes.dart'; diff --git a/packages/livestock/lib/presentation/widgets/base_page/view.dart b/packages/livestock/lib/presentation/widgets/base_page/view.dart index 1f6baac..0d47063 100644 --- a/packages/livestock/lib/presentation/widgets/base_page/view.dart +++ b/packages/livestock/lib/presentation/widgets/base_page/view.dart @@ -55,7 +55,7 @@ class BasePage extends StatefulWidget { class _BasePageState extends State { BaseLogic get controller => Get.find(); Worker? filterWorker; - bool _isBottomSheetOpen = false; + final bool _isBottomSheetOpen = false; @override void initState() {