From 338dd8f6811c3fec69e4197f0639d3190aef932e Mon Sep 17 00:00:00 2001 From: "mr.mojtaba" Date: Sun, 21 Sep 2025 15:42:08 +0330 Subject: [PATCH] fix : some ui bug --- .../hatching_report/hatching_report.dart | 8 + .../hatching_report.freezed.dart | 60 +++++-- .../hatching_report/hatching_report.g.dart | 16 ++ .../poultry_science/active_hatching/view.dart | 28 +--- .../pages/poultry_science/farm/view.dart | 4 +- .../pages/poultry_science/genocide/view.dart | 2 +- .../poultry_science/inspection/logic.dart | 51 +++++- .../poultry_science/inspection/view.dart | 154 ++++++++++++++---- 8 files changed, 241 insertions(+), 82 deletions(-) diff --git a/packages/chicken/lib/data/models/response/hatching_report/hatching_report.dart b/packages/chicken/lib/data/models/response/hatching_report/hatching_report.dart index c061913..3d61620 100644 --- a/packages/chicken/lib/data/models/response/hatching_report/hatching_report.dart +++ b/packages/chicken/lib/data/models/response/hatching_report/hatching_report.dart @@ -21,6 +21,14 @@ abstract class HatchingReport with _$HatchingReport { String? reporterMobile, String? createdBy, String? modifiedBy, + String? messageRegistererRole, + String? messageRegistererMobile, + String? messageRegistererFullname, + String? message, + String? messageAi, + int? realQuantity, + int? realQuantityAi, + String? state, }) = _HatchingReport; factory HatchingReport.fromJson(Map json) => _$HatchingReportFromJson(json); diff --git a/packages/chicken/lib/data/models/response/hatching_report/hatching_report.freezed.dart b/packages/chicken/lib/data/models/response/hatching_report/hatching_report.freezed.dart index 9bffb8e..7d878a4 100644 --- a/packages/chicken/lib/data/models/response/hatching_report/hatching_report.freezed.dart +++ b/packages/chicken/lib/data/models/response/hatching_report/hatching_report.freezed.dart @@ -15,7 +15,7 @@ T _$identity(T value) => value; /// @nodoc mixin _$HatchingReport { - int? get id; PoultryScience? get poultryScience; Hatching? get hatching; String? get key; String? get createDate; String? get modifyDate; bool? get trash; String? get date; List? get image; double? get lat; double? get log; String? get reporterFullname; String? get reporterMobile; String? get createdBy; String? get modifiedBy; + int? get id; PoultryScience? get poultryScience; Hatching? get hatching; String? get key; String? get createDate; String? get modifyDate; bool? get trash; String? get date; List? get image; double? get lat; double? get log; String? get reporterFullname; String? get reporterMobile; String? get createdBy; String? get modifiedBy; String? get messageRegistererRole; String? get messageRegistererMobile; String? get messageRegistererFullname; String? get message; String? get messageAi; int? get realQuantity; int? get realQuantityAi; String? get state; /// Create a copy of HatchingReport /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @@ -28,16 +28,16 @@ $HatchingReportCopyWith get copyWith => _$HatchingReportCopyWith @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is HatchingReport&&(identical(other.id, id) || other.id == id)&&(identical(other.poultryScience, poultryScience) || other.poultryScience == poultryScience)&&(identical(other.hatching, hatching) || other.hatching == hatching)&&(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.date, date) || other.date == date)&&const DeepCollectionEquality().equals(other.image, image)&&(identical(other.lat, lat) || other.lat == lat)&&(identical(other.log, log) || other.log == log)&&(identical(other.reporterFullname, reporterFullname) || other.reporterFullname == reporterFullname)&&(identical(other.reporterMobile, reporterMobile) || other.reporterMobile == reporterMobile)&&(identical(other.createdBy, createdBy) || other.createdBy == createdBy)&&(identical(other.modifiedBy, modifiedBy) || other.modifiedBy == modifiedBy)); + return identical(this, other) || (other.runtimeType == runtimeType&&other is HatchingReport&&(identical(other.id, id) || other.id == id)&&(identical(other.poultryScience, poultryScience) || other.poultryScience == poultryScience)&&(identical(other.hatching, hatching) || other.hatching == hatching)&&(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.date, date) || other.date == date)&&const DeepCollectionEquality().equals(other.image, image)&&(identical(other.lat, lat) || other.lat == lat)&&(identical(other.log, log) || other.log == log)&&(identical(other.reporterFullname, reporterFullname) || other.reporterFullname == reporterFullname)&&(identical(other.reporterMobile, reporterMobile) || other.reporterMobile == reporterMobile)&&(identical(other.createdBy, createdBy) || other.createdBy == createdBy)&&(identical(other.modifiedBy, modifiedBy) || other.modifiedBy == modifiedBy)&&(identical(other.messageRegistererRole, messageRegistererRole) || other.messageRegistererRole == messageRegistererRole)&&(identical(other.messageRegistererMobile, messageRegistererMobile) || other.messageRegistererMobile == messageRegistererMobile)&&(identical(other.messageRegistererFullname, messageRegistererFullname) || other.messageRegistererFullname == messageRegistererFullname)&&(identical(other.message, message) || other.message == message)&&(identical(other.messageAi, messageAi) || other.messageAi == messageAi)&&(identical(other.realQuantity, realQuantity) || other.realQuantity == realQuantity)&&(identical(other.realQuantityAi, realQuantityAi) || other.realQuantityAi == realQuantityAi)&&(identical(other.state, state) || other.state == state)); } @JsonKey(includeFromJson: false, includeToJson: false) @override -int get hashCode => Object.hash(runtimeType,id,poultryScience,hatching,key,createDate,modifyDate,trash,date,const DeepCollectionEquality().hash(image),lat,log,reporterFullname,reporterMobile,createdBy,modifiedBy); +int get hashCode => Object.hashAll([runtimeType,id,poultryScience,hatching,key,createDate,modifyDate,trash,date,const DeepCollectionEquality().hash(image),lat,log,reporterFullname,reporterMobile,createdBy,modifiedBy,messageRegistererRole,messageRegistererMobile,messageRegistererFullname,message,messageAi,realQuantity,realQuantityAi,state]); @override String toString() { - return 'HatchingReport(id: $id, poultryScience: $poultryScience, hatching: $hatching, key: $key, createDate: $createDate, modifyDate: $modifyDate, trash: $trash, date: $date, image: $image, lat: $lat, log: $log, reporterFullname: $reporterFullname, reporterMobile: $reporterMobile, createdBy: $createdBy, modifiedBy: $modifiedBy)'; + return 'HatchingReport(id: $id, poultryScience: $poultryScience, hatching: $hatching, key: $key, createDate: $createDate, modifyDate: $modifyDate, trash: $trash, date: $date, image: $image, lat: $lat, log: $log, reporterFullname: $reporterFullname, reporterMobile: $reporterMobile, createdBy: $createdBy, modifiedBy: $modifiedBy, messageRegistererRole: $messageRegistererRole, messageRegistererMobile: $messageRegistererMobile, messageRegistererFullname: $messageRegistererFullname, message: $message, messageAi: $messageAi, realQuantity: $realQuantity, realQuantityAi: $realQuantityAi, state: $state)'; } @@ -48,7 +48,7 @@ abstract mixin class $HatchingReportCopyWith<$Res> { factory $HatchingReportCopyWith(HatchingReport value, $Res Function(HatchingReport) _then) = _$HatchingReportCopyWithImpl; @useResult $Res call({ - int? id, PoultryScience? poultryScience, Hatching? hatching, String? key, String? createDate, String? modifyDate, bool? trash, String? date, List? image, double? lat, double? log, String? reporterFullname, String? reporterMobile, String? createdBy, String? modifiedBy + int? id, PoultryScience? poultryScience, Hatching? hatching, String? key, String? createDate, String? modifyDate, bool? trash, String? date, List? image, double? lat, double? log, String? reporterFullname, String? reporterMobile, String? createdBy, String? modifiedBy, String? messageRegistererRole, String? messageRegistererMobile, String? messageRegistererFullname, String? message, String? messageAi, int? realQuantity, int? realQuantityAi, String? state }); @@ -65,7 +65,7 @@ class _$HatchingReportCopyWithImpl<$Res> /// Create a copy of HatchingReport /// with the given fields replaced by the non-null parameter values. -@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? poultryScience = freezed,Object? hatching = freezed,Object? key = freezed,Object? createDate = freezed,Object? modifyDate = freezed,Object? trash = freezed,Object? date = freezed,Object? image = freezed,Object? lat = freezed,Object? log = freezed,Object? reporterFullname = freezed,Object? reporterMobile = freezed,Object? createdBy = freezed,Object? modifiedBy = freezed,}) { +@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? poultryScience = freezed,Object? hatching = freezed,Object? key = freezed,Object? createDate = freezed,Object? modifyDate = freezed,Object? trash = freezed,Object? date = freezed,Object? image = freezed,Object? lat = freezed,Object? log = freezed,Object? reporterFullname = freezed,Object? reporterMobile = freezed,Object? createdBy = freezed,Object? modifiedBy = freezed,Object? messageRegistererRole = freezed,Object? messageRegistererMobile = freezed,Object? messageRegistererFullname = freezed,Object? message = freezed,Object? messageAi = freezed,Object? realQuantity = freezed,Object? realQuantityAi = freezed,Object? state = freezed,}) { return _then(_self.copyWith( id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable as int?,poultryScience: freezed == poultryScience ? _self.poultryScience : poultryScience // ignore: cast_nullable_to_non_nullable @@ -82,6 +82,14 @@ as double?,reporterFullname: freezed == reporterFullname ? _self.reporterFullnam as String?,reporterMobile: freezed == reporterMobile ? _self.reporterMobile : reporterMobile // ignore: cast_nullable_to_non_nullable as String?,createdBy: freezed == createdBy ? _self.createdBy : createdBy // ignore: cast_nullable_to_non_nullable as String?,modifiedBy: freezed == modifiedBy ? _self.modifiedBy : modifiedBy // ignore: cast_nullable_to_non_nullable +as String?,messageRegistererRole: freezed == messageRegistererRole ? _self.messageRegistererRole : messageRegistererRole // ignore: cast_nullable_to_non_nullable +as String?,messageRegistererMobile: freezed == messageRegistererMobile ? _self.messageRegistererMobile : messageRegistererMobile // ignore: cast_nullable_to_non_nullable +as String?,messageRegistererFullname: freezed == messageRegistererFullname ? _self.messageRegistererFullname : messageRegistererFullname // ignore: cast_nullable_to_non_nullable +as String?,message: freezed == message ? _self.message : message // ignore: cast_nullable_to_non_nullable +as String?,messageAi: freezed == messageAi ? _self.messageAi : messageAi // ignore: cast_nullable_to_non_nullable +as String?,realQuantity: freezed == realQuantity ? _self.realQuantity : realQuantity // ignore: cast_nullable_to_non_nullable +as int?,realQuantityAi: freezed == realQuantityAi ? _self.realQuantityAi : realQuantityAi // ignore: cast_nullable_to_non_nullable +as int?,state: freezed == state ? _self.state : state // ignore: cast_nullable_to_non_nullable as String?, )); } @@ -191,10 +199,10 @@ return $default(_that);case _: /// } /// ``` -@optionalTypeArgs TResult maybeWhen(TResult Function( int? id, PoultryScience? poultryScience, Hatching? hatching, String? key, String? createDate, String? modifyDate, bool? trash, String? date, List? image, double? lat, double? log, String? reporterFullname, String? reporterMobile, String? createdBy, String? modifiedBy)? $default,{required TResult orElse(),}) {final _that = this; +@optionalTypeArgs TResult maybeWhen(TResult Function( int? id, PoultryScience? poultryScience, Hatching? hatching, String? key, String? createDate, String? modifyDate, bool? trash, String? date, List? image, double? lat, double? log, String? reporterFullname, String? reporterMobile, String? createdBy, String? modifiedBy, String? messageRegistererRole, String? messageRegistererMobile, String? messageRegistererFullname, String? message, String? messageAi, int? realQuantity, int? realQuantityAi, String? state)? $default,{required TResult orElse(),}) {final _that = this; switch (_that) { case _HatchingReport() when $default != null: -return $default(_that.id,_that.poultryScience,_that.hatching,_that.key,_that.createDate,_that.modifyDate,_that.trash,_that.date,_that.image,_that.lat,_that.log,_that.reporterFullname,_that.reporterMobile,_that.createdBy,_that.modifiedBy);case _: +return $default(_that.id,_that.poultryScience,_that.hatching,_that.key,_that.createDate,_that.modifyDate,_that.trash,_that.date,_that.image,_that.lat,_that.log,_that.reporterFullname,_that.reporterMobile,_that.createdBy,_that.modifiedBy,_that.messageRegistererRole,_that.messageRegistererMobile,_that.messageRegistererFullname,_that.message,_that.messageAi,_that.realQuantity,_that.realQuantityAi,_that.state);case _: return orElse(); } @@ -212,10 +220,10 @@ return $default(_that.id,_that.poultryScience,_that.hatching,_that.key,_that.cre /// } /// ``` -@optionalTypeArgs TResult when(TResult Function( int? id, PoultryScience? poultryScience, Hatching? hatching, String? key, String? createDate, String? modifyDate, bool? trash, String? date, List? image, double? lat, double? log, String? reporterFullname, String? reporterMobile, String? createdBy, String? modifiedBy) $default,) {final _that = this; +@optionalTypeArgs TResult when(TResult Function( int? id, PoultryScience? poultryScience, Hatching? hatching, String? key, String? createDate, String? modifyDate, bool? trash, String? date, List? image, double? lat, double? log, String? reporterFullname, String? reporterMobile, String? createdBy, String? modifiedBy, String? messageRegistererRole, String? messageRegistererMobile, String? messageRegistererFullname, String? message, String? messageAi, int? realQuantity, int? realQuantityAi, String? state) $default,) {final _that = this; switch (_that) { case _HatchingReport(): -return $default(_that.id,_that.poultryScience,_that.hatching,_that.key,_that.createDate,_that.modifyDate,_that.trash,_that.date,_that.image,_that.lat,_that.log,_that.reporterFullname,_that.reporterMobile,_that.createdBy,_that.modifiedBy);case _: +return $default(_that.id,_that.poultryScience,_that.hatching,_that.key,_that.createDate,_that.modifyDate,_that.trash,_that.date,_that.image,_that.lat,_that.log,_that.reporterFullname,_that.reporterMobile,_that.createdBy,_that.modifiedBy,_that.messageRegistererRole,_that.messageRegistererMobile,_that.messageRegistererFullname,_that.message,_that.messageAi,_that.realQuantity,_that.realQuantityAi,_that.state);case _: throw StateError('Unexpected subclass'); } @@ -232,10 +240,10 @@ return $default(_that.id,_that.poultryScience,_that.hatching,_that.key,_that.cre /// } /// ``` -@optionalTypeArgs TResult? whenOrNull(TResult? Function( int? id, PoultryScience? poultryScience, Hatching? hatching, String? key, String? createDate, String? modifyDate, bool? trash, String? date, List? image, double? lat, double? log, String? reporterFullname, String? reporterMobile, String? createdBy, String? modifiedBy)? $default,) {final _that = this; +@optionalTypeArgs TResult? whenOrNull(TResult? Function( int? id, PoultryScience? poultryScience, Hatching? hatching, String? key, String? createDate, String? modifyDate, bool? trash, String? date, List? image, double? lat, double? log, String? reporterFullname, String? reporterMobile, String? createdBy, String? modifiedBy, String? messageRegistererRole, String? messageRegistererMobile, String? messageRegistererFullname, String? message, String? messageAi, int? realQuantity, int? realQuantityAi, String? state)? $default,) {final _that = this; switch (_that) { case _HatchingReport() when $default != null: -return $default(_that.id,_that.poultryScience,_that.hatching,_that.key,_that.createDate,_that.modifyDate,_that.trash,_that.date,_that.image,_that.lat,_that.log,_that.reporterFullname,_that.reporterMobile,_that.createdBy,_that.modifiedBy);case _: +return $default(_that.id,_that.poultryScience,_that.hatching,_that.key,_that.createDate,_that.modifyDate,_that.trash,_that.date,_that.image,_that.lat,_that.log,_that.reporterFullname,_that.reporterMobile,_that.createdBy,_that.modifiedBy,_that.messageRegistererRole,_that.messageRegistererMobile,_that.messageRegistererFullname,_that.message,_that.messageAi,_that.realQuantity,_that.realQuantityAi,_that.state);case _: return null; } @@ -247,7 +255,7 @@ return $default(_that.id,_that.poultryScience,_that.hatching,_that.key,_that.cre @JsonSerializable() class _HatchingReport implements HatchingReport { - const _HatchingReport({this.id, this.poultryScience, this.hatching, this.key, this.createDate, this.modifyDate, this.trash, this.date, final List? image, this.lat, this.log, this.reporterFullname, this.reporterMobile, this.createdBy, this.modifiedBy}): _image = image; + const _HatchingReport({this.id, this.poultryScience, this.hatching, this.key, this.createDate, this.modifyDate, this.trash, this.date, final List? image, this.lat, this.log, this.reporterFullname, this.reporterMobile, this.createdBy, this.modifiedBy, this.messageRegistererRole, this.messageRegistererMobile, this.messageRegistererFullname, this.message, this.messageAi, this.realQuantity, this.realQuantityAi, this.state}): _image = image; factory _HatchingReport.fromJson(Map json) => _$HatchingReportFromJson(json); @override final int? id; @@ -273,6 +281,14 @@ class _HatchingReport implements HatchingReport { @override final String? reporterMobile; @override final String? createdBy; @override final String? modifiedBy; +@override final String? messageRegistererRole; +@override final String? messageRegistererMobile; +@override final String? messageRegistererFullname; +@override final String? message; +@override final String? messageAi; +@override final int? realQuantity; +@override final int? realQuantityAi; +@override final String? state; /// Create a copy of HatchingReport /// with the given fields replaced by the non-null parameter values. @@ -287,16 +303,16 @@ Map toJson() { @override bool operator ==(Object other) { - return identical(this, other) || (other.runtimeType == runtimeType&&other is _HatchingReport&&(identical(other.id, id) || other.id == id)&&(identical(other.poultryScience, poultryScience) || other.poultryScience == poultryScience)&&(identical(other.hatching, hatching) || other.hatching == hatching)&&(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.date, date) || other.date == date)&&const DeepCollectionEquality().equals(other._image, _image)&&(identical(other.lat, lat) || other.lat == lat)&&(identical(other.log, log) || other.log == log)&&(identical(other.reporterFullname, reporterFullname) || other.reporterFullname == reporterFullname)&&(identical(other.reporterMobile, reporterMobile) || other.reporterMobile == reporterMobile)&&(identical(other.createdBy, createdBy) || other.createdBy == createdBy)&&(identical(other.modifiedBy, modifiedBy) || other.modifiedBy == modifiedBy)); + return identical(this, other) || (other.runtimeType == runtimeType&&other is _HatchingReport&&(identical(other.id, id) || other.id == id)&&(identical(other.poultryScience, poultryScience) || other.poultryScience == poultryScience)&&(identical(other.hatching, hatching) || other.hatching == hatching)&&(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.date, date) || other.date == date)&&const DeepCollectionEquality().equals(other._image, _image)&&(identical(other.lat, lat) || other.lat == lat)&&(identical(other.log, log) || other.log == log)&&(identical(other.reporterFullname, reporterFullname) || other.reporterFullname == reporterFullname)&&(identical(other.reporterMobile, reporterMobile) || other.reporterMobile == reporterMobile)&&(identical(other.createdBy, createdBy) || other.createdBy == createdBy)&&(identical(other.modifiedBy, modifiedBy) || other.modifiedBy == modifiedBy)&&(identical(other.messageRegistererRole, messageRegistererRole) || other.messageRegistererRole == messageRegistererRole)&&(identical(other.messageRegistererMobile, messageRegistererMobile) || other.messageRegistererMobile == messageRegistererMobile)&&(identical(other.messageRegistererFullname, messageRegistererFullname) || other.messageRegistererFullname == messageRegistererFullname)&&(identical(other.message, message) || other.message == message)&&(identical(other.messageAi, messageAi) || other.messageAi == messageAi)&&(identical(other.realQuantity, realQuantity) || other.realQuantity == realQuantity)&&(identical(other.realQuantityAi, realQuantityAi) || other.realQuantityAi == realQuantityAi)&&(identical(other.state, state) || other.state == state)); } @JsonKey(includeFromJson: false, includeToJson: false) @override -int get hashCode => Object.hash(runtimeType,id,poultryScience,hatching,key,createDate,modifyDate,trash,date,const DeepCollectionEquality().hash(_image),lat,log,reporterFullname,reporterMobile,createdBy,modifiedBy); +int get hashCode => Object.hashAll([runtimeType,id,poultryScience,hatching,key,createDate,modifyDate,trash,date,const DeepCollectionEquality().hash(_image),lat,log,reporterFullname,reporterMobile,createdBy,modifiedBy,messageRegistererRole,messageRegistererMobile,messageRegistererFullname,message,messageAi,realQuantity,realQuantityAi,state]); @override String toString() { - return 'HatchingReport(id: $id, poultryScience: $poultryScience, hatching: $hatching, key: $key, createDate: $createDate, modifyDate: $modifyDate, trash: $trash, date: $date, image: $image, lat: $lat, log: $log, reporterFullname: $reporterFullname, reporterMobile: $reporterMobile, createdBy: $createdBy, modifiedBy: $modifiedBy)'; + return 'HatchingReport(id: $id, poultryScience: $poultryScience, hatching: $hatching, key: $key, createDate: $createDate, modifyDate: $modifyDate, trash: $trash, date: $date, image: $image, lat: $lat, log: $log, reporterFullname: $reporterFullname, reporterMobile: $reporterMobile, createdBy: $createdBy, modifiedBy: $modifiedBy, messageRegistererRole: $messageRegistererRole, messageRegistererMobile: $messageRegistererMobile, messageRegistererFullname: $messageRegistererFullname, message: $message, messageAi: $messageAi, realQuantity: $realQuantity, realQuantityAi: $realQuantityAi, state: $state)'; } @@ -307,7 +323,7 @@ abstract mixin class _$HatchingReportCopyWith<$Res> implements $HatchingReportCo factory _$HatchingReportCopyWith(_HatchingReport value, $Res Function(_HatchingReport) _then) = __$HatchingReportCopyWithImpl; @override @useResult $Res call({ - int? id, PoultryScience? poultryScience, Hatching? hatching, String? key, String? createDate, String? modifyDate, bool? trash, String? date, List? image, double? lat, double? log, String? reporterFullname, String? reporterMobile, String? createdBy, String? modifiedBy + int? id, PoultryScience? poultryScience, Hatching? hatching, String? key, String? createDate, String? modifyDate, bool? trash, String? date, List? image, double? lat, double? log, String? reporterFullname, String? reporterMobile, String? createdBy, String? modifiedBy, String? messageRegistererRole, String? messageRegistererMobile, String? messageRegistererFullname, String? message, String? messageAi, int? realQuantity, int? realQuantityAi, String? state }); @@ -324,7 +340,7 @@ class __$HatchingReportCopyWithImpl<$Res> /// Create a copy of HatchingReport /// with the given fields replaced by the non-null parameter values. -@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? poultryScience = freezed,Object? hatching = freezed,Object? key = freezed,Object? createDate = freezed,Object? modifyDate = freezed,Object? trash = freezed,Object? date = freezed,Object? image = freezed,Object? lat = freezed,Object? log = freezed,Object? reporterFullname = freezed,Object? reporterMobile = freezed,Object? createdBy = freezed,Object? modifiedBy = freezed,}) { +@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? poultryScience = freezed,Object? hatching = freezed,Object? key = freezed,Object? createDate = freezed,Object? modifyDate = freezed,Object? trash = freezed,Object? date = freezed,Object? image = freezed,Object? lat = freezed,Object? log = freezed,Object? reporterFullname = freezed,Object? reporterMobile = freezed,Object? createdBy = freezed,Object? modifiedBy = freezed,Object? messageRegistererRole = freezed,Object? messageRegistererMobile = freezed,Object? messageRegistererFullname = freezed,Object? message = freezed,Object? messageAi = freezed,Object? realQuantity = freezed,Object? realQuantityAi = freezed,Object? state = freezed,}) { return _then(_HatchingReport( id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable as int?,poultryScience: freezed == poultryScience ? _self.poultryScience : poultryScience // ignore: cast_nullable_to_non_nullable @@ -341,6 +357,14 @@ as double?,reporterFullname: freezed == reporterFullname ? _self.reporterFullnam as String?,reporterMobile: freezed == reporterMobile ? _self.reporterMobile : reporterMobile // ignore: cast_nullable_to_non_nullable as String?,createdBy: freezed == createdBy ? _self.createdBy : createdBy // ignore: cast_nullable_to_non_nullable as String?,modifiedBy: freezed == modifiedBy ? _self.modifiedBy : modifiedBy // ignore: cast_nullable_to_non_nullable +as String?,messageRegistererRole: freezed == messageRegistererRole ? _self.messageRegistererRole : messageRegistererRole // ignore: cast_nullable_to_non_nullable +as String?,messageRegistererMobile: freezed == messageRegistererMobile ? _self.messageRegistererMobile : messageRegistererMobile // ignore: cast_nullable_to_non_nullable +as String?,messageRegistererFullname: freezed == messageRegistererFullname ? _self.messageRegistererFullname : messageRegistererFullname // ignore: cast_nullable_to_non_nullable +as String?,message: freezed == message ? _self.message : message // ignore: cast_nullable_to_non_nullable +as String?,messageAi: freezed == messageAi ? _self.messageAi : messageAi // ignore: cast_nullable_to_non_nullable +as String?,realQuantity: freezed == realQuantity ? _self.realQuantity : realQuantity // ignore: cast_nullable_to_non_nullable +as int?,realQuantityAi: freezed == realQuantityAi ? _self.realQuantityAi : realQuantityAi // ignore: cast_nullable_to_non_nullable +as int?,state: freezed == state ? _self.state : state // ignore: cast_nullable_to_non_nullable as String?, )); } diff --git a/packages/chicken/lib/data/models/response/hatching_report/hatching_report.g.dart b/packages/chicken/lib/data/models/response/hatching_report/hatching_report.g.dart index 00fc157..f486439 100644 --- a/packages/chicken/lib/data/models/response/hatching_report/hatching_report.g.dart +++ b/packages/chicken/lib/data/models/response/hatching_report/hatching_report.g.dart @@ -31,6 +31,14 @@ _HatchingReport _$HatchingReportFromJson(Map json) => reporterMobile: json['reporter_mobile'] as String?, createdBy: json['created_by'] as String?, modifiedBy: json['modified_by'] as String?, + messageRegistererRole: json['message_registerer_role'] as String?, + messageRegistererMobile: json['message_registerer_mobile'] as String?, + messageRegistererFullname: json['message_registerer_fullname'] as String?, + message: json['message'] as String?, + messageAi: json['message_ai'] as String?, + realQuantity: (json['real_quantity'] as num?)?.toInt(), + realQuantityAi: (json['real_quantity_ai'] as num?)?.toInt(), + state: json['state'] as String?, ); Map _$HatchingReportToJson(_HatchingReport instance) => @@ -50,6 +58,14 @@ Map _$HatchingReportToJson(_HatchingReport instance) => 'reporter_mobile': instance.reporterMobile, 'created_by': instance.createdBy, 'modified_by': instance.modifiedBy, + 'message_registerer_role': instance.messageRegistererRole, + 'message_registerer_mobile': instance.messageRegistererMobile, + 'message_registerer_fullname': instance.messageRegistererFullname, + 'message': instance.message, + 'message_ai': instance.messageAi, + 'real_quantity': instance.realQuantity, + 'real_quantity_ai': instance.realQuantityAi, + 'state': instance.state, }; _PoultryScience _$PoultryScienceFromJson(Map json) => diff --git a/packages/chicken/lib/presentation/pages/poultry_science/active_hatching/view.dart b/packages/chicken/lib/presentation/pages/poultry_science/active_hatching/view.dart index aa8a085..1eb9194 100644 --- a/packages/chicken/lib/presentation/pages/poultry_science/active_hatching/view.dart +++ b/packages/chicken/lib/presentation/pages/poultry_science/active_hatching/view.dart @@ -98,25 +98,13 @@ class ActiveHatchingPage extends GetView { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Row( - spacing: 3, - children: [ - Text('نژاد:', style: AppFonts.yekan14.copyWith(color: AppColor.textColor)), - Text( - item.breed?.first.breed ?? 'N/A', - style: AppFonts.yekan14.copyWith(color: AppColor.textColor), - ), - SizedBox(width: 2), + Text('نژاد:${item.breed?.first.breed ?? 'N/A'}', style: AppFonts.yekan14.copyWith(color: AppColor.textColor)), + Text( + ' سن${item.age} (روز)', - Text( - ' سن${item.age}', - - style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal), - ), - ], + style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal), ), - Text( ' دوره جوجه ریزی:${item.period}', style: AppFonts.yekan14.copyWith(color: AppColor.textColor), @@ -126,13 +114,13 @@ class ActiveHatchingPage extends GetView { ), buildRow(title: 'شماره مجوز جوجه ریزی', value: item.licenceNumber ?? 'N/A'), - buildRow( + buildUnitRow( title: 'حجم جوجه ریزی', value: item.quantity.separatedByCommaFa, - valueStyle: AppFonts.yekan14.copyWith(color: AppColor.blueNormal), + unit: '(قطعه)', ), - buildRow(title: 'مانده در سالن', value: item.leftOver.separatedByCommaFa), - buildRow(title: 'تلفات', value: item.losses.separatedByCommaFa), + buildUnitRow(title: 'مانده در سالن', value: item.leftOver.separatedByCommaFa,unit: '(قطعه)',), + buildUnitRow(title: 'تلفات', value: item.losses.separatedByCommaFa,unit: '(قطعه)',), buildRow( title: 'دامپزشک فارم', value: '${item.vetFarm?.vetFarmFullName}(${item.vetFarm?.vetFarmMobile})', diff --git a/packages/chicken/lib/presentation/pages/poultry_science/farm/view.dart b/packages/chicken/lib/presentation/pages/poultry_science/farm/view.dart index addc2aa..a37c7d5 100644 --- a/packages/chicken/lib/presentation/pages/poultry_science/farm/view.dart +++ b/packages/chicken/lib/presentation/pages/poultry_science/farm/view.dart @@ -131,9 +131,9 @@ class FarmPage extends GetView { buildRow(title: 'کد بهداشتی', value: item.healthCertificateNumber ?? 'N/A'), buildRow( title: 'دامپزشک فارم', - value: '${item.vetFarm?.fullName ?? '-'} (${item.vetFarm?.mobile ?? '-'})', + value: '${item.vetFarm?.fullName} (${item.vetFarm?.mobile ?? '-'})', ), - buildRow(title: 'ظرفیت فارم', value: item.totalCapacity.separatedByCommaFa), + buildUnitRow(title: 'ظرفیت فارم', value: item.totalCapacity.separatedByCommaFa, unit: '(قطعه)'), buildRow( title: 'جوجه ریزی فعال (تعداد دوره) ', value: diff --git a/packages/chicken/lib/presentation/pages/poultry_science/genocide/view.dart b/packages/chicken/lib/presentation/pages/poultry_science/genocide/view.dart index 0cb67fc..b045c8f 100644 --- a/packages/chicken/lib/presentation/pages/poultry_science/genocide/view.dart +++ b/packages/chicken/lib/presentation/pages/poultry_science/genocide/view.dart @@ -118,7 +118,7 @@ class GenocidePage extends GetView { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( - 'سن مرغ: ${item.hatching?.age ?? '-'}', + 'سن مرغ:${item.hatching?.age ?? '-'} (روز)', style: AppFonts.yekan14.copyWith(color: AppColor.textColor), ), diff --git a/packages/chicken/lib/presentation/pages/poultry_science/inspection/logic.dart b/packages/chicken/lib/presentation/pages/poultry_science/inspection/logic.dart index 288e5a7..3f275b1 100644 --- a/packages/chicken/lib/presentation/pages/poultry_science/inspection/logic.dart +++ b/packages/chicken/lib/presentation/pages/poultry_science/inspection/logic.dart @@ -1,3 +1,4 @@ +import 'package:flutter/material.dart'; import 'package:rasadyar_chicken/data/models/response/hatching/hatching_models.dart'; import 'package:rasadyar_chicken/data/models/response/hatching_report/hatching_report.dart'; import 'package:rasadyar_chicken/presentation/pages/poultry_science/root/logic.dart'; @@ -26,6 +27,10 @@ class InspectionPoultryScienceLogic extends GetxController { RxList routesName = RxList(); RxInt selectedSegmentIndex = 0.obs; + RxnString searchedValue = RxnString(); + Rx fromDateFilter = Jalali.now().obs; + Rx toDateFilter = Jalali.now().obs; + @override void onInit() { super.onInit(); @@ -68,12 +73,12 @@ class InspectionPoultryScienceLogic extends GetxController { } else { hatchingList.value = Resource>.loading(); } - /* + if (searchedValue.value != null && searchedValue.value!.trim().isNotEmpty && currentPage.value > 1) { currentPage.value = 1; - }*/ + } safeCall( call: () async => await rootLogic.poultryRepository.getHatchingPoultry( @@ -81,6 +86,10 @@ class InspectionPoultryScienceLogic extends GetxController { queryParameters: buildQueryParams( queryParams: {'type': 'hatching', 'report': true}, role: 'PoultryScience', + search: 'filter', + value: searchedValue.value, + fromDate: fromDateFilter.value.toDateTime(), + toDate: toDateFilter.value.toDateTime(), pageSize: 50, page: currentPage.value, ), @@ -108,12 +117,12 @@ class InspectionPoultryScienceLogic extends GetxController { } else { hatchingReportList.value = Resource>.loading(); } - /* + if (searchedValue.value != null && searchedValue.value!.trim().isNotEmpty && currentPage.value > 1) { currentPage.value = 1; - }*/ + } safeCall( call: () async => await rootLogic.poultryRepository.getHatchingPoultryReport( @@ -122,7 +131,9 @@ class InspectionPoultryScienceLogic extends GetxController { role: 'PoultryScience', pageSize: 50, search: 'filter', - value: '', + value: searchedValue.value, + fromDate: fromDateFilter.value.toDateTime(), + toDate: toDateFilter.value.toDateTime(), page: currentPage.value, ), ), @@ -214,4 +225,34 @@ class InspectionPoultryScienceLogic extends GetxController { void toggleExpanded(int index) { expandedIndex.value = expandedIndex.value == index ? -1 : index; } + + String getStatus(HatchingReport item) { + if (item.state == 'accepted') { + return 'تکمیل شده'; + } else if (item.state == 'rejected') { + return 'رد شده'; + } else { + return 'در حال بررسی'; + } + } + + Color getStatusColor(HatchingReport item) { + if (item.state == 'accepted') { + return AppColor.greenNormal; + } else if (item.state == 'rejected') { + return AppColor.redNormal; + } else { + return AppColor.yellowNormal; + } + } + + void setSearchValue(String? data) { + searchedValue.value = data?.trim(); + final isReporter = selectedSegmentIndex.value == 0; + if (isReporter) { + getHatchingReport(); + } else { + getHatchingList(); + } + } } diff --git a/packages/chicken/lib/presentation/pages/poultry_science/inspection/view.dart b/packages/chicken/lib/presentation/pages/poultry_science/inspection/view.dart index 2790795..d06ce6d 100644 --- a/packages/chicken/lib/presentation/pages/poultry_science/inspection/view.dart +++ b/packages/chicken/lib/presentation/pages/poultry_science/inspection/view.dart @@ -17,7 +17,11 @@ class InspectionPoultrySciencePage extends GetView controller.setSearchValue(data), + routesWidget: ObxValue((route) => buildPageRoute(route), controller.routesName), onBackPressed: () => Get.back(id: poultryFirstKey), widgets: [ @@ -105,25 +109,13 @@ class InspectionPoultrySciencePage extends GetView Container( - height: 138.h, + height: 100.h, clipBehavior: Clip.hardEdge, decoration: BoxDecoration( borderRadius: BorderRadius.circular(8.r), @@ -589,4 +625,50 @@ class InspectionPoultrySciencePage extends GetView controller.fromDateFilter.value = jalali, + ), + ), + Expanded( + child: dateFilterWidget( + isFrom: false, + date: controller.toDateFilter, + onChanged: (jalali) => controller.toDateFilter.value = jalali, + ), + ), + ], + ), + RElevated( + text: 'اعمال فیلتر', + isFullWidth: true, + backgroundColor: AppColor.greenNormal, + onPressed: () { + final isReporter = controller.selectedSegmentIndex.value == 0; + if (isReporter) { + controller.getHatchingReport(); + } else { + controller.getHatchingList(); + } + Get.back(); + }, + height: 40, + ), + ], + ), + ); + } }