diff --git a/assets/icons/clock.svg b/assets/icons/clock.svg new file mode 100644 index 0000000..fd5588b --- /dev/null +++ b/assets/icons/clock.svg @@ -0,0 +1,4 @@ + + + + diff --git a/packages/chicken/lib/data/models/response/imported_loads_model/imported_loads_model.dart b/packages/chicken/lib/data/models/response/imported_loads_model/imported_loads_model.dart index 4df10b9..17c6f77 100644 --- a/packages/chicken/lib/data/models/response/imported_loads_model/imported_loads_model.dart +++ b/packages/chicken/lib/data/models/response/imported_loads_model/imported_loads_model.dart @@ -6,19 +6,6 @@ part 'imported_loads_model.g.dart'; @freezed abstract class ImportedLoadsModel with _$ImportedLoadsModel { const factory ImportedLoadsModel({ - int? count, - String? next, - String? previous, - List? results, - }) = _ImportedLoadsModel; - - factory ImportedLoadsModel.fromJson(Map json) => - _$ImportedLoadsModelFromJson(json); -} - -@freezed -abstract class ImportedLoad with _$ImportedLoad { - const factory ImportedLoad({ int? id, Product? product, KillHouse? killHouse, @@ -74,10 +61,10 @@ abstract class ImportedLoad with _$ImportedLoad { dynamic stewardWareHouse, dynamic car, dynamic dispenser, - }) = _ImportedLoad; + }) = _ImportedLoadsModel; - factory ImportedLoad.fromJson(Map json) => - _$ImportedLoadFromJson(json); + factory ImportedLoadsModel.fromJson(Map json) => + _$ImportedLoadsModelFromJson(json); } @freezed diff --git a/packages/chicken/lib/data/models/response/imported_loads_model/imported_loads_model.freezed.dart b/packages/chicken/lib/data/models/response/imported_loads_model/imported_loads_model.freezed.dart index 16c065c..10eda4f 100644 --- a/packages/chicken/lib/data/models/response/imported_loads_model/imported_loads_model.freezed.dart +++ b/packages/chicken/lib/data/models/response/imported_loads_model/imported_loads_model.freezed.dart @@ -16,7 +16,7 @@ T _$identity(T value) => value; /// @nodoc mixin _$ImportedLoadsModel { - int? get count; String? get next; String? get previous; List? get results; + int? get id; Product? get product; KillHouse? get killHouse; dynamic get toKillHouse; dynamic get steward; ToSteward? get toSteward; dynamic get guilds; dynamic get toGuilds; dynamic get toColdHouse; int? get indexWeight; int? get dateTimestamp; int? get newState; int? get newReceiverState; int? get newAllocationState; String? get key; String? get createDate; String? get modifyDate; bool? get trash; int? get numberOfCarcasses; int? get realNumberOfCarcasses; int? get receiverRealNumberOfCarcasses; double? get weightOfCarcasses; double? get realWeightOfCarcasses; double? get receiverRealWeightOfCarcasses; double? get weightLossOfCarcasses; bool? get finalRegistration; String? get sellType; String? get productName; String? get sellerType; String? get type; String? get saleType; String? get allocationType; bool? get systemRegistrationCode; int? get registrationCode; int? get amount; int? get totalAmount; int? get totalAmountPaid; int? get totalAmountRemain; dynamic get loggedRegistrationCode; String? get state; String? get receiverState; String? get allocationState; String? get date; dynamic get role; dynamic get stewardTempKey; bool? get approvedPriceStatus; bool? get calculateStatus; bool? get temporaryTrash; bool? get temporaryDeleted; dynamic get createdBy; dynamic get modifiedBy; dynamic get wareHouse; dynamic get stewardWareHouse; dynamic get car; dynamic get dispenser; /// Create a copy of ImportedLoadsModel /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @@ -29,16 +29,16 @@ $ImportedLoadsModelCopyWith get copyWith => _$ImportedLoadsM @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is ImportedLoadsModel&&(identical(other.count, count) || other.count == count)&&(identical(other.next, next) || other.next == next)&&(identical(other.previous, previous) || other.previous == previous)&&const DeepCollectionEquality().equals(other.results, results)); + return identical(this, other) || (other.runtimeType == runtimeType&&other is ImportedLoadsModel&&(identical(other.id, id) || other.id == id)&&(identical(other.product, product) || other.product == product)&&(identical(other.killHouse, killHouse) || other.killHouse == killHouse)&&const DeepCollectionEquality().equals(other.toKillHouse, toKillHouse)&&const DeepCollectionEquality().equals(other.steward, steward)&&(identical(other.toSteward, toSteward) || other.toSteward == toSteward)&&const DeepCollectionEquality().equals(other.guilds, guilds)&&const DeepCollectionEquality().equals(other.toGuilds, toGuilds)&&const DeepCollectionEquality().equals(other.toColdHouse, toColdHouse)&&(identical(other.indexWeight, indexWeight) || other.indexWeight == indexWeight)&&(identical(other.dateTimestamp, dateTimestamp) || other.dateTimestamp == dateTimestamp)&&(identical(other.newState, newState) || other.newState == newState)&&(identical(other.newReceiverState, newReceiverState) || other.newReceiverState == newReceiverState)&&(identical(other.newAllocationState, newAllocationState) || other.newAllocationState == newAllocationState)&&(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.numberOfCarcasses, numberOfCarcasses) || other.numberOfCarcasses == numberOfCarcasses)&&(identical(other.realNumberOfCarcasses, realNumberOfCarcasses) || other.realNumberOfCarcasses == realNumberOfCarcasses)&&(identical(other.receiverRealNumberOfCarcasses, receiverRealNumberOfCarcasses) || other.receiverRealNumberOfCarcasses == receiverRealNumberOfCarcasses)&&(identical(other.weightOfCarcasses, weightOfCarcasses) || other.weightOfCarcasses == weightOfCarcasses)&&(identical(other.realWeightOfCarcasses, realWeightOfCarcasses) || other.realWeightOfCarcasses == realWeightOfCarcasses)&&(identical(other.receiverRealWeightOfCarcasses, receiverRealWeightOfCarcasses) || other.receiverRealWeightOfCarcasses == receiverRealWeightOfCarcasses)&&(identical(other.weightLossOfCarcasses, weightLossOfCarcasses) || other.weightLossOfCarcasses == weightLossOfCarcasses)&&(identical(other.finalRegistration, finalRegistration) || other.finalRegistration == finalRegistration)&&(identical(other.sellType, sellType) || other.sellType == sellType)&&(identical(other.productName, productName) || other.productName == productName)&&(identical(other.sellerType, sellerType) || other.sellerType == sellerType)&&(identical(other.type, type) || other.type == type)&&(identical(other.saleType, saleType) || other.saleType == saleType)&&(identical(other.allocationType, allocationType) || other.allocationType == allocationType)&&(identical(other.systemRegistrationCode, systemRegistrationCode) || other.systemRegistrationCode == systemRegistrationCode)&&(identical(other.registrationCode, registrationCode) || other.registrationCode == registrationCode)&&(identical(other.amount, amount) || other.amount == amount)&&(identical(other.totalAmount, totalAmount) || other.totalAmount == totalAmount)&&(identical(other.totalAmountPaid, totalAmountPaid) || other.totalAmountPaid == totalAmountPaid)&&(identical(other.totalAmountRemain, totalAmountRemain) || other.totalAmountRemain == totalAmountRemain)&&const DeepCollectionEquality().equals(other.loggedRegistrationCode, loggedRegistrationCode)&&(identical(other.state, state) || other.state == state)&&(identical(other.receiverState, receiverState) || other.receiverState == receiverState)&&(identical(other.allocationState, allocationState) || other.allocationState == allocationState)&&(identical(other.date, date) || other.date == date)&&const DeepCollectionEquality().equals(other.role, role)&&const DeepCollectionEquality().equals(other.stewardTempKey, stewardTempKey)&&(identical(other.approvedPriceStatus, approvedPriceStatus) || other.approvedPriceStatus == approvedPriceStatus)&&(identical(other.calculateStatus, calculateStatus) || other.calculateStatus == calculateStatus)&&(identical(other.temporaryTrash, temporaryTrash) || other.temporaryTrash == temporaryTrash)&&(identical(other.temporaryDeleted, temporaryDeleted) || other.temporaryDeleted == temporaryDeleted)&&const DeepCollectionEquality().equals(other.createdBy, createdBy)&&const DeepCollectionEquality().equals(other.modifiedBy, modifiedBy)&&const DeepCollectionEquality().equals(other.wareHouse, wareHouse)&&const DeepCollectionEquality().equals(other.stewardWareHouse, stewardWareHouse)&&const DeepCollectionEquality().equals(other.car, car)&&const DeepCollectionEquality().equals(other.dispenser, dispenser)); } @JsonKey(includeFromJson: false, includeToJson: false) @override -int get hashCode => Object.hash(runtimeType,count,next,previous,const DeepCollectionEquality().hash(results)); +int get hashCode => Object.hashAll([runtimeType,id,product,killHouse,const DeepCollectionEquality().hash(toKillHouse),const DeepCollectionEquality().hash(steward),toSteward,const DeepCollectionEquality().hash(guilds),const DeepCollectionEquality().hash(toGuilds),const DeepCollectionEquality().hash(toColdHouse),indexWeight,dateTimestamp,newState,newReceiverState,newAllocationState,key,createDate,modifyDate,trash,numberOfCarcasses,realNumberOfCarcasses,receiverRealNumberOfCarcasses,weightOfCarcasses,realWeightOfCarcasses,receiverRealWeightOfCarcasses,weightLossOfCarcasses,finalRegistration,sellType,productName,sellerType,type,saleType,allocationType,systemRegistrationCode,registrationCode,amount,totalAmount,totalAmountPaid,totalAmountRemain,const DeepCollectionEquality().hash(loggedRegistrationCode),state,receiverState,allocationState,date,const DeepCollectionEquality().hash(role),const DeepCollectionEquality().hash(stewardTempKey),approvedPriceStatus,calculateStatus,temporaryTrash,temporaryDeleted,const DeepCollectionEquality().hash(createdBy),const DeepCollectionEquality().hash(modifiedBy),const DeepCollectionEquality().hash(wareHouse),const DeepCollectionEquality().hash(stewardWareHouse),const DeepCollectionEquality().hash(car),const DeepCollectionEquality().hash(dispenser)]); @override String toString() { - return 'ImportedLoadsModel(count: $count, next: $next, previous: $previous, results: $results)'; + return 'ImportedLoadsModel(id: $id, product: $product, killHouse: $killHouse, toKillHouse: $toKillHouse, steward: $steward, toSteward: $toSteward, guilds: $guilds, toGuilds: $toGuilds, toColdHouse: $toColdHouse, indexWeight: $indexWeight, dateTimestamp: $dateTimestamp, newState: $newState, newReceiverState: $newReceiverState, newAllocationState: $newAllocationState, key: $key, createDate: $createDate, modifyDate: $modifyDate, trash: $trash, numberOfCarcasses: $numberOfCarcasses, realNumberOfCarcasses: $realNumberOfCarcasses, receiverRealNumberOfCarcasses: $receiverRealNumberOfCarcasses, weightOfCarcasses: $weightOfCarcasses, realWeightOfCarcasses: $realWeightOfCarcasses, receiverRealWeightOfCarcasses: $receiverRealWeightOfCarcasses, weightLossOfCarcasses: $weightLossOfCarcasses, finalRegistration: $finalRegistration, sellType: $sellType, productName: $productName, sellerType: $sellerType, type: $type, saleType: $saleType, allocationType: $allocationType, systemRegistrationCode: $systemRegistrationCode, registrationCode: $registrationCode, amount: $amount, totalAmount: $totalAmount, totalAmountPaid: $totalAmountPaid, totalAmountRemain: $totalAmountRemain, loggedRegistrationCode: $loggedRegistrationCode, state: $state, receiverState: $receiverState, allocationState: $allocationState, date: $date, role: $role, stewardTempKey: $stewardTempKey, approvedPriceStatus: $approvedPriceStatus, calculateStatus: $calculateStatus, temporaryTrash: $temporaryTrash, temporaryDeleted: $temporaryDeleted, createdBy: $createdBy, modifiedBy: $modifiedBy, wareHouse: $wareHouse, stewardWareHouse: $stewardWareHouse, car: $car, dispenser: $dispenser)'; } @@ -49,11 +49,11 @@ abstract mixin class $ImportedLoadsModelCopyWith<$Res> { factory $ImportedLoadsModelCopyWith(ImportedLoadsModel value, $Res Function(ImportedLoadsModel) _then) = _$ImportedLoadsModelCopyWithImpl; @useResult $Res call({ - int? count, String? next, String? previous, List? results + int? id, Product? product, KillHouse? killHouse, dynamic toKillHouse, dynamic steward, ToSteward? toSteward, dynamic guilds, dynamic toGuilds, dynamic toColdHouse, int? indexWeight, int? dateTimestamp, int? newState, int? newReceiverState, int? newAllocationState, String? key, String? createDate, String? modifyDate, bool? trash, int? numberOfCarcasses, int? realNumberOfCarcasses, int? receiverRealNumberOfCarcasses, double? weightOfCarcasses, double? realWeightOfCarcasses, double? receiverRealWeightOfCarcasses, double? weightLossOfCarcasses, bool? finalRegistration, String? sellType, String? productName, String? sellerType, String? type, String? saleType, String? allocationType, bool? systemRegistrationCode, int? registrationCode, int? amount, int? totalAmount, int? totalAmountPaid, int? totalAmountRemain, dynamic loggedRegistrationCode, String? state, String? receiverState, String? allocationState, String? date, dynamic role, dynamic stewardTempKey, bool? approvedPriceStatus, bool? calculateStatus, bool? temporaryTrash, bool? temporaryDeleted, dynamic createdBy, dynamic modifiedBy, dynamic wareHouse, dynamic stewardWareHouse, dynamic car, dynamic dispenser }); - +$ProductCopyWith<$Res>? get product;$KillHouseCopyWith<$Res>? get killHouse;$ToStewardCopyWith<$Res>? get toSteward; } /// @nodoc @@ -66,156 +66,6 @@ class _$ImportedLoadsModelCopyWithImpl<$Res> /// Create a copy of ImportedLoadsModel /// with the given fields replaced by the non-null parameter values. -@pragma('vm:prefer-inline') @override $Res call({Object? count = freezed,Object? next = freezed,Object? previous = freezed,Object? results = freezed,}) { - return _then(_self.copyWith( -count: freezed == count ? _self.count : count // ignore: cast_nullable_to_non_nullable -as int?,next: freezed == next ? _self.next : next // ignore: cast_nullable_to_non_nullable -as String?,previous: freezed == previous ? _self.previous : previous // ignore: cast_nullable_to_non_nullable -as String?,results: freezed == results ? _self.results : results // ignore: cast_nullable_to_non_nullable -as List?, - )); -} - -} - - -/// @nodoc -@JsonSerializable() - -class _ImportedLoadsModel implements ImportedLoadsModel { - const _ImportedLoadsModel({this.count, this.next, this.previous, final List? results}): _results = results; - factory _ImportedLoadsModel.fromJson(Map json) => _$ImportedLoadsModelFromJson(json); - -@override final int? count; -@override final String? next; -@override final String? previous; - final List? _results; -@override List? get results { - final value = _results; - if (value == null) return null; - if (_results is EqualUnmodifiableListView) return _results; - // ignore: implicit_dynamic_type - return EqualUnmodifiableListView(value); -} - - -/// Create a copy of ImportedLoadsModel -/// with the given fields replaced by the non-null parameter values. -@override @JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -_$ImportedLoadsModelCopyWith<_ImportedLoadsModel> get copyWith => __$ImportedLoadsModelCopyWithImpl<_ImportedLoadsModel>(this, _$identity); - -@override -Map toJson() { - return _$ImportedLoadsModelToJson(this, ); -} - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is _ImportedLoadsModel&&(identical(other.count, count) || other.count == count)&&(identical(other.next, next) || other.next == next)&&(identical(other.previous, previous) || other.previous == previous)&&const DeepCollectionEquality().equals(other._results, _results)); -} - -@JsonKey(includeFromJson: false, includeToJson: false) -@override -int get hashCode => Object.hash(runtimeType,count,next,previous,const DeepCollectionEquality().hash(_results)); - -@override -String toString() { - return 'ImportedLoadsModel(count: $count, next: $next, previous: $previous, results: $results)'; -} - - -} - -/// @nodoc -abstract mixin class _$ImportedLoadsModelCopyWith<$Res> implements $ImportedLoadsModelCopyWith<$Res> { - factory _$ImportedLoadsModelCopyWith(_ImportedLoadsModel value, $Res Function(_ImportedLoadsModel) _then) = __$ImportedLoadsModelCopyWithImpl; -@override @useResult -$Res call({ - int? count, String? next, String? previous, List? results -}); - - - - -} -/// @nodoc -class __$ImportedLoadsModelCopyWithImpl<$Res> - implements _$ImportedLoadsModelCopyWith<$Res> { - __$ImportedLoadsModelCopyWithImpl(this._self, this._then); - - final _ImportedLoadsModel _self; - final $Res Function(_ImportedLoadsModel) _then; - -/// Create a copy of ImportedLoadsModel -/// with the given fields replaced by the non-null parameter values. -@override @pragma('vm:prefer-inline') $Res call({Object? count = freezed,Object? next = freezed,Object? previous = freezed,Object? results = freezed,}) { - return _then(_ImportedLoadsModel( -count: freezed == count ? _self.count : count // ignore: cast_nullable_to_non_nullable -as int?,next: freezed == next ? _self.next : next // ignore: cast_nullable_to_non_nullable -as String?,previous: freezed == previous ? _self.previous : previous // ignore: cast_nullable_to_non_nullable -as String?,results: freezed == results ? _self._results : results // ignore: cast_nullable_to_non_nullable -as List?, - )); -} - - -} - - -/// @nodoc -mixin _$ImportedLoad { - - int? get id; Product? get product; KillHouse? get killHouse; dynamic get toKillHouse; dynamic get steward; ToSteward? get toSteward; dynamic get guilds; dynamic get toGuilds; dynamic get toColdHouse; int? get indexWeight; int? get dateTimestamp; int? get newState; int? get newReceiverState; int? get newAllocationState; String? get key; String? get createDate; String? get modifyDate; bool? get trash; int? get numberOfCarcasses; int? get realNumberOfCarcasses; int? get receiverRealNumberOfCarcasses; double? get weightOfCarcasses; double? get realWeightOfCarcasses; double? get receiverRealWeightOfCarcasses; double? get weightLossOfCarcasses; bool? get finalRegistration; String? get sellType; String? get productName; String? get sellerType; String? get type; String? get saleType; String? get allocationType; bool? get systemRegistrationCode; int? get registrationCode; int? get amount; int? get totalAmount; int? get totalAmountPaid; int? get totalAmountRemain; dynamic get loggedRegistrationCode; String? get state; String? get receiverState; String? get allocationState; String? get date; dynamic get role; dynamic get stewardTempKey; bool? get approvedPriceStatus; bool? get calculateStatus; bool? get temporaryTrash; bool? get temporaryDeleted; dynamic get createdBy; dynamic get modifiedBy; dynamic get wareHouse; dynamic get stewardWareHouse; dynamic get car; dynamic get dispenser; -/// Create a copy of ImportedLoad -/// with the given fields replaced by the non-null parameter values. -@JsonKey(includeFromJson: false, includeToJson: false) -@pragma('vm:prefer-inline') -$ImportedLoadCopyWith get copyWith => _$ImportedLoadCopyWithImpl(this as ImportedLoad, _$identity); - - /// Serializes this ImportedLoad to a JSON map. - Map toJson(); - - -@override -bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is ImportedLoad&&(identical(other.id, id) || other.id == id)&&(identical(other.product, product) || other.product == product)&&(identical(other.killHouse, killHouse) || other.killHouse == killHouse)&&const DeepCollectionEquality().equals(other.toKillHouse, toKillHouse)&&const DeepCollectionEquality().equals(other.steward, steward)&&(identical(other.toSteward, toSteward) || other.toSteward == toSteward)&&const DeepCollectionEquality().equals(other.guilds, guilds)&&const DeepCollectionEquality().equals(other.toGuilds, toGuilds)&&const DeepCollectionEquality().equals(other.toColdHouse, toColdHouse)&&(identical(other.indexWeight, indexWeight) || other.indexWeight == indexWeight)&&(identical(other.dateTimestamp, dateTimestamp) || other.dateTimestamp == dateTimestamp)&&(identical(other.newState, newState) || other.newState == newState)&&(identical(other.newReceiverState, newReceiverState) || other.newReceiverState == newReceiverState)&&(identical(other.newAllocationState, newAllocationState) || other.newAllocationState == newAllocationState)&&(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.numberOfCarcasses, numberOfCarcasses) || other.numberOfCarcasses == numberOfCarcasses)&&(identical(other.realNumberOfCarcasses, realNumberOfCarcasses) || other.realNumberOfCarcasses == realNumberOfCarcasses)&&(identical(other.receiverRealNumberOfCarcasses, receiverRealNumberOfCarcasses) || other.receiverRealNumberOfCarcasses == receiverRealNumberOfCarcasses)&&(identical(other.weightOfCarcasses, weightOfCarcasses) || other.weightOfCarcasses == weightOfCarcasses)&&(identical(other.realWeightOfCarcasses, realWeightOfCarcasses) || other.realWeightOfCarcasses == realWeightOfCarcasses)&&(identical(other.receiverRealWeightOfCarcasses, receiverRealWeightOfCarcasses) || other.receiverRealWeightOfCarcasses == receiverRealWeightOfCarcasses)&&(identical(other.weightLossOfCarcasses, weightLossOfCarcasses) || other.weightLossOfCarcasses == weightLossOfCarcasses)&&(identical(other.finalRegistration, finalRegistration) || other.finalRegistration == finalRegistration)&&(identical(other.sellType, sellType) || other.sellType == sellType)&&(identical(other.productName, productName) || other.productName == productName)&&(identical(other.sellerType, sellerType) || other.sellerType == sellerType)&&(identical(other.type, type) || other.type == type)&&(identical(other.saleType, saleType) || other.saleType == saleType)&&(identical(other.allocationType, allocationType) || other.allocationType == allocationType)&&(identical(other.systemRegistrationCode, systemRegistrationCode) || other.systemRegistrationCode == systemRegistrationCode)&&(identical(other.registrationCode, registrationCode) || other.registrationCode == registrationCode)&&(identical(other.amount, amount) || other.amount == amount)&&(identical(other.totalAmount, totalAmount) || other.totalAmount == totalAmount)&&(identical(other.totalAmountPaid, totalAmountPaid) || other.totalAmountPaid == totalAmountPaid)&&(identical(other.totalAmountRemain, totalAmountRemain) || other.totalAmountRemain == totalAmountRemain)&&const DeepCollectionEquality().equals(other.loggedRegistrationCode, loggedRegistrationCode)&&(identical(other.state, state) || other.state == state)&&(identical(other.receiverState, receiverState) || other.receiverState == receiverState)&&(identical(other.allocationState, allocationState) || other.allocationState == allocationState)&&(identical(other.date, date) || other.date == date)&&const DeepCollectionEquality().equals(other.role, role)&&const DeepCollectionEquality().equals(other.stewardTempKey, stewardTempKey)&&(identical(other.approvedPriceStatus, approvedPriceStatus) || other.approvedPriceStatus == approvedPriceStatus)&&(identical(other.calculateStatus, calculateStatus) || other.calculateStatus == calculateStatus)&&(identical(other.temporaryTrash, temporaryTrash) || other.temporaryTrash == temporaryTrash)&&(identical(other.temporaryDeleted, temporaryDeleted) || other.temporaryDeleted == temporaryDeleted)&&const DeepCollectionEquality().equals(other.createdBy, createdBy)&&const DeepCollectionEquality().equals(other.modifiedBy, modifiedBy)&&const DeepCollectionEquality().equals(other.wareHouse, wareHouse)&&const DeepCollectionEquality().equals(other.stewardWareHouse, stewardWareHouse)&&const DeepCollectionEquality().equals(other.car, car)&&const DeepCollectionEquality().equals(other.dispenser, dispenser)); -} - -@JsonKey(includeFromJson: false, includeToJson: false) -@override -int get hashCode => Object.hashAll([runtimeType,id,product,killHouse,const DeepCollectionEquality().hash(toKillHouse),const DeepCollectionEquality().hash(steward),toSteward,const DeepCollectionEquality().hash(guilds),const DeepCollectionEquality().hash(toGuilds),const DeepCollectionEquality().hash(toColdHouse),indexWeight,dateTimestamp,newState,newReceiverState,newAllocationState,key,createDate,modifyDate,trash,numberOfCarcasses,realNumberOfCarcasses,receiverRealNumberOfCarcasses,weightOfCarcasses,realWeightOfCarcasses,receiverRealWeightOfCarcasses,weightLossOfCarcasses,finalRegistration,sellType,productName,sellerType,type,saleType,allocationType,systemRegistrationCode,registrationCode,amount,totalAmount,totalAmountPaid,totalAmountRemain,const DeepCollectionEquality().hash(loggedRegistrationCode),state,receiverState,allocationState,date,const DeepCollectionEquality().hash(role),const DeepCollectionEquality().hash(stewardTempKey),approvedPriceStatus,calculateStatus,temporaryTrash,temporaryDeleted,const DeepCollectionEquality().hash(createdBy),const DeepCollectionEquality().hash(modifiedBy),const DeepCollectionEquality().hash(wareHouse),const DeepCollectionEquality().hash(stewardWareHouse),const DeepCollectionEquality().hash(car),const DeepCollectionEquality().hash(dispenser)]); - -@override -String toString() { - return 'ImportedLoad(id: $id, product: $product, killHouse: $killHouse, toKillHouse: $toKillHouse, steward: $steward, toSteward: $toSteward, guilds: $guilds, toGuilds: $toGuilds, toColdHouse: $toColdHouse, indexWeight: $indexWeight, dateTimestamp: $dateTimestamp, newState: $newState, newReceiverState: $newReceiverState, newAllocationState: $newAllocationState, key: $key, createDate: $createDate, modifyDate: $modifyDate, trash: $trash, numberOfCarcasses: $numberOfCarcasses, realNumberOfCarcasses: $realNumberOfCarcasses, receiverRealNumberOfCarcasses: $receiverRealNumberOfCarcasses, weightOfCarcasses: $weightOfCarcasses, realWeightOfCarcasses: $realWeightOfCarcasses, receiverRealWeightOfCarcasses: $receiverRealWeightOfCarcasses, weightLossOfCarcasses: $weightLossOfCarcasses, finalRegistration: $finalRegistration, sellType: $sellType, productName: $productName, sellerType: $sellerType, type: $type, saleType: $saleType, allocationType: $allocationType, systemRegistrationCode: $systemRegistrationCode, registrationCode: $registrationCode, amount: $amount, totalAmount: $totalAmount, totalAmountPaid: $totalAmountPaid, totalAmountRemain: $totalAmountRemain, loggedRegistrationCode: $loggedRegistrationCode, state: $state, receiverState: $receiverState, allocationState: $allocationState, date: $date, role: $role, stewardTempKey: $stewardTempKey, approvedPriceStatus: $approvedPriceStatus, calculateStatus: $calculateStatus, temporaryTrash: $temporaryTrash, temporaryDeleted: $temporaryDeleted, createdBy: $createdBy, modifiedBy: $modifiedBy, wareHouse: $wareHouse, stewardWareHouse: $stewardWareHouse, car: $car, dispenser: $dispenser)'; -} - - -} - -/// @nodoc -abstract mixin class $ImportedLoadCopyWith<$Res> { - factory $ImportedLoadCopyWith(ImportedLoad value, $Res Function(ImportedLoad) _then) = _$ImportedLoadCopyWithImpl; -@useResult -$Res call({ - int? id, Product? product, KillHouse? killHouse, dynamic toKillHouse, dynamic steward, ToSteward? toSteward, dynamic guilds, dynamic toGuilds, dynamic toColdHouse, int? indexWeight, int? dateTimestamp, int? newState, int? newReceiverState, int? newAllocationState, String? key, String? createDate, String? modifyDate, bool? trash, int? numberOfCarcasses, int? realNumberOfCarcasses, int? receiverRealNumberOfCarcasses, double? weightOfCarcasses, double? realWeightOfCarcasses, double? receiverRealWeightOfCarcasses, double? weightLossOfCarcasses, bool? finalRegistration, String? sellType, String? productName, String? sellerType, String? type, String? saleType, String? allocationType, bool? systemRegistrationCode, int? registrationCode, int? amount, int? totalAmount, int? totalAmountPaid, int? totalAmountRemain, dynamic loggedRegistrationCode, String? state, String? receiverState, String? allocationState, String? date, dynamic role, dynamic stewardTempKey, bool? approvedPriceStatus, bool? calculateStatus, bool? temporaryTrash, bool? temporaryDeleted, dynamic createdBy, dynamic modifiedBy, dynamic wareHouse, dynamic stewardWareHouse, dynamic car, dynamic dispenser -}); - - -$ProductCopyWith<$Res>? get product;$KillHouseCopyWith<$Res>? get killHouse;$ToStewardCopyWith<$Res>? get toSteward; - -} -/// @nodoc -class _$ImportedLoadCopyWithImpl<$Res> - implements $ImportedLoadCopyWith<$Res> { - _$ImportedLoadCopyWithImpl(this._self, this._then); - - final ImportedLoad _self; - final $Res Function(ImportedLoad) _then; - -/// Create a copy of ImportedLoad -/// with the given fields replaced by the non-null parameter values. @pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? product = freezed,Object? killHouse = freezed,Object? toKillHouse = freezed,Object? steward = freezed,Object? toSteward = freezed,Object? guilds = freezed,Object? toGuilds = freezed,Object? toColdHouse = freezed,Object? indexWeight = freezed,Object? dateTimestamp = freezed,Object? newState = freezed,Object? newReceiverState = freezed,Object? newAllocationState = freezed,Object? key = freezed,Object? createDate = freezed,Object? modifyDate = freezed,Object? trash = freezed,Object? numberOfCarcasses = freezed,Object? realNumberOfCarcasses = freezed,Object? receiverRealNumberOfCarcasses = freezed,Object? weightOfCarcasses = freezed,Object? realWeightOfCarcasses = freezed,Object? receiverRealWeightOfCarcasses = freezed,Object? weightLossOfCarcasses = freezed,Object? finalRegistration = freezed,Object? sellType = freezed,Object? productName = freezed,Object? sellerType = freezed,Object? type = freezed,Object? saleType = freezed,Object? allocationType = freezed,Object? systemRegistrationCode = freezed,Object? registrationCode = freezed,Object? amount = freezed,Object? totalAmount = freezed,Object? totalAmountPaid = freezed,Object? totalAmountRemain = freezed,Object? loggedRegistrationCode = freezed,Object? state = freezed,Object? receiverState = freezed,Object? allocationState = freezed,Object? date = freezed,Object? role = freezed,Object? stewardTempKey = freezed,Object? approvedPriceStatus = freezed,Object? calculateStatus = freezed,Object? temporaryTrash = freezed,Object? temporaryDeleted = freezed,Object? createdBy = freezed,Object? modifiedBy = freezed,Object? wareHouse = freezed,Object? stewardWareHouse = freezed,Object? car = freezed,Object? dispenser = freezed,}) { return _then(_self.copyWith( id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable @@ -276,7 +126,7 @@ as dynamic,dispenser: freezed == dispenser ? _self.dispenser : dispenser // igno as dynamic, )); } -/// Create a copy of ImportedLoad +/// Create a copy of ImportedLoadsModel /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') @@ -288,7 +138,7 @@ $ProductCopyWith<$Res>? get product { return $ProductCopyWith<$Res>(_self.product!, (value) { return _then(_self.copyWith(product: value)); }); -}/// Create a copy of ImportedLoad +}/// Create a copy of ImportedLoadsModel /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') @@ -300,7 +150,7 @@ $KillHouseCopyWith<$Res>? get killHouse { return $KillHouseCopyWith<$Res>(_self.killHouse!, (value) { return _then(_self.copyWith(killHouse: value)); }); -}/// Create a copy of ImportedLoad +}/// Create a copy of ImportedLoadsModel /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') @@ -319,9 +169,9 @@ $ToStewardCopyWith<$Res>? get toSteward { /// @nodoc @JsonSerializable() -class _ImportedLoad implements ImportedLoad { - const _ImportedLoad({this.id, this.product, this.killHouse, this.toKillHouse, this.steward, this.toSteward, this.guilds, this.toGuilds, this.toColdHouse, this.indexWeight, this.dateTimestamp, this.newState, this.newReceiverState, this.newAllocationState, this.key, this.createDate, this.modifyDate, this.trash, this.numberOfCarcasses, this.realNumberOfCarcasses, this.receiverRealNumberOfCarcasses, this.weightOfCarcasses, this.realWeightOfCarcasses, this.receiverRealWeightOfCarcasses, this.weightLossOfCarcasses, this.finalRegistration, this.sellType, this.productName, this.sellerType, this.type, this.saleType, this.allocationType, this.systemRegistrationCode, this.registrationCode, this.amount, this.totalAmount, this.totalAmountPaid, this.totalAmountRemain, this.loggedRegistrationCode, this.state, this.receiverState, this.allocationState, this.date, this.role, this.stewardTempKey, this.approvedPriceStatus, this.calculateStatus, this.temporaryTrash, this.temporaryDeleted, this.createdBy, this.modifiedBy, this.wareHouse, this.stewardWareHouse, this.car, this.dispenser}); - factory _ImportedLoad.fromJson(Map json) => _$ImportedLoadFromJson(json); +class _ImportedLoadsModel implements ImportedLoadsModel { + const _ImportedLoadsModel({this.id, this.product, this.killHouse, this.toKillHouse, this.steward, this.toSteward, this.guilds, this.toGuilds, this.toColdHouse, this.indexWeight, this.dateTimestamp, this.newState, this.newReceiverState, this.newAllocationState, this.key, this.createDate, this.modifyDate, this.trash, this.numberOfCarcasses, this.realNumberOfCarcasses, this.receiverRealNumberOfCarcasses, this.weightOfCarcasses, this.realWeightOfCarcasses, this.receiverRealWeightOfCarcasses, this.weightLossOfCarcasses, this.finalRegistration, this.sellType, this.productName, this.sellerType, this.type, this.saleType, this.allocationType, this.systemRegistrationCode, this.registrationCode, this.amount, this.totalAmount, this.totalAmountPaid, this.totalAmountRemain, this.loggedRegistrationCode, this.state, this.receiverState, this.allocationState, this.date, this.role, this.stewardTempKey, this.approvedPriceStatus, this.calculateStatus, this.temporaryTrash, this.temporaryDeleted, this.createdBy, this.modifiedBy, this.wareHouse, this.stewardWareHouse, this.car, this.dispenser}); + factory _ImportedLoadsModel.fromJson(Map json) => _$ImportedLoadsModelFromJson(json); @override final int? id; @override final Product? product; @@ -379,20 +229,20 @@ class _ImportedLoad implements ImportedLoad { @override final dynamic car; @override final dynamic dispenser; -/// Create a copy of ImportedLoad +/// Create a copy of ImportedLoadsModel /// with the given fields replaced by the non-null parameter values. @override @JsonKey(includeFromJson: false, includeToJson: false) @pragma('vm:prefer-inline') -_$ImportedLoadCopyWith<_ImportedLoad> get copyWith => __$ImportedLoadCopyWithImpl<_ImportedLoad>(this, _$identity); +_$ImportedLoadsModelCopyWith<_ImportedLoadsModel> get copyWith => __$ImportedLoadsModelCopyWithImpl<_ImportedLoadsModel>(this, _$identity); @override Map toJson() { - return _$ImportedLoadToJson(this, ); + return _$ImportedLoadsModelToJson(this, ); } @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is _ImportedLoad&&(identical(other.id, id) || other.id == id)&&(identical(other.product, product) || other.product == product)&&(identical(other.killHouse, killHouse) || other.killHouse == killHouse)&&const DeepCollectionEquality().equals(other.toKillHouse, toKillHouse)&&const DeepCollectionEquality().equals(other.steward, steward)&&(identical(other.toSteward, toSteward) || other.toSteward == toSteward)&&const DeepCollectionEquality().equals(other.guilds, guilds)&&const DeepCollectionEquality().equals(other.toGuilds, toGuilds)&&const DeepCollectionEquality().equals(other.toColdHouse, toColdHouse)&&(identical(other.indexWeight, indexWeight) || other.indexWeight == indexWeight)&&(identical(other.dateTimestamp, dateTimestamp) || other.dateTimestamp == dateTimestamp)&&(identical(other.newState, newState) || other.newState == newState)&&(identical(other.newReceiverState, newReceiverState) || other.newReceiverState == newReceiverState)&&(identical(other.newAllocationState, newAllocationState) || other.newAllocationState == newAllocationState)&&(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.numberOfCarcasses, numberOfCarcasses) || other.numberOfCarcasses == numberOfCarcasses)&&(identical(other.realNumberOfCarcasses, realNumberOfCarcasses) || other.realNumberOfCarcasses == realNumberOfCarcasses)&&(identical(other.receiverRealNumberOfCarcasses, receiverRealNumberOfCarcasses) || other.receiverRealNumberOfCarcasses == receiverRealNumberOfCarcasses)&&(identical(other.weightOfCarcasses, weightOfCarcasses) || other.weightOfCarcasses == weightOfCarcasses)&&(identical(other.realWeightOfCarcasses, realWeightOfCarcasses) || other.realWeightOfCarcasses == realWeightOfCarcasses)&&(identical(other.receiverRealWeightOfCarcasses, receiverRealWeightOfCarcasses) || other.receiverRealWeightOfCarcasses == receiverRealWeightOfCarcasses)&&(identical(other.weightLossOfCarcasses, weightLossOfCarcasses) || other.weightLossOfCarcasses == weightLossOfCarcasses)&&(identical(other.finalRegistration, finalRegistration) || other.finalRegistration == finalRegistration)&&(identical(other.sellType, sellType) || other.sellType == sellType)&&(identical(other.productName, productName) || other.productName == productName)&&(identical(other.sellerType, sellerType) || other.sellerType == sellerType)&&(identical(other.type, type) || other.type == type)&&(identical(other.saleType, saleType) || other.saleType == saleType)&&(identical(other.allocationType, allocationType) || other.allocationType == allocationType)&&(identical(other.systemRegistrationCode, systemRegistrationCode) || other.systemRegistrationCode == systemRegistrationCode)&&(identical(other.registrationCode, registrationCode) || other.registrationCode == registrationCode)&&(identical(other.amount, amount) || other.amount == amount)&&(identical(other.totalAmount, totalAmount) || other.totalAmount == totalAmount)&&(identical(other.totalAmountPaid, totalAmountPaid) || other.totalAmountPaid == totalAmountPaid)&&(identical(other.totalAmountRemain, totalAmountRemain) || other.totalAmountRemain == totalAmountRemain)&&const DeepCollectionEquality().equals(other.loggedRegistrationCode, loggedRegistrationCode)&&(identical(other.state, state) || other.state == state)&&(identical(other.receiverState, receiverState) || other.receiverState == receiverState)&&(identical(other.allocationState, allocationState) || other.allocationState == allocationState)&&(identical(other.date, date) || other.date == date)&&const DeepCollectionEquality().equals(other.role, role)&&const DeepCollectionEquality().equals(other.stewardTempKey, stewardTempKey)&&(identical(other.approvedPriceStatus, approvedPriceStatus) || other.approvedPriceStatus == approvedPriceStatus)&&(identical(other.calculateStatus, calculateStatus) || other.calculateStatus == calculateStatus)&&(identical(other.temporaryTrash, temporaryTrash) || other.temporaryTrash == temporaryTrash)&&(identical(other.temporaryDeleted, temporaryDeleted) || other.temporaryDeleted == temporaryDeleted)&&const DeepCollectionEquality().equals(other.createdBy, createdBy)&&const DeepCollectionEquality().equals(other.modifiedBy, modifiedBy)&&const DeepCollectionEquality().equals(other.wareHouse, wareHouse)&&const DeepCollectionEquality().equals(other.stewardWareHouse, stewardWareHouse)&&const DeepCollectionEquality().equals(other.car, car)&&const DeepCollectionEquality().equals(other.dispenser, dispenser)); + return identical(this, other) || (other.runtimeType == runtimeType&&other is _ImportedLoadsModel&&(identical(other.id, id) || other.id == id)&&(identical(other.product, product) || other.product == product)&&(identical(other.killHouse, killHouse) || other.killHouse == killHouse)&&const DeepCollectionEquality().equals(other.toKillHouse, toKillHouse)&&const DeepCollectionEquality().equals(other.steward, steward)&&(identical(other.toSteward, toSteward) || other.toSteward == toSteward)&&const DeepCollectionEquality().equals(other.guilds, guilds)&&const DeepCollectionEquality().equals(other.toGuilds, toGuilds)&&const DeepCollectionEquality().equals(other.toColdHouse, toColdHouse)&&(identical(other.indexWeight, indexWeight) || other.indexWeight == indexWeight)&&(identical(other.dateTimestamp, dateTimestamp) || other.dateTimestamp == dateTimestamp)&&(identical(other.newState, newState) || other.newState == newState)&&(identical(other.newReceiverState, newReceiverState) || other.newReceiverState == newReceiverState)&&(identical(other.newAllocationState, newAllocationState) || other.newAllocationState == newAllocationState)&&(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.numberOfCarcasses, numberOfCarcasses) || other.numberOfCarcasses == numberOfCarcasses)&&(identical(other.realNumberOfCarcasses, realNumberOfCarcasses) || other.realNumberOfCarcasses == realNumberOfCarcasses)&&(identical(other.receiverRealNumberOfCarcasses, receiverRealNumberOfCarcasses) || other.receiverRealNumberOfCarcasses == receiverRealNumberOfCarcasses)&&(identical(other.weightOfCarcasses, weightOfCarcasses) || other.weightOfCarcasses == weightOfCarcasses)&&(identical(other.realWeightOfCarcasses, realWeightOfCarcasses) || other.realWeightOfCarcasses == realWeightOfCarcasses)&&(identical(other.receiverRealWeightOfCarcasses, receiverRealWeightOfCarcasses) || other.receiverRealWeightOfCarcasses == receiverRealWeightOfCarcasses)&&(identical(other.weightLossOfCarcasses, weightLossOfCarcasses) || other.weightLossOfCarcasses == weightLossOfCarcasses)&&(identical(other.finalRegistration, finalRegistration) || other.finalRegistration == finalRegistration)&&(identical(other.sellType, sellType) || other.sellType == sellType)&&(identical(other.productName, productName) || other.productName == productName)&&(identical(other.sellerType, sellerType) || other.sellerType == sellerType)&&(identical(other.type, type) || other.type == type)&&(identical(other.saleType, saleType) || other.saleType == saleType)&&(identical(other.allocationType, allocationType) || other.allocationType == allocationType)&&(identical(other.systemRegistrationCode, systemRegistrationCode) || other.systemRegistrationCode == systemRegistrationCode)&&(identical(other.registrationCode, registrationCode) || other.registrationCode == registrationCode)&&(identical(other.amount, amount) || other.amount == amount)&&(identical(other.totalAmount, totalAmount) || other.totalAmount == totalAmount)&&(identical(other.totalAmountPaid, totalAmountPaid) || other.totalAmountPaid == totalAmountPaid)&&(identical(other.totalAmountRemain, totalAmountRemain) || other.totalAmountRemain == totalAmountRemain)&&const DeepCollectionEquality().equals(other.loggedRegistrationCode, loggedRegistrationCode)&&(identical(other.state, state) || other.state == state)&&(identical(other.receiverState, receiverState) || other.receiverState == receiverState)&&(identical(other.allocationState, allocationState) || other.allocationState == allocationState)&&(identical(other.date, date) || other.date == date)&&const DeepCollectionEquality().equals(other.role, role)&&const DeepCollectionEquality().equals(other.stewardTempKey, stewardTempKey)&&(identical(other.approvedPriceStatus, approvedPriceStatus) || other.approvedPriceStatus == approvedPriceStatus)&&(identical(other.calculateStatus, calculateStatus) || other.calculateStatus == calculateStatus)&&(identical(other.temporaryTrash, temporaryTrash) || other.temporaryTrash == temporaryTrash)&&(identical(other.temporaryDeleted, temporaryDeleted) || other.temporaryDeleted == temporaryDeleted)&&const DeepCollectionEquality().equals(other.createdBy, createdBy)&&const DeepCollectionEquality().equals(other.modifiedBy, modifiedBy)&&const DeepCollectionEquality().equals(other.wareHouse, wareHouse)&&const DeepCollectionEquality().equals(other.stewardWareHouse, stewardWareHouse)&&const DeepCollectionEquality().equals(other.car, car)&&const DeepCollectionEquality().equals(other.dispenser, dispenser)); } @JsonKey(includeFromJson: false, includeToJson: false) @@ -401,15 +251,15 @@ int get hashCode => Object.hashAll([runtimeType,id,product,killHouse,const DeepC @override String toString() { - return 'ImportedLoad(id: $id, product: $product, killHouse: $killHouse, toKillHouse: $toKillHouse, steward: $steward, toSteward: $toSteward, guilds: $guilds, toGuilds: $toGuilds, toColdHouse: $toColdHouse, indexWeight: $indexWeight, dateTimestamp: $dateTimestamp, newState: $newState, newReceiverState: $newReceiverState, newAllocationState: $newAllocationState, key: $key, createDate: $createDate, modifyDate: $modifyDate, trash: $trash, numberOfCarcasses: $numberOfCarcasses, realNumberOfCarcasses: $realNumberOfCarcasses, receiverRealNumberOfCarcasses: $receiverRealNumberOfCarcasses, weightOfCarcasses: $weightOfCarcasses, realWeightOfCarcasses: $realWeightOfCarcasses, receiverRealWeightOfCarcasses: $receiverRealWeightOfCarcasses, weightLossOfCarcasses: $weightLossOfCarcasses, finalRegistration: $finalRegistration, sellType: $sellType, productName: $productName, sellerType: $sellerType, type: $type, saleType: $saleType, allocationType: $allocationType, systemRegistrationCode: $systemRegistrationCode, registrationCode: $registrationCode, amount: $amount, totalAmount: $totalAmount, totalAmountPaid: $totalAmountPaid, totalAmountRemain: $totalAmountRemain, loggedRegistrationCode: $loggedRegistrationCode, state: $state, receiverState: $receiverState, allocationState: $allocationState, date: $date, role: $role, stewardTempKey: $stewardTempKey, approvedPriceStatus: $approvedPriceStatus, calculateStatus: $calculateStatus, temporaryTrash: $temporaryTrash, temporaryDeleted: $temporaryDeleted, createdBy: $createdBy, modifiedBy: $modifiedBy, wareHouse: $wareHouse, stewardWareHouse: $stewardWareHouse, car: $car, dispenser: $dispenser)'; + return 'ImportedLoadsModel(id: $id, product: $product, killHouse: $killHouse, toKillHouse: $toKillHouse, steward: $steward, toSteward: $toSteward, guilds: $guilds, toGuilds: $toGuilds, toColdHouse: $toColdHouse, indexWeight: $indexWeight, dateTimestamp: $dateTimestamp, newState: $newState, newReceiverState: $newReceiverState, newAllocationState: $newAllocationState, key: $key, createDate: $createDate, modifyDate: $modifyDate, trash: $trash, numberOfCarcasses: $numberOfCarcasses, realNumberOfCarcasses: $realNumberOfCarcasses, receiverRealNumberOfCarcasses: $receiverRealNumberOfCarcasses, weightOfCarcasses: $weightOfCarcasses, realWeightOfCarcasses: $realWeightOfCarcasses, receiverRealWeightOfCarcasses: $receiverRealWeightOfCarcasses, weightLossOfCarcasses: $weightLossOfCarcasses, finalRegistration: $finalRegistration, sellType: $sellType, productName: $productName, sellerType: $sellerType, type: $type, saleType: $saleType, allocationType: $allocationType, systemRegistrationCode: $systemRegistrationCode, registrationCode: $registrationCode, amount: $amount, totalAmount: $totalAmount, totalAmountPaid: $totalAmountPaid, totalAmountRemain: $totalAmountRemain, loggedRegistrationCode: $loggedRegistrationCode, state: $state, receiverState: $receiverState, allocationState: $allocationState, date: $date, role: $role, stewardTempKey: $stewardTempKey, approvedPriceStatus: $approvedPriceStatus, calculateStatus: $calculateStatus, temporaryTrash: $temporaryTrash, temporaryDeleted: $temporaryDeleted, createdBy: $createdBy, modifiedBy: $modifiedBy, wareHouse: $wareHouse, stewardWareHouse: $stewardWareHouse, car: $car, dispenser: $dispenser)'; } } /// @nodoc -abstract mixin class _$ImportedLoadCopyWith<$Res> implements $ImportedLoadCopyWith<$Res> { - factory _$ImportedLoadCopyWith(_ImportedLoad value, $Res Function(_ImportedLoad) _then) = __$ImportedLoadCopyWithImpl; +abstract mixin class _$ImportedLoadsModelCopyWith<$Res> implements $ImportedLoadsModelCopyWith<$Res> { + factory _$ImportedLoadsModelCopyWith(_ImportedLoadsModel value, $Res Function(_ImportedLoadsModel) _then) = __$ImportedLoadsModelCopyWithImpl; @override @useResult $Res call({ int? id, Product? product, KillHouse? killHouse, dynamic toKillHouse, dynamic steward, ToSteward? toSteward, dynamic guilds, dynamic toGuilds, dynamic toColdHouse, int? indexWeight, int? dateTimestamp, int? newState, int? newReceiverState, int? newAllocationState, String? key, String? createDate, String? modifyDate, bool? trash, int? numberOfCarcasses, int? realNumberOfCarcasses, int? receiverRealNumberOfCarcasses, double? weightOfCarcasses, double? realWeightOfCarcasses, double? receiverRealWeightOfCarcasses, double? weightLossOfCarcasses, bool? finalRegistration, String? sellType, String? productName, String? sellerType, String? type, String? saleType, String? allocationType, bool? systemRegistrationCode, int? registrationCode, int? amount, int? totalAmount, int? totalAmountPaid, int? totalAmountRemain, dynamic loggedRegistrationCode, String? state, String? receiverState, String? allocationState, String? date, dynamic role, dynamic stewardTempKey, bool? approvedPriceStatus, bool? calculateStatus, bool? temporaryTrash, bool? temporaryDeleted, dynamic createdBy, dynamic modifiedBy, dynamic wareHouse, dynamic stewardWareHouse, dynamic car, dynamic dispenser @@ -420,17 +270,17 @@ $Res call({ } /// @nodoc -class __$ImportedLoadCopyWithImpl<$Res> - implements _$ImportedLoadCopyWith<$Res> { - __$ImportedLoadCopyWithImpl(this._self, this._then); +class __$ImportedLoadsModelCopyWithImpl<$Res> + implements _$ImportedLoadsModelCopyWith<$Res> { + __$ImportedLoadsModelCopyWithImpl(this._self, this._then); - final _ImportedLoad _self; - final $Res Function(_ImportedLoad) _then; + final _ImportedLoadsModel _self; + final $Res Function(_ImportedLoadsModel) _then; -/// Create a copy of ImportedLoad +/// Create a copy of ImportedLoadsModel /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? product = freezed,Object? killHouse = freezed,Object? toKillHouse = freezed,Object? steward = freezed,Object? toSteward = freezed,Object? guilds = freezed,Object? toGuilds = freezed,Object? toColdHouse = freezed,Object? indexWeight = freezed,Object? dateTimestamp = freezed,Object? newState = freezed,Object? newReceiverState = freezed,Object? newAllocationState = freezed,Object? key = freezed,Object? createDate = freezed,Object? modifyDate = freezed,Object? trash = freezed,Object? numberOfCarcasses = freezed,Object? realNumberOfCarcasses = freezed,Object? receiverRealNumberOfCarcasses = freezed,Object? weightOfCarcasses = freezed,Object? realWeightOfCarcasses = freezed,Object? receiverRealWeightOfCarcasses = freezed,Object? weightLossOfCarcasses = freezed,Object? finalRegistration = freezed,Object? sellType = freezed,Object? productName = freezed,Object? sellerType = freezed,Object? type = freezed,Object? saleType = freezed,Object? allocationType = freezed,Object? systemRegistrationCode = freezed,Object? registrationCode = freezed,Object? amount = freezed,Object? totalAmount = freezed,Object? totalAmountPaid = freezed,Object? totalAmountRemain = freezed,Object? loggedRegistrationCode = freezed,Object? state = freezed,Object? receiverState = freezed,Object? allocationState = freezed,Object? date = freezed,Object? role = freezed,Object? stewardTempKey = freezed,Object? approvedPriceStatus = freezed,Object? calculateStatus = freezed,Object? temporaryTrash = freezed,Object? temporaryDeleted = freezed,Object? createdBy = freezed,Object? modifiedBy = freezed,Object? wareHouse = freezed,Object? stewardWareHouse = freezed,Object? car = freezed,Object? dispenser = freezed,}) { - return _then(_ImportedLoad( + return _then(_ImportedLoadsModel( id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable as int?,product: freezed == product ? _self.product : product // ignore: cast_nullable_to_non_nullable as Product?,killHouse: freezed == killHouse ? _self.killHouse : killHouse // ignore: cast_nullable_to_non_nullable @@ -490,7 +340,7 @@ as dynamic, )); } -/// Create a copy of ImportedLoad +/// Create a copy of ImportedLoadsModel /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') @@ -502,7 +352,7 @@ $ProductCopyWith<$Res>? get product { return $ProductCopyWith<$Res>(_self.product!, (value) { return _then(_self.copyWith(product: value)); }); -}/// Create a copy of ImportedLoad +}/// Create a copy of ImportedLoadsModel /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') @@ -514,7 +364,7 @@ $KillHouseCopyWith<$Res>? get killHouse { return $KillHouseCopyWith<$Res>(_self.killHouse!, (value) { return _then(_self.copyWith(killHouse: value)); }); -}/// Create a copy of ImportedLoad +}/// Create a copy of ImportedLoadsModel /// with the given fields replaced by the non-null parameter values. @override @pragma('vm:prefer-inline') diff --git a/packages/chicken/lib/data/models/response/imported_loads_model/imported_loads_model.g.dart b/packages/chicken/lib/data/models/response/imported_loads_model/imported_loads_model.g.dart index 99edf28..30d28f0 100644 --- a/packages/chicken/lib/data/models/response/imported_loads_model/imported_loads_model.g.dart +++ b/packages/chicken/lib/data/models/response/imported_loads_model/imported_loads_model.g.dart @@ -6,27 +6,9 @@ part of 'imported_loads_model.dart'; // JsonSerializableGenerator // ************************************************************************** -_ImportedLoadsModel _$ImportedLoadsModelFromJson(Map json) => - _ImportedLoadsModel( - count: (json['count'] as num?)?.toInt(), - next: json['next'] as String?, - previous: json['previous'] as String?, - results: (json['results'] as List?) - ?.map((e) => ImportedLoad.fromJson(e as Map)) - .toList(), - ); - -Map _$ImportedLoadsModelToJson(_ImportedLoadsModel instance) => - { - 'count': instance.count, - 'next': instance.next, - 'previous': instance.previous, - 'results': instance.results, - }; - -_ImportedLoad _$ImportedLoadFromJson( +_ImportedLoadsModel _$ImportedLoadsModelFromJson( Map json, -) => _ImportedLoad( +) => _ImportedLoadsModel( id: (json['id'] as num?)?.toInt(), product: json['product'] == null ? null @@ -92,8 +74,8 @@ _ImportedLoad _$ImportedLoadFromJson( dispenser: json['dispenser'], ); -Map _$ImportedLoadToJson( - _ImportedLoad instance, +Map _$ImportedLoadsModelToJson( + _ImportedLoadsModel instance, ) => { 'id': instance.id, 'product': instance.product, diff --git a/packages/chicken/lib/data/repositories/chicken_repository.dart b/packages/chicken/lib/data/repositories/chicken_repository.dart index 654dbca..6692f5f 100644 --- a/packages/chicken/lib/data/repositories/chicken_repository.dart +++ b/packages/chicken/lib/data/repositories/chicken_repository.dart @@ -43,9 +43,9 @@ abstract class ChickenRepository { required Map request, }); - Future getImportedLoadsModel({ + Future?> getImportedLoadsModel({ required String token, - required int page, + Map? queryParameters, }); Future?> getAllocatedMade({ diff --git a/packages/chicken/lib/data/repositories/chicken_repository_imp.dart b/packages/chicken/lib/data/repositories/chicken_repository_imp.dart index 3e948d4..9fe9fae 100644 --- a/packages/chicken/lib/data/repositories/chicken_repository_imp.dart +++ b/packages/chicken/lib/data/repositories/chicken_repository_imp.dart @@ -95,14 +95,18 @@ class ChickenRepositoryImpl implements ChickenRepository { } @override - Future getImportedLoadsModel({ + Future?> getImportedLoadsModel({ required String token, - required int page, + Map? queryParameters, }) async { var res = await _httpClient.get( - '/steward-allocation/?role=Steward&search=filter&page=$page&page_size=10&value=&type=entered', + '/steward-allocation/', + queryParameters: queryParameters, headers: {'Authorization': 'Bearer $token'}, - fromJson: ImportedLoadsModel.fromJson, + fromJson: (json) => PaginationModel.fromJson( + json, + (data) => ImportedLoadsModel.fromJson(data as Map), + ), ); return res.data; } diff --git a/packages/chicken/lib/presentation/pages/buy_in_province/logic.dart b/packages/chicken/lib/presentation/pages/buy_in_province/logic.dart index 65a11bc..6bc5f5b 100644 --- a/packages/chicken/lib/presentation/pages/buy_in_province/logic.dart +++ b/packages/chicken/lib/presentation/pages/buy_in_province/logic.dart @@ -1,31 +1,39 @@ - - -import 'package:flutter/material.dart'; import 'package:rasadyar_chicken/presentation/pages/buy/logic.dart'; +import 'package:rasadyar_chicken/presentation/pages/buy_in_province_all/logic.dart'; +import 'package:rasadyar_chicken/presentation/pages/buy_in_province_waiting/logic.dart'; import 'package:rasadyar_chicken/presentation/pages/root/logic.dart'; import 'package:rasadyar_core/core.dart'; class BuyInProvinceLogic extends GetxController { - RxList routesName = RxList(); + RxList routesName = RxList(); RxList isExpandedList = [].obs; RxnString searchedValue = RxnString(); Rx fromDateFilter = Jalali.now().obs; Rx toDateFilter = Jalali.now().obs; + RootLogic get rootLogic => Get.find(); + BuyLogic get buyLogic => Get.find(); RxInt selectedSegmentIndex = 0.obs; + BuyInProvinceAllLogic buyAllLogic = Get.find(); + BuyInProvinceWaitingLogic buyWaitingLogic = Get.find(); + @override void onInit() { super.onInit(); routesName.value = [...buyLogic.routesName, 'داخل استان'].toList(); - routesName.add(selectedSegmentIndex.value ==0 ? 'در انتظار':'همه'); + routesName.add(selectedSegmentIndex.value == 0 ? 'در انتظار' : 'همه'); ever(selectedSegmentIndex, (callback) { routesName.removeLast(); - routesName.add(callback ==0 ? 'در انتظار':'همه'); - },); + routesName.add(callback == 0 ? 'در انتظار' : 'همه'); + }); + + ever(fromDateFilter, (callback) => _setFromDateFilter(callback)); + ever(toDateFilter, (callback) => _setToDateFilter(callback)); } + @override void onReady() { // TODO: implement onReady @@ -38,8 +46,40 @@ class BuyInProvinceLogic extends GetxController { super.onClose(); } + void _setFromDateFilter(Jalali jalali) { + final isWaiting = selectedSegmentIndex.value == 0; + if (isWaiting) { + buyWaitingLogic.fromDateFilter.value = fromDateFilter.value; + } else { + buyAllLogic.fromDateFilter.value = fromDateFilter.value; + } + } + + void _setToDateFilter(Jalali jalali) { + final isWaiting = selectedSegmentIndex.value == 0; + if (isWaiting) { + buyWaitingLogic.toDateFilter.value = fromDateFilter.value; + } else { + buyAllLogic.toDateFilter.value = fromDateFilter.value; + } + } + + Future submitFilter() async { + final isWaiting = selectedSegmentIndex.value == 0; + if (isWaiting) { + buyWaitingLogic.getWaitingArrivals(); + } else { + buyAllLogic.getImportedEntries(); + } + } + void setSearchValue(String? data) { searchedValue.value = data?.trim(); - //TODO + final isWaiting = selectedSegmentIndex.value == 0; + if (isWaiting) { + buyWaitingLogic.searchedValue.value = searchedValue.value; + } else { + buyAllLogic.searchedValue.value = searchedValue.value; + } } } diff --git a/packages/chicken/lib/presentation/pages/buy_in_province/view.dart b/packages/chicken/lib/presentation/pages/buy_in_province/view.dart index 2ca51d6..9c19ef3 100644 --- a/packages/chicken/lib/presentation/pages/buy_in_province/view.dart +++ b/packages/chicken/lib/presentation/pages/buy_in_province/view.dart @@ -16,7 +16,7 @@ class BuyInProvincePage extends GetView { routesWidget: ObxValue((route) => buildPageRoute(route), controller.routesName), onBackPressed: () => Get.back(id: 0), onSearchChanged: (data) => controller.setSearchValue(data), - filteringWidget: Container(color: Colors.redAccent), + filteringWidget: filterBottomSheet(), widgets: [ segmentWidget(), ObxValue((index) { @@ -48,4 +48,44 @@ class BuyInProvincePage extends GetView { ), ); } + + Widget filterBottomSheet() { + return BaseBottomSheet( + height: 250, + child: Column( + spacing: 16, + children: [ + Text('فیلترها', style: AppFonts.yekan16Bold.copyWith(color: AppColor.darkGreyDarkHover)), + Row( + spacing: 8, + children: [ + Expanded( + child: dateFilterWidget( + date: controller.fromDateFilter, + onChanged: (jalali) => controller.fromDateFilter.value = jalali, + ), + ), + Expanded( + child: dateFilterWidget( + isFrom: false, + date: controller.toDateFilter, + onChanged: (jalali) => controller.toDateFilter.value = jalali, + ), + ), + ], + ), + SizedBox(height: 2), + RElevated( + text: 'اعمال فیلتر', + onPressed: () { + controller.submitFilter(); + Get.back(); + }, + height: 40, + ), + SizedBox(height: 16), + ], + ), + ); + } } diff --git a/packages/chicken/lib/presentation/pages/buy_in_province_all/logic.dart b/packages/chicken/lib/presentation/pages/buy_in_province_all/logic.dart index dea5e83..f02fe03 100644 --- a/packages/chicken/lib/presentation/pages/buy_in_province_all/logic.dart +++ b/packages/chicken/lib/presentation/pages/buy_in_province_all/logic.dart @@ -1,9 +1,24 @@ +import 'package:rasadyar_auth/data/utils/safe_call.dart'; +import 'package:rasadyar_chicken/data/models/response/imported_loads_model/imported_loads_model.dart'; +import 'package:rasadyar_chicken/presentation/pages/root/logic.dart'; import 'package:rasadyar_core/core.dart'; class BuyInProvinceAllLogic extends GetxController { + RxList isExpandedList = [].obs; + Rx fromDateFilter = Jalali.now().obs; + Rx toDateFilter = Jalali.now().obs; + RxnString searchedValue = RxnString(); + + RootLogic rootLogic = Get.find(); + Rx>> importedLoads = + Resource>.loading().obs; + + + + @override void onReady() { - // TODO: implement onReady + debounce(searchedValue, (callback) => getImportedEntries(), time: Duration(milliseconds: 2000)); super.onReady(); } @@ -12,4 +27,28 @@ class BuyInProvinceAllLogic extends GetxController { // TODO: implement onClose super.onClose(); } + + Future getImportedEntries() async { + safeCall( + call: () async => await rootLogic.chickenRepository.getImportedLoadsModel( + token: rootLogic.tokenService.accessToken.value!, + queryParameters: buildQueryParams( + queryParams: {'type': 'entered'}, + role: 'Steward', + search: 'filter', + page: 1, + pageSize: 10, + value: searchedValue.value + ), + ), + onSuccess: (res) async { + await Future.delayed(Duration(milliseconds: 200)); + if ((res?.count ?? 0) == 0) { + importedLoads.value = Resource>.empty(); + } else { + importedLoads.value = Resource>.success(res!.results!); + } + }, + ); + } } diff --git a/packages/chicken/lib/presentation/pages/buy_in_province_waiting/logic.dart b/packages/chicken/lib/presentation/pages/buy_in_province_waiting/logic.dart index 0d5e1f4..4fd6a93 100644 --- a/packages/chicken/lib/presentation/pages/buy_in_province_waiting/logic.dart +++ b/packages/chicken/lib/presentation/pages/buy_in_province_waiting/logic.dart @@ -1,18 +1,39 @@ +import 'dart:async'; + +import 'package:flutter/material.dart'; import 'package:rasadyar_auth/data/utils/safe_call.dart'; +import 'package:rasadyar_chicken/data/models/request/steward_allocation/steward_allocation_request.dart'; import 'package:rasadyar_chicken/data/models/response/waiting_arrival/waiting_arrival.dart'; import 'package:rasadyar_chicken/presentation/pages/root/logic.dart'; +import 'package:rasadyar_chicken/presentation/utils/utils.dart'; import 'package:rasadyar_core/core.dart'; class BuyInProvinceWaitingLogic extends GetxController { RxList isExpandedList = [].obs; - Rx fromDateFilter = Jalali.now().obs; - Rx toDateFilter = Jalali.now().obs; + Rx fromDateFilter = Jalali + .now() + .obs; + Rx toDateFilter = Jalali + .now() + .obs; RxnString searchedValue = RxnString(); + RxMap isLoadingConfirmMap = RxMap(); + Rx bgConfirmAllColor = AppColor.blueNormal.obs; RootLogic rootLogic = Get.find(); Rx>> waitingProduct = Resource>.loading().obs; + @override + void onInit() { + super.onInit(); + debounce( + searchedValue, + (callback) => getWaitingArrivals(), + time: Duration(milliseconds: timeDebounce), + ); + } + @override void onReady() { super.onReady(); @@ -24,14 +45,17 @@ class BuyInProvinceWaitingLogic extends GetxController { super.onClose(); } + void setSearchValue(String? data) { + searchedValue.value = data?.trim(); + } + Future getWaitingArrivals() async { safeCall( - call: () async => await rootLogic.chickenRepository.getWaitingArrivals( + call: () async => + await rootLogic.chickenRepository.getWaitingArrivals( token: rootLogic.tokenService.accessToken.value!, queryParameters: buildQueryParams( - queryParams: { - 'type':'not_entered' - }, + queryParams: {'type': 'not_entered'}, pageSize: 10, page: 1, search: 'filter', @@ -42,17 +66,78 @@ class BuyInProvinceWaitingLogic extends GetxController { ), ), onSuccess: (res) async { - await Future.delayed(Duration(milliseconds: 500)); + await Future.delayed(Duration(milliseconds: 200)); if ((res?.count ?? 0) == 0) { waitingProduct.value = Resource>.empty(); } else { waitingProduct.value = Resource>.success(res!.results!); + flashingFabBgColor(); } }, ); } - void setSearchValue(String? data) { - searchedValue.value = data?.trim(); + Future acceptEntries(WaitingArrivalModel model) async { + var request = StewardAllocationRequest( + allocationKey: model.key, + checkAllocation: true, + state: 'accepted', + receiverRealNumberOfCarcasses: model.realNumberOfCarcasses ?? 0, + receiverRealWeightOfCarcasses: model.realWeightOfCarcasses?.toInt() ?? 0, + registrationCode: model.registrationCode ?? 0, + weightLossOfCarcasses: model.weightLossOfCarcasses?.toInt() ?? 0, + ).toJson(); + request.removeWhere((key, value) => value == null); + + safeCall( + call: () async => + await rootLogic.chickenRepository.setSateForArrivals( + token: rootLogic.tokenService.accessToken.value!, + request: request, + ), + onError: (error, stackTrace) { + eLog(error); + }, + onSuccess: (result) { + getWaitingArrivals(); + // getBarGeneralInformation(); + }, + ); + } + + Future denyEntries(WaitingArrivalModel model) async { + var request = StewardAllocationRequest( + allocationKey: model.key, + checkAllocation: true, + state: 'rejected', + ).toJson(); + request.removeWhere((key, value) => value == null); + + safeCall( + call: () async => + await rootLogic.chickenRepository.setSateForArrivals( + token: rootLogic.tokenService.accessToken.value!, + request: request, + ), + onError: (error, stackTrace) { + eLog(error); + }, + onSuccess: (result) { + getWaitingArrivals(); + //TODO + // getBarGeneralInformation(); + }, + ); + } + + void flashingFabBgColor() { + Timer.periodic(Duration(seconds: 2), (timer) { + if (bgConfirmAllColor.value == AppColor.blueNormal) { + bgConfirmAllColor.value = AppColor.blueDarkActive; + } else { + bgConfirmAllColor.value = AppColor.blueNormal; + } + }); } } + diff --git a/packages/chicken/lib/presentation/pages/buy_in_province_waiting/view.dart b/packages/chicken/lib/presentation/pages/buy_in_province_waiting/view.dart index 4d49bf3..9a1ddb4 100644 --- a/packages/chicken/lib/presentation/pages/buy_in_province_waiting/view.dart +++ b/packages/chicken/lib/presentation/pages/buy_in_province_waiting/view.dart @@ -1,4 +1,3 @@ - import 'package:flutter/material.dart'; import 'package:rasadyar_chicken/data/models/response/waiting_arrival/waiting_arrival.dart'; import 'package:rasadyar_chicken/presentation/widget/list_item/list_item.dart'; @@ -12,36 +11,50 @@ class BuyInProvinceWaitingPage extends GetView { @override Widget build(BuildContext context) { - return Padding( - padding: const EdgeInsets.symmetric(horizontal: 8), - child: ObxValue((data) { - return RPaginatedListView( - listType: ListType.separated, - resource: data.value, - padding: EdgeInsets.fromLTRB(8, 8, 8, 80), - itemBuilder: (context, index) { - var item = data.value.data![index]; - return ObxValue((val) { - return ListItem2( - selected: val.contains(index), - onTap: () => controller.isExpandedList.toggle(index), - index: index, - child: itemListWidget(item), - secondChild: itemListExpandedWidget(item), - labelColor: AppColor.blueLight, - labelIcon: Assets.vec.truckFastOutlinedSvg.path, - ); - }, controller.isExpandedList); - }, - itemCount: data.value.data?.length ?? 0, - separatorBuilder: (context, index) => SizedBox(height: 8.h), - onLoadMore: () async {}, - ); + return Scaffold( + body: Padding( + padding: const EdgeInsets.symmetric(horizontal: 8), + child: ObxValue((data) { + return RPaginatedListView( + listType: ListType.separated, + resource: data.value, + padding: EdgeInsets.fromLTRB(8, 8, 8, 80), + itemBuilder: (context, index) { + var item = data.value.data![index]; + return ObxValue((val) { + return ListItem2( + selected: val.contains(index), + onTap: () => controller.isExpandedList.toggle(index), + index: index, + child: itemListWidget(item), + secondChild: itemListExpandedWidget(item), + labelColor: AppColor.blueLight, + labelIcon: Assets.vec.timerSvg.path, + ); + }, controller.isExpandedList); + }, + itemCount: data.value.data?.length ?? 0, + separatorBuilder: (context, index) => SizedBox(height: 8.h), + onLoadMore: () async {}, + ); + }, controller.waitingProduct), + ), + floatingActionButtonLocation: FloatingActionButtonLocation.endFloat, + floatingActionButton: ObxValue((data) { + if ((data.value.data?.length ?? 0) > 1) { + return AnimatedFab( + onPressed: () {}, + message: 'تایید یکجا', + icon: Assets.vec.clipboardTaskSvg.svg(), + backgroundColor: controller.bgConfirmAllColor.value, + ); + } else { + return SizedBox.shrink(); + } }, controller.waitingProduct), ); } - Row itemListWidget(WaitingArrivalModel item) { return Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, @@ -76,7 +89,7 @@ class BuyInProvinceWaitingPage extends GetView { Row( mainAxisAlignment: MainAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center, - spacing: 3, + spacing: 6, children: [ Visibility( visible: item.product?.name?.contains('مرغ گرم') ?? false, @@ -95,8 +108,6 @@ class BuyInProvinceWaitingPage extends GetView { ), SizedBox(height: 2), - - ], ), ), @@ -127,6 +138,14 @@ class BuyInProvinceWaitingPage extends GetView { textAlign: TextAlign.center, style: AppFonts.yekan16.copyWith(color: AppColor.greenDark), ), + Spacer(), + 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( @@ -170,95 +189,61 @@ class BuyInProvinceWaitingPage extends GetView { ), ), - // buildRow(title: 'مشخصات فروشنده', value: item.killHouseName ?? 'N/A'), - + // buildRow(title: 'مشخصات فروشنده', value: item.killHouseName ?? 'N/A'), + buildRow( + title: 'نام و نام خانوادگی فروشنده', + value: item.steward?.user?.fullname ?? 'N/A', + ), buildRow( title: 'تلفن فروشنده', value: item.steward?.user?.mobile ?? 'N/A', valueStyle: AppFonts.yekan14.copyWith(color: AppColor.blueNormal), ), + buildRow(title: 'محصول', value: item.product?.name ?? 'N/A'), buildRow( title: 'وزن خریداری شده', value: '${item.weightOfCarcasses?.separatedByComma} کیلوگرم', ), - buildRowOnTapped( - title: 'مشاهده بارنامه', - titleStyle: AppFonts.yekan14.copyWith(color: AppColor.blueNormal), - valueWidget: Assets.vec.clipboardEyeSvg.svg( - width: 20, - height: 24, - colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn), - ), - onTap: () { - Get.bottomSheet( - BaseBottomSheet( - height: 400, - child: Column( - spacing: 16, - children: [ - Text( - 'بارنامه', - style: AppFonts.yekan16Bold.copyWith(color: AppColor.darkGreyDarkHover), - ), - - /* Image.network( - item.barImage ?? '', - fit: BoxFit.cover, - height: 300, - errorBuilder: (context, error, stackTrace) { - eLog(error.toString()); - return Center(child: Text('خطایی پیش آمده!')); - }, - loadingBuilder: (context, child, loadingProgress) { - if (loadingProgress == null) return child; - return CupertinoActivityIndicator(); - }, - ),*/ - ], - ), - ), - ); - }, - ), - /* Row( + buildRow(title: 'قیمت کل', value: '${item.totalAmount?.separatedByComma} ریال'), + Row( mainAxisAlignment: MainAxisAlignment.center, spacing: 16.w, children: [ - RElevated( - text: 'ویرایش', - width: 150.w, - height: 40.h, - onPressed: () { - controller.setEditData(item); - Get.bottomSheet( - addPurchasedInformationBottomSheet(true), - isScrollControlled: true, - ).whenComplete(() { - controller.resetSubmitForm(); - }); - }, - textStyle: AppFonts.yekan20.copyWith(color: Colors.white), - backgroundColor: AppColor.greenNormal, - ), + ObxValue((data) { + return RElevated( + text: 'تایید', + width: 150.w, + height: 40.h, + isLoading: data[item.key!] ?? false, + onPressed: () async { + data[item.key!] = !(data[item.key!] ?? false); + await controller.acceptEntries(item); + data.remove(item.key!); + }, + textStyle: AppFonts.yekan20.copyWith(color: Colors.white), + backgroundColor: AppColor.greenNormal, + ); + }, controller.isLoadingConfirmMap), ROutlinedElevated( - text: 'حذف', + text: 'رد', textStyle: AppFonts.yekan20.copyWith(color: AppColor.redNormal), width: 150.w, height: 40.h, onPressed: () { - buildDeleteDialog( - onConfirm: () => controller.deleteStewardPurchaseOutOfProvince(item.key!), - onRefresh: () => controller.getStewardPurchaseOutOfProvince(), + buildWarningDialog( + title: 'اخطار', + middleText: 'آیا از رد شدن این مورد اطمینان دارید؟', + onConfirm: () => controller.denyEntries(item), + onRefresh: () => controller.getWaitingArrivals(), ); }, borderColor: AppColor.redNormal, ), ], - ),*/ + ), ], ), ); } - } diff --git a/packages/chicken/lib/presentation/pages/entering_the_warehouse/logic.dart b/packages/chicken/lib/presentation/pages/entering_the_warehouse/logic.dart index 9fb4a42..ab10e19 100644 --- a/packages/chicken/lib/presentation/pages/entering_the_warehouse/logic.dart +++ b/packages/chicken/lib/presentation/pages/entering_the_warehouse/logic.dart @@ -33,26 +33,7 @@ class EnteringTheWarehouseLogic extends GetxController { @override void onReady() { super.onReady(); - getBarGeneralInformation(); - - getImportedEntried(); - - scrollControllerImportedLoad.addListener(() { - if (scrollControllerImportedLoad.position.pixels >= - scrollControllerImportedLoad.position.maxScrollExtent - 100) { - addPageImportedLoad.value = true; - getImportedEntried(); - } - }); - - scrollControllerWaitingForArrival.addListener(() { - if (scrollControllerWaitingForArrival.position.pixels >= - scrollControllerWaitingForArrival.position.maxScrollExtent - 100) { - addPageWaitingForArrival.value = true; - - } - }); } Future getBarGeneralInformation() async { @@ -74,68 +55,6 @@ class EnteringTheWarehouseLogic extends GetxController { - Future acceptEntried(String key) async { - var request = StewardAllocationRequest( - allocationKey: key, - checkAllocation: true, - state: 'accepted', - receiverRealNumberOfCarcasses: int.parse( - volumeController.text.isNotEmpty ? volumeController.text : '0', - ), - receiverRealWeightOfCarcasses: int.parse( - weightController.text.isNotEmpty ? weightController.text : '0', - ), - registrationCode: acceptType.value == 1 - ? int.parse( - authenticationCodeController.text.isNotEmpty - ? authenticationCodeController.text - : '0', - ) - : null, - weightLossOfCarcasses: int.parse( - weightLossController.text.isNotEmpty ? weightLossController.text : '0', - ), - ).toJson(); - request.removeWhere((key, value) => value == null); - - safeCall( - call: () async => await rootLogic.chickenRepository.setSateForArrivals( - token: rootLogic.tokenService.accessToken.value!, - request: request, - ), - onError: (error, stackTrace) { - eLog(error); - }, - onSuccess: (result) { - clearControllers(); - - getBarGeneralInformation(); - }, - ); - } - - Future denyEntried(String key) async { - var request = StewardAllocationRequest( - allocationKey: key, - checkAllocation: true, - state: 'rejected', - ).toJson(); - request.removeWhere((key, value) => value == null); - - safeCall( - call: () async => await rootLogic.chickenRepository.setSateForArrivals( - token: rootLogic.tokenService.accessToken.value!, - request: request, - ), - onError: (error, stackTrace) { - eLog(error); - }, - onSuccess: (result) { - - getBarGeneralInformation(); - }, - ); - } Future getImportedEntried() async { if (isLoadingMoreImportedLoad.value || !hasMoreDataImportedLoad.value) { @@ -146,7 +65,7 @@ class EnteringTheWarehouseLogic extends GetxController { currentPageImportedLoad.value++; } - safeCall( +/* safeCall( call: () async => await rootLogic.chickenRepository.getImportedLoadsModel( token: rootLogic.tokenService.accessToken.value!, page: currentPageImportedLoad.value, @@ -164,7 +83,7 @@ class EnteringTheWarehouseLogic extends GetxController { isLoadingMoreImportedLoad.value = false; } }, - ); + );*/ } clearControllers() { diff --git a/packages/chicken/lib/presentation/pages/entering_the_warehouse/view.dart b/packages/chicken/lib/presentation/pages/entering_the_warehouse/view.dart index 6cd140f..aa99608 100644 --- a/packages/chicken/lib/presentation/pages/entering_the_warehouse/view.dart +++ b/packages/chicken/lib/presentation/pages/entering_the_warehouse/view.dart @@ -1,8 +1,6 @@ import 'package:flutter/material.dart'; import 'package:rasadyar_chicken/data/models/response/bar_information/bar_information.dart'; import 'package:rasadyar_chicken/data/models/response/inventory/inventory_model.dart'; -import 'package:rasadyar_chicken/data/models/response/waiting_arrival/waiting_arrival.dart'; -import 'package:rasadyar_chicken/presentation/pages/entering_the_warehouse/string_utils.dart'; import 'package:rasadyar_core/core.dart'; import 'logic.dart'; @@ -22,7 +20,7 @@ class EnteringTheWarehousePage extends GetView { return generalBarInformation(data.value); }, controller.barInformation), - importedLoads(), + // importedLoads(), ], ), ), @@ -43,7 +41,7 @@ class EnteringTheWarehousePage extends GetView { ), ), SizedBox(height: 4), - /* ObxValue( + /* ObxValue( (data) => data.isEmpty ? Container( margin: const EdgeInsets.symmetric(vertical: 2), @@ -135,14 +133,8 @@ class EnteringTheWarehousePage extends GetView { 'کل ورودی به انبار (کیلوگرم)', model.totalFreeBarsCarcassesWeight.toString(), ), - buildRow( - 'کل فروش (کیلوگرم)', - model.realAllocatedWeight.toString(), - ), - buildRow( - 'مانده انبار (کیلوگرم)', - model.totalRemainWeight.toString(), - ), + buildRow('کل فروش (کیلوگرم)', model.realAllocatedWeight.toString()), + buildRow('مانده انبار (کیلوگرم)', model.totalRemainWeight.toString()), ], ), ), @@ -161,9 +153,7 @@ class EnteringTheWarehousePage extends GetView { child: Text( title, textAlign: TextAlign.right, - style: AppFonts.yekan14.copyWith( - color: AppColor.darkGreyDarkHover, - ), + style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover), ), ), Flexible( @@ -172,9 +162,7 @@ class EnteringTheWarehousePage extends GetView { value, textAlign: TextAlign.left, - style: AppFonts.yekan14.copyWith( - color: AppColor.darkGreyDarkHover, - ), + style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover), ), ), ], @@ -209,14 +197,8 @@ class EnteringTheWarehousePage extends GetView { crossAxisAlignment: CrossAxisAlignment.start, spacing: 8, children: [ - buildRow( - 'تعداد کل بارها', - model.totalBars!.toInt().toString(), - ), - buildRow( - 'وزن کل بارها (کیلوگرم)', - model.totalBarsWeight!.toInt().toString(), - ), + buildRow('تعداد کل بارها', model.totalBars!.toInt().toString()), + buildRow('وزن کل بارها (کیلوگرم)', model.totalBarsWeight!.toInt().toString()), buildRow( 'تعداد کل بارهای وارد شده', model.totalEnteredBars!.toInt().toString(), @@ -231,14 +213,9 @@ class EnteringTheWarehousePage extends GetView { ), buildRow( 'وزن کل بار وارد نشده (کیلوگرم)', - model.totalNotEnteredKillHouseRequestsWeight! - .toInt() - .toString(), - ), - buildRow( - 'تعداد کل بارهای رد شده', - model.totalRejectedBars!.toInt().toString(), + model.totalNotEnteredKillHouseRequestsWeight!.toInt().toString(), ), + buildRow('تعداد کل بارهای رد شده', model.totalRejectedBars!.toInt().toString()), buildRow( ' وزن کل بارهای رد شده', model.totalRejectedBarsWeight!.toInt().toString(), @@ -251,7 +228,7 @@ class EnteringTheWarehousePage extends GetView { ); } -/* Widget waitingForArrival() { + /* Widget waitingForArrival() { return Column( children: [ const SizedBox(height: 8), @@ -400,153 +377,72 @@ class EnteringTheWarehousePage extends GetView { ); }*/ - Widget importedLoads() { - return Column( - children: [ - const SizedBox(height: 8), - Padding( - padding: const EdgeInsets.symmetric(horizontal: 8.0), - child: Align( - alignment: Alignment.centerRight, - child: Text( - 'بارهای وارد شده', - style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal), - ), + /* Widget importedLoads() { + return Padding( + padding: const EdgeInsets.all(8.0), + child: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + buildRow('ردیف', '${index + 1}'), + buildRow( + 'تاریخ ثبت', + result.date!.formattedJalaliDate ?? 'N/A', ), - ), - ObxValue((data) { - if (data.value == null) { - return Container( - height: 80, - margin: const EdgeInsets.all(8), - padding: const EdgeInsets.all(12), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(8), - border: Border.all(color: AppColor.blueNormal, width: 1), - ), - child: Center(child: CircularProgressIndicator()), - ); - } else if (data.value?.results?.isEmpty ?? true) { - return Container( - height: 80, - margin: const EdgeInsets.all(8), - padding: const EdgeInsets.all(12), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(8), - border: Border.all(color: AppColor.blueNormal, width: 1), - ), - child: Center(child: Text('هیچ بار وارد شده‌ای وجود ندارد')), - ); - } else { - return Container( - margin: const EdgeInsets.symmetric(vertical: 2), - height: 700, - padding: const EdgeInsets.all(6), - child: ListView.separated( - controller: controller.scrollControllerImportedLoad, - padding: const EdgeInsets.all(8.0), - itemCount: data.value!.results!.length + 1, - itemBuilder: (BuildContext context, int index) { - if (index == data.value!.results!.length) { - return Obx( - () => controller.isLoadingMoreImportedLoad.value - ? const Padding( - padding: EdgeInsets.symmetric(vertical: 16), - child: Center(child: CircularProgressIndicator()), - ) - : const SizedBox(), - ); - } - - final result = data.value!.results![index]; - - return Card( - color: Colors.white, - margin: const EdgeInsets.symmetric(vertical: 4.0), - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(8), - side: const BorderSide( - color: AppColor.blueNormal, - width: 1, - ), - ), - child: Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - mainAxisSize: MainAxisSize.min, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - buildRow('ردیف', '${index + 1}'), - buildRow( - 'تاریخ ثبت', - result.date!.formattedJalaliDate ?? 'N/A', - ), - buildRow( - 'نوع تخصیص', - result.allocationType?.faAllocationType ?? 'N/A', - ), - buildRow( - 'مشخصات خریدار', - '${result.toSteward?.user?.fullname} - ${result.toSteward?.guildsName}' ?? - 'N/A', - ), - buildRow( - 'مشخصات فروشنده', - result.killHouse?.name ?? 'N/A', - ), - buildRow( - 'نوع فروش', - result.sellType?.faItem ?? 'N/A', - ), - buildRow( - 'قیمت هر کیلو', - '${result.amount ?? 0} ریال ', - ), - buildRow( - 'قیمت کل', - '${result.totalAmount ?? 0} ریال', - ), - buildRow( - 'وزن تخصیصی', - '${result.weightOfCarcasses?.toInt() ?? 0} کیلوگرم', - ), - buildRow( - 'کداحراز', - result.registrationCode?.toString() ?? 'N/A', - ), - buildRow( - 'وضعیت کد احراز', - result.systemRegistrationCode == true - ? "ارسال شده" - : "ارسال نشده" ?? 'N/A', - ), - buildRow( - 'افت وزن(کیلوگرم)', - result.weightLossOfCarcasses?.toInt().toString() ?? - 'N/A', - ), - buildRow( - 'وضعیت', - result.receiverState?.faItem ?? 'N/A', - ), - ], - ), - ), - ); - }, - separatorBuilder: (BuildContext context, int index) => - SizedBox(height: 8), - ), - ); - } - }, controller.importedLoads), - ], + buildRow( + 'نوع تخصیص', + result.allocationType?.faAllocationType ?? 'N/A', + ), + buildRow( + 'مشخصات خریدار', + '${result.toSteward?.user?.fullname} - ${result.toSteward?.guildsName}' ?? + 'N/A', + ), + buildRow( + 'مشخصات فروشنده', + result.killHouse?.name ?? 'N/A', + ), + buildRow( + 'نوع فروش', + result.sellType?.faItem ?? 'N/A', + ), + buildRow( + 'قیمت هر کیلو', + '${result.amount ?? 0} ریال ', + ), + buildRow( + 'قیمت کل', + '${result.totalAmount ?? 0} ریال', + ), + buildRow( + 'وزن تخصیصی', + '${result.weightOfCarcasses?.toInt() ?? 0} کیلوگرم', + ), + buildRow( + 'کداحراز', + result.registrationCode?.toString() ?? 'N/A', + ), + buildRow( + 'وضعیت کد احراز', + result.systemRegistrationCode == true + ? "ارسال شده" + : "ارسال نشده" ?? 'N/A', + ), + buildRow( + 'افت وزن(کیلوگرم)', + result.weightLossOfCarcasses?.toInt().toString() ?? + 'N/A', + ), + buildRow( + 'وضعیت', + result.receiverState?.faItem ?? 'N/A', + ), + ], + ), ); - } + }*/ -/* Widget acceptBottomSheet(ResultModel resultModel) { + /* Widget acceptBottomSheet(ResultModel resultModel) { return BaseBottomSheet( height: 500, child: Column( diff --git a/packages/chicken/lib/presentation/pages/sales_in_province/view.dart b/packages/chicken/lib/presentation/pages/sales_in_province/view.dart index f0b2aeb..acad986 100644 --- a/packages/chicken/lib/presentation/pages/sales_in_province/view.dart +++ b/packages/chicken/lib/presentation/pages/sales_in_province/view.dart @@ -4,8 +4,8 @@ import 'package:rasadyar_chicken/data/models/request/conform_allocation/conform_ import 'package:rasadyar_chicken/data/models/response/allocated_made/allocated_made.dart'; import 'package:rasadyar_chicken/data/models/response/guild/guild_model.dart'; import 'package:rasadyar_chicken/data/models/response/roles_products/roles_products.dart'; -import 'package:rasadyar_chicken/presentation/pages/entering_the_warehouse/string_utils.dart'; import 'package:rasadyar_chicken/presentation/routes/routes.dart'; +import 'package:rasadyar_chicken/presentation/utils/string_utils.dart'; import 'package:rasadyar_core/core.dart'; import 'logic.dart'; diff --git a/packages/chicken/lib/presentation/pages/entering_the_warehouse/string_utils.dart b/packages/chicken/lib/presentation/utils/string_utils.dart similarity index 95% rename from packages/chicken/lib/presentation/pages/entering_the_warehouse/string_utils.dart rename to packages/chicken/lib/presentation/utils/string_utils.dart index b7f8473..9145793 100644 --- a/packages/chicken/lib/presentation/pages/entering_the_warehouse/string_utils.dart +++ b/packages/chicken/lib/presentation/utils/string_utils.dart @@ -1,4 +1,4 @@ -extension xStringUtils on String { +extension XStringUtils on String { get faAllocationType { final tmp = split('_'); tmp.insert(1, '_'); diff --git a/packages/chicken/lib/presentation/utils/utils.dart b/packages/chicken/lib/presentation/utils/utils.dart index 13b968a..e3fd48d 100644 --- a/packages/chicken/lib/presentation/utils/utils.dart +++ b/packages/chicken/lib/presentation/utils/utils.dart @@ -3,6 +3,11 @@ import 'package:rasadyar_auth/data/models/local/user_local/user_local_model.dart import 'package:rasadyar_auth/presentation/routes/pages.dart'; import 'package:rasadyar_core/core.dart'; + + +const int timeDebounce = 1200; + + void handleGeneric(DioException error,[void Function()? onError]) { Get.showSnackbar(_errorSnackBar('اعتبار توکن شما منقضی شده است لطفا دوباره وارد شوید')); diff --git a/packages/core/lib/presentation/common/app_color.dart b/packages/core/lib/presentation/common/app_color.dart index c69ee77..c309e7e 100644 --- a/packages/core/lib/presentation/common/app_color.dart +++ b/packages/core/lib/presentation/common/app_color.dart @@ -28,6 +28,7 @@ class AppColor { 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) //endregion //region --- Green Colors --- diff --git a/packages/core/lib/presentation/common/assets.gen.dart b/packages/core/lib/presentation/common/assets.gen.dart index ea84c81..2a56bb5 100644 --- a/packages/core/lib/presentation/common/assets.gen.dart +++ b/packages/core/lib/presentation/common/assets.gen.dart @@ -71,6 +71,9 @@ class $AssetsIconsGen { /// File path: assets/icons/clipboard_task.svg SvgGenImage get clipboardTask => const SvgGenImage('assets/icons/clipboard_task.svg'); + /// File path: assets/icons/clock.svg + SvgGenImage get clock => const SvgGenImage('assets/icons/clock.svg'); + /// File path: assets/icons/close_square.svg SvgGenImage get closeSquare => const SvgGenImage('assets/icons/close_square.svg'); @@ -252,6 +255,7 @@ class $AssetsIconsGen { chicken, clipboardEye, clipboardTask, + clock, closeSquare, convertCube, cube, @@ -384,6 +388,9 @@ class $AssetsVecGen { /// File path: assets/vec/clipboard_task.svg.vec SvgGenImage get clipboardTaskSvg => const SvgGenImage.vec('assets/vec/clipboard_task.svg.vec'); + /// File path: assets/vec/clock.svg.vec + SvgGenImage get clockSvg => const SvgGenImage.vec('assets/vec/clock.svg.vec'); + /// File path: assets/vec/close_square.svg.vec SvgGenImage get closeSquareSvg => const SvgGenImage.vec('assets/vec/close_square.svg.vec'); @@ -565,6 +572,7 @@ class $AssetsVecGen { chickenSvg, clipboardEyeSvg, clipboardTaskSvg, + clockSvg, closeSquareSvg, convertCubeSvg, cubeSvg, diff --git a/packages/core/lib/presentation/widget/buttons/animated_fab.dart b/packages/core/lib/presentation/widget/buttons/animated_fab.dart new file mode 100644 index 0000000..f9693cf --- /dev/null +++ b/packages/core/lib/presentation/widget/buttons/animated_fab.dart @@ -0,0 +1,80 @@ +import 'package:flutter/material.dart'; + +class AnimatedFab extends StatelessWidget { + final VoidCallback? onPressed; + final Color backgroundColor; + final Color foregroundColor; + final Widget icon; + final double radius; + final bool isLoading; + final String? message; + + const AnimatedFab({ + super.key, + required this.onPressed, + required this.icon, + required this.backgroundColor, + this.foregroundColor = Colors.white, + this.radius = 56.0, + this.isLoading = false, + this.message, + }); + + @override + Widget build(BuildContext context) { + return message != null + ? Tooltip( + message: message ?? '', + child: AnimatedContainer( + duration: const Duration(milliseconds: 1300), + width: radius, + height: radius, + decoration: BoxDecoration(color: backgroundColor, shape: BoxShape.circle), + child: Material( + color: Colors.transparent, + child: InkWell( + borderRadius: BorderRadius.circular(radius), + onTap: isLoading ? null : onPressed, + child: Center( + child: isLoading + ? SizedBox( + height: radius / 2, + width: radius / 2, + child: CircularProgressIndicator( + strokeWidth: 2.5, + valueColor: AlwaysStoppedAnimation(foregroundColor), + ), + ) + : icon, + ), + ), + ), + ), + ) + : AnimatedContainer( + duration: const Duration(milliseconds: 1300), + width: radius, + height: radius, + decoration: BoxDecoration(color: backgroundColor, shape: BoxShape.circle), + child: Material( + color: Colors.transparent, + child: InkWell( + borderRadius: BorderRadius.circular(radius), + onTap: isLoading ? null : onPressed, + child: Center( + child: isLoading + ? SizedBox( + height: radius / 2, + width: radius / 2, + child: CircularProgressIndicator( + strokeWidth: 2.5, + valueColor: AlwaysStoppedAnimation(foregroundColor), + ), + ) + : icon, + ), + ), + ), + ); + } +} diff --git a/packages/core/lib/presentation/widget/buttons/buttons.dart b/packages/core/lib/presentation/widget/buttons/buttons.dart new file mode 100644 index 0000000..bbb8a45 --- /dev/null +++ b/packages/core/lib/presentation/widget/buttons/buttons.dart @@ -0,0 +1,7 @@ +export 'animated_fab.dart'; +export 'elevated.dart'; +export 'fab.dart'; +export 'fab_outlined.dart'; +export 'outline_elevated.dart'; +export 'outline_elevated_icon.dart'; +export 'text_button.dart'; \ No newline at end of file diff --git a/packages/core/lib/presentation/widget/dialog/dialog.dart b/packages/core/lib/presentation/widget/dialog/dialog.dart new file mode 100644 index 0000000..788ecce --- /dev/null +++ b/packages/core/lib/presentation/widget/dialog/dialog.dart @@ -0,0 +1,2 @@ +export 'delete_dialog.dart'; +export 'warning_dialog.dart'; \ No newline at end of file diff --git a/packages/core/lib/presentation/widget/dialog/warning_dialog.dart b/packages/core/lib/presentation/widget/dialog/warning_dialog.dart new file mode 100644 index 0000000..112c9f3 --- /dev/null +++ b/packages/core/lib/presentation/widget/dialog/warning_dialog.dart @@ -0,0 +1,33 @@ +import 'package:flutter/material.dart'; + +import '../../../core.dart'; + +Future buildWarningDialog({ + required String title, + required String middleText, + required Future Function() onConfirm, + required Future Function() onRefresh, +}) async { + await Get.defaultDialog( + title: title, + middleText: middleText, + confirm: ElevatedButton( + style: ElevatedButton.styleFrom( + backgroundColor: AppColor.error, + foregroundColor: Colors.white, + ), + onPressed: () async { + await onConfirm(); + onRefresh(); + Get.back(); + }, + child: Text('بله'), + ), + cancel: ElevatedButton( + onPressed: () { + Get.back(); + }, + child: Text('خیر'), + ), + ); +} diff --git a/packages/core/lib/presentation/widget/widget.dart b/packages/core/lib/presentation/widget/widget.dart index 89df63c..8a1cbf7 100644 --- a/packages/core/lib/presentation/widget/widget.dart +++ b/packages/core/lib/presentation/widget/widget.dart @@ -3,14 +3,10 @@ export 'bottom_navigation/r_bottom_navigation.dart'; export 'bottom_navigation/wave_bottom_navigation.dart'; export 'bottom_sheet/base_bottom_sheet.dart'; export 'bottom_sheet/date_picker_bottom_sheet.dart'; -export 'buttons/elevated.dart'; -export 'buttons/fab.dart'; -export 'buttons/outline_elevated.dart'; -export 'buttons/outline_elevated_icon.dart'; -export 'buttons/text_button.dart'; +export 'buttons/buttons.dart'; export 'card/card_with_icon_with_border.dart'; export 'chips/r_chips.dart'; -export 'dialog/delete_dialog.dart'; +export 'dialog/dialog.dart'; export 'draggable_bottom_sheet/bottom_sheet_manger.dart'; export 'draggable_bottom_sheet/draggable_bottom_sheet.dart'; export 'draggable_bottom_sheet/draggable_bottom_sheet2.dart';