diff --git a/packages/core/lib/utils/extension/string_utils.dart b/packages/core/lib/utils/extension/string_utils.dart index 6e7062b..fbe263e 100644 --- a/packages/core/lib/utils/extension/string_utils.dart +++ b/packages/core/lib/utils/extension/string_utils.dart @@ -12,15 +12,24 @@ extension XString on String { return replaceAll(RegExp(r'\D'), ''); } + String get addCountEXT { + return '$thisعدد'; + } + String get addDayEXT { + return '$thisروزه'; + } - get toDateTime => DateTime.parse(this); + String get addKgEXT { + return '$thisکیلوگرم'; + } + + DateTime get toDateTime => DateTime.parse(this); String get formattedJalaliDate { String tmp = contains("/") ? replaceAll("/", "-") : this; final dateTime = DateTime.parse(tmp); final jalaliDate = Jalali.fromDateTime(dateTime); return "${jalaliDate.year}/${jalaliDate.month.toString().padLeft(2, '0')}/${jalaliDate.day.toString().padLeft(2, '0')}"; - } String get formattedJalaliDateYHMS { @@ -33,10 +42,10 @@ extension XString on String { return DateFormat('yyyy-MM-dd HH:mm:ss').format(toDateTime); } - Jalali get toJalali{ + Jalali get toJalali { final dateTime = DateTime.parse(this); return Jalali.fromDateTime(dateTime); } - int get versionNumber => int.parse(replaceAll(".",'')); -} \ No newline at end of file + int get versionNumber => int.parse(replaceAll(".", '')); +} diff --git a/packages/inspection/lib/data/data_source/remote/inspection/inspection_remote.dart b/packages/inspection/lib/data/data_source/remote/inspection/inspection_remote.dart index d267c96..467ea0c 100644 --- a/packages/inspection/lib/data/data_source/remote/inspection/inspection_remote.dart +++ b/packages/inspection/lib/data/data_source/remote/inspection/inspection_remote.dart @@ -1,3 +1,4 @@ +import 'package:rasadyar_inspection/data/model/response/hatching_details/hatching_details.dart'; import 'package:rasadyar_inspection/data/model/response/poultry_location/poultry_location_model.dart'; abstract class InspectionRemoteDataSource { @@ -19,4 +20,9 @@ abstract class InspectionRemoteDataSource { double? radius, String? value, }); + + Future?> getHatchingDetails({ + String? code, + bool? active, + }); } diff --git a/packages/inspection/lib/data/data_source/remote/inspection/inspection_remote_imp.dart b/packages/inspection/lib/data/data_source/remote/inspection/inspection_remote_imp.dart index 08ac5a2..ec636b2 100644 --- a/packages/inspection/lib/data/data_source/remote/inspection/inspection_remote_imp.dart +++ b/packages/inspection/lib/data/data_source/remote/inspection/inspection_remote_imp.dart @@ -1,5 +1,6 @@ import 'package:rasadyar_core/core.dart'; import 'package:rasadyar_inspection/data/data_source/remote/inspection/inspection_remote.dart'; +import 'package:rasadyar_inspection/data/model/response/hatching_details/hatching_details.dart'; import 'package:rasadyar_inspection/data/model/response/poultry_location/poultry_location_model.dart'; class InspectionRemoteDataSourceImp implements InspectionRemoteDataSource { @@ -45,4 +46,17 @@ class InspectionRemoteDataSourceImp implements InspectionRemoteDataSource { return res.data; } + + @override + Future?> getHatchingDetails({String? code, bool? active}) async { + DioRemote dioRemote = DioRemote(baseUrl: 'https://habackend.rasadyaar.ir/'); + await dioRemote.init(); + var res = await dioRemote.get( + "get_hatching_for_bazrasi/", + queryParameters: buildRawQueryParams(queryParams: {'code': code, 'active': active}), + headers: {'Content-Type': 'application/json'}, + fromJsonList: (json) => json.map((e) => HatchingDetails.fromJson(e)).toList(), + ); + return res.data; + } } diff --git a/packages/inspection/lib/data/model/response/hatching_details/hatching_details.dart b/packages/inspection/lib/data/model/response/hatching_details/hatching_details.dart index f8b606d..de8e28a 100644 --- a/packages/inspection/lib/data/model/response/hatching_details/hatching_details.dart +++ b/packages/inspection/lib/data/model/response/hatching_details/hatching_details.dart @@ -6,7 +6,7 @@ part 'hatching_details.g.dart'; @freezed abstract class HatchingDetails with _$HatchingDetails { const factory HatchingDetails({ - required int id, + int? id, String? chainCompany, int? age, dynamic inspectionLosses, diff --git a/packages/inspection/lib/data/model/response/hatching_details/hatching_details.freezed.dart b/packages/inspection/lib/data/model/response/hatching_details/hatching_details.freezed.dart index e7d53d6..2bbf91e 100644 --- a/packages/inspection/lib/data/model/response/hatching_details/hatching_details.freezed.dart +++ b/packages/inspection/lib/data/model/response/hatching_details/hatching_details.freezed.dart @@ -15,7 +15,7 @@ T _$identity(T value) => value; /// @nodoc mixin _$HatchingDetails { - int get id; String? get chainCompany; int? get age; dynamic get inspectionLosses; VetFarm? get vetFarm; ActiveKill? get activeKill; KillingInfo? get killingInfo; FreeGovernmentalInfo? get freeGovernmentalInfo; String? get key; DateTime? get createDate; DateTime? get modifyDate; bool? get trash; bool? get hasChainCompany; dynamic get poultryIdForeignKey; dynamic get poultryHatchingIdKey; int? get quantity; int? get losses; int? get leftOver; int? get killedQuantity; int? get extraKilledQuantity; double? get governmentalKilledQuantity; double? get governmentalQuantity; double? get freeKilledQuantity; double? get freeQuantity; double? get chainKilledQuantity; double? get chainKilledWeight; double? get outProvinceKilledWeight; double? get outProvinceKilledQuantity; double? get exportKilledWeight; double? get exportKilledQuantity; double? get totalCommitment; String? get commitmentType; double? get totalCommitmentQuantity; double? get totalFreeCommitmentQuantity; double? get totalFreeCommitmentWeight; double? get totalKilledWeight; double? get totalAverageKilledWeight; int? get requestLeftOver; int? get hall; DateTime? get date; DateTime? get predicateDate; String? get chickenBreed; int? get period; String? get allowHatching; String? get state; bool? get archive; bool? get violation; dynamic get message; dynamic get registrar; List? get breed; int? get cityNumber; String? get cityName; int? get provinceNumber; String? get provinceName; LastChange? get lastChange; int? get chickenAge; int? get nowAge; LatestHatchingChange? get latestHatchingChange; dynamic get violationReport; String? get violationMessage; dynamic get violationImage; dynamic get violationReporter; dynamic get violationReportDate; dynamic get violationReportEditor; dynamic get violationReportEditDate; int? get totalLosses; int? get directLosses; dynamic get directLossesInputer; dynamic get directLossesDate; dynamic get directLossesEditor; dynamic get directLossesLastEditDate; dynamic get endPeriodLossesInputer; dynamic get endPeriodLossesDate; dynamic get endPeriodLossesEditor; dynamic get endPeriodLossesLastEditDate; String? get breedingUniqueId; String? get licenceNumber; bool? get temporaryTrash; bool? get temporaryDeleted; dynamic get firstDateInputArchive; dynamic get secondDateInputArchive; dynamic get inputArchiver; dynamic get outputArchiveDate; dynamic get outputArchiver; double? get barDifferenceRequestWeight; double? get barDifferenceRequestQuantity; dynamic get healthCertificate; int? get samasatDischargePercentage; String? get personTypeName; String? get interactTypeName; String? get unionTypeName; String? get certId; int? get increaseQuantity; dynamic get tenantFullname; dynamic get tenantNationalCode; dynamic get tenantMobile; dynamic get tenantCity; bool? get hasTenant; dynamic get createdBy; dynamic get modifiedBy; int? get poultry; + int? get id; String? get chainCompany; int? get age; dynamic get inspectionLosses; VetFarm? get vetFarm; ActiveKill? get activeKill; KillingInfo? get killingInfo; FreeGovernmentalInfo? get freeGovernmentalInfo; String? get key; DateTime? get createDate; DateTime? get modifyDate; bool? get trash; bool? get hasChainCompany; dynamic get poultryIdForeignKey; dynamic get poultryHatchingIdKey; int? get quantity; int? get losses; int? get leftOver; int? get killedQuantity; int? get extraKilledQuantity; double? get governmentalKilledQuantity; double? get governmentalQuantity; double? get freeKilledQuantity; double? get freeQuantity; double? get chainKilledQuantity; double? get chainKilledWeight; double? get outProvinceKilledWeight; double? get outProvinceKilledQuantity; double? get exportKilledWeight; double? get exportKilledQuantity; double? get totalCommitment; String? get commitmentType; double? get totalCommitmentQuantity; double? get totalFreeCommitmentQuantity; double? get totalFreeCommitmentWeight; double? get totalKilledWeight; double? get totalAverageKilledWeight; int? get requestLeftOver; int? get hall; DateTime? get date; DateTime? get predicateDate; String? get chickenBreed; int? get period; String? get allowHatching; String? get state; bool? get archive; bool? get violation; dynamic get message; dynamic get registrar; List? get breed; int? get cityNumber; String? get cityName; int? get provinceNumber; String? get provinceName; LastChange? get lastChange; int? get chickenAge; int? get nowAge; LatestHatchingChange? get latestHatchingChange; dynamic get violationReport; String? get violationMessage; dynamic get violationImage; dynamic get violationReporter; dynamic get violationReportDate; dynamic get violationReportEditor; dynamic get violationReportEditDate; int? get totalLosses; int? get directLosses; dynamic get directLossesInputer; dynamic get directLossesDate; dynamic get directLossesEditor; dynamic get directLossesLastEditDate; dynamic get endPeriodLossesInputer; dynamic get endPeriodLossesDate; dynamic get endPeriodLossesEditor; dynamic get endPeriodLossesLastEditDate; String? get breedingUniqueId; String? get licenceNumber; bool? get temporaryTrash; bool? get temporaryDeleted; dynamic get firstDateInputArchive; dynamic get secondDateInputArchive; dynamic get inputArchiver; dynamic get outputArchiveDate; dynamic get outputArchiver; double? get barDifferenceRequestWeight; double? get barDifferenceRequestQuantity; dynamic get healthCertificate; int? get samasatDischargePercentage; String? get personTypeName; String? get interactTypeName; String? get unionTypeName; String? get certId; int? get increaseQuantity; dynamic get tenantFullname; dynamic get tenantNationalCode; dynamic get tenantMobile; dynamic get tenantCity; bool? get hasTenant; dynamic get createdBy; dynamic get modifiedBy; int? get poultry; /// Create a copy of HatchingDetails /// with the given fields replaced by the non-null parameter values. @JsonKey(includeFromJson: false, includeToJson: false) @@ -48,7 +48,7 @@ abstract mixin class $HatchingDetailsCopyWith<$Res> { factory $HatchingDetailsCopyWith(HatchingDetails value, $Res Function(HatchingDetails) _then) = _$HatchingDetailsCopyWithImpl; @useResult $Res call({ - int id, String? chainCompany, int? age, dynamic inspectionLosses, VetFarm? vetFarm, ActiveKill? activeKill, KillingInfo? killingInfo, FreeGovernmentalInfo? freeGovernmentalInfo, String? key, DateTime? createDate, DateTime? modifyDate, bool? trash, bool? hasChainCompany, dynamic poultryIdForeignKey, dynamic poultryHatchingIdKey, int? quantity, int? losses, int? leftOver, int? killedQuantity, int? extraKilledQuantity, double? governmentalKilledQuantity, double? governmentalQuantity, double? freeKilledQuantity, double? freeQuantity, double? chainKilledQuantity, double? chainKilledWeight, double? outProvinceKilledWeight, double? outProvinceKilledQuantity, double? exportKilledWeight, double? exportKilledQuantity, double? totalCommitment, String? commitmentType, double? totalCommitmentQuantity, double? totalFreeCommitmentQuantity, double? totalFreeCommitmentWeight, double? totalKilledWeight, double? totalAverageKilledWeight, int? requestLeftOver, int? hall, DateTime? date, DateTime? predicateDate, String? chickenBreed, int? period, String? allowHatching, String? state, bool? archive, bool? violation, dynamic message, dynamic registrar, List? breed, int? cityNumber, String? cityName, int? provinceNumber, String? provinceName, LastChange? lastChange, int? chickenAge, int? nowAge, LatestHatchingChange? latestHatchingChange, dynamic violationReport, String? violationMessage, dynamic violationImage, dynamic violationReporter, dynamic violationReportDate, dynamic violationReportEditor, dynamic violationReportEditDate, int? totalLosses, int? directLosses, dynamic directLossesInputer, dynamic directLossesDate, dynamic directLossesEditor, dynamic directLossesLastEditDate, dynamic endPeriodLossesInputer, dynamic endPeriodLossesDate, dynamic endPeriodLossesEditor, dynamic endPeriodLossesLastEditDate, String? breedingUniqueId, String? licenceNumber, bool? temporaryTrash, bool? temporaryDeleted, dynamic firstDateInputArchive, dynamic secondDateInputArchive, dynamic inputArchiver, dynamic outputArchiveDate, dynamic outputArchiver, double? barDifferenceRequestWeight, double? barDifferenceRequestQuantity, dynamic healthCertificate, int? samasatDischargePercentage, String? personTypeName, String? interactTypeName, String? unionTypeName, String? certId, int? increaseQuantity, dynamic tenantFullname, dynamic tenantNationalCode, dynamic tenantMobile, dynamic tenantCity, bool? hasTenant, dynamic createdBy, dynamic modifiedBy, int? poultry + int? id, String? chainCompany, int? age, dynamic inspectionLosses, VetFarm? vetFarm, ActiveKill? activeKill, KillingInfo? killingInfo, FreeGovernmentalInfo? freeGovernmentalInfo, String? key, DateTime? createDate, DateTime? modifyDate, bool? trash, bool? hasChainCompany, dynamic poultryIdForeignKey, dynamic poultryHatchingIdKey, int? quantity, int? losses, int? leftOver, int? killedQuantity, int? extraKilledQuantity, double? governmentalKilledQuantity, double? governmentalQuantity, double? freeKilledQuantity, double? freeQuantity, double? chainKilledQuantity, double? chainKilledWeight, double? outProvinceKilledWeight, double? outProvinceKilledQuantity, double? exportKilledWeight, double? exportKilledQuantity, double? totalCommitment, String? commitmentType, double? totalCommitmentQuantity, double? totalFreeCommitmentQuantity, double? totalFreeCommitmentWeight, double? totalKilledWeight, double? totalAverageKilledWeight, int? requestLeftOver, int? hall, DateTime? date, DateTime? predicateDate, String? chickenBreed, int? period, String? allowHatching, String? state, bool? archive, bool? violation, dynamic message, dynamic registrar, List? breed, int? cityNumber, String? cityName, int? provinceNumber, String? provinceName, LastChange? lastChange, int? chickenAge, int? nowAge, LatestHatchingChange? latestHatchingChange, dynamic violationReport, String? violationMessage, dynamic violationImage, dynamic violationReporter, dynamic violationReportDate, dynamic violationReportEditor, dynamic violationReportEditDate, int? totalLosses, int? directLosses, dynamic directLossesInputer, dynamic directLossesDate, dynamic directLossesEditor, dynamic directLossesLastEditDate, dynamic endPeriodLossesInputer, dynamic endPeriodLossesDate, dynamic endPeriodLossesEditor, dynamic endPeriodLossesLastEditDate, String? breedingUniqueId, String? licenceNumber, bool? temporaryTrash, bool? temporaryDeleted, dynamic firstDateInputArchive, dynamic secondDateInputArchive, dynamic inputArchiver, dynamic outputArchiveDate, dynamic outputArchiver, double? barDifferenceRequestWeight, double? barDifferenceRequestQuantity, dynamic healthCertificate, int? samasatDischargePercentage, String? personTypeName, String? interactTypeName, String? unionTypeName, String? certId, int? increaseQuantity, dynamic tenantFullname, dynamic tenantNationalCode, dynamic tenantMobile, dynamic tenantCity, bool? hasTenant, dynamic createdBy, dynamic modifiedBy, int? poultry }); @@ -65,10 +65,10 @@ class _$HatchingDetailsCopyWithImpl<$Res> /// Create a copy of HatchingDetails /// with the given fields replaced by the non-null parameter values. -@pragma('vm:prefer-inline') @override $Res call({Object? id = null,Object? chainCompany = freezed,Object? age = freezed,Object? inspectionLosses = freezed,Object? vetFarm = freezed,Object? activeKill = freezed,Object? killingInfo = freezed,Object? freeGovernmentalInfo = freezed,Object? key = freezed,Object? createDate = freezed,Object? modifyDate = freezed,Object? trash = freezed,Object? hasChainCompany = freezed,Object? poultryIdForeignKey = freezed,Object? poultryHatchingIdKey = freezed,Object? quantity = freezed,Object? losses = freezed,Object? leftOver = freezed,Object? killedQuantity = freezed,Object? extraKilledQuantity = freezed,Object? governmentalKilledQuantity = freezed,Object? governmentalQuantity = freezed,Object? freeKilledQuantity = freezed,Object? freeQuantity = freezed,Object? chainKilledQuantity = freezed,Object? chainKilledWeight = freezed,Object? outProvinceKilledWeight = freezed,Object? outProvinceKilledQuantity = freezed,Object? exportKilledWeight = freezed,Object? exportKilledQuantity = freezed,Object? totalCommitment = freezed,Object? commitmentType = freezed,Object? totalCommitmentQuantity = freezed,Object? totalFreeCommitmentQuantity = freezed,Object? totalFreeCommitmentWeight = freezed,Object? totalKilledWeight = freezed,Object? totalAverageKilledWeight = freezed,Object? requestLeftOver = freezed,Object? hall = freezed,Object? date = freezed,Object? predicateDate = freezed,Object? chickenBreed = freezed,Object? period = freezed,Object? allowHatching = freezed,Object? state = freezed,Object? archive = freezed,Object? violation = freezed,Object? message = freezed,Object? registrar = freezed,Object? breed = freezed,Object? cityNumber = freezed,Object? cityName = freezed,Object? provinceNumber = freezed,Object? provinceName = freezed,Object? lastChange = freezed,Object? chickenAge = freezed,Object? nowAge = freezed,Object? latestHatchingChange = freezed,Object? violationReport = freezed,Object? violationMessage = freezed,Object? violationImage = freezed,Object? violationReporter = freezed,Object? violationReportDate = freezed,Object? violationReportEditor = freezed,Object? violationReportEditDate = freezed,Object? totalLosses = freezed,Object? directLosses = freezed,Object? directLossesInputer = freezed,Object? directLossesDate = freezed,Object? directLossesEditor = freezed,Object? directLossesLastEditDate = freezed,Object? endPeriodLossesInputer = freezed,Object? endPeriodLossesDate = freezed,Object? endPeriodLossesEditor = freezed,Object? endPeriodLossesLastEditDate = freezed,Object? breedingUniqueId = freezed,Object? licenceNumber = freezed,Object? temporaryTrash = freezed,Object? temporaryDeleted = freezed,Object? firstDateInputArchive = freezed,Object? secondDateInputArchive = freezed,Object? inputArchiver = freezed,Object? outputArchiveDate = freezed,Object? outputArchiver = freezed,Object? barDifferenceRequestWeight = freezed,Object? barDifferenceRequestQuantity = freezed,Object? healthCertificate = freezed,Object? samasatDischargePercentage = freezed,Object? personTypeName = freezed,Object? interactTypeName = freezed,Object? unionTypeName = freezed,Object? certId = freezed,Object? increaseQuantity = freezed,Object? tenantFullname = freezed,Object? tenantNationalCode = freezed,Object? tenantMobile = freezed,Object? tenantCity = freezed,Object? hasTenant = freezed,Object? createdBy = freezed,Object? modifiedBy = freezed,Object? poultry = freezed,}) { +@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? chainCompany = freezed,Object? age = freezed,Object? inspectionLosses = freezed,Object? vetFarm = freezed,Object? activeKill = freezed,Object? killingInfo = freezed,Object? freeGovernmentalInfo = freezed,Object? key = freezed,Object? createDate = freezed,Object? modifyDate = freezed,Object? trash = freezed,Object? hasChainCompany = freezed,Object? poultryIdForeignKey = freezed,Object? poultryHatchingIdKey = freezed,Object? quantity = freezed,Object? losses = freezed,Object? leftOver = freezed,Object? killedQuantity = freezed,Object? extraKilledQuantity = freezed,Object? governmentalKilledQuantity = freezed,Object? governmentalQuantity = freezed,Object? freeKilledQuantity = freezed,Object? freeQuantity = freezed,Object? chainKilledQuantity = freezed,Object? chainKilledWeight = freezed,Object? outProvinceKilledWeight = freezed,Object? outProvinceKilledQuantity = freezed,Object? exportKilledWeight = freezed,Object? exportKilledQuantity = freezed,Object? totalCommitment = freezed,Object? commitmentType = freezed,Object? totalCommitmentQuantity = freezed,Object? totalFreeCommitmentQuantity = freezed,Object? totalFreeCommitmentWeight = freezed,Object? totalKilledWeight = freezed,Object? totalAverageKilledWeight = freezed,Object? requestLeftOver = freezed,Object? hall = freezed,Object? date = freezed,Object? predicateDate = freezed,Object? chickenBreed = freezed,Object? period = freezed,Object? allowHatching = freezed,Object? state = freezed,Object? archive = freezed,Object? violation = freezed,Object? message = freezed,Object? registrar = freezed,Object? breed = freezed,Object? cityNumber = freezed,Object? cityName = freezed,Object? provinceNumber = freezed,Object? provinceName = freezed,Object? lastChange = freezed,Object? chickenAge = freezed,Object? nowAge = freezed,Object? latestHatchingChange = freezed,Object? violationReport = freezed,Object? violationMessage = freezed,Object? violationImage = freezed,Object? violationReporter = freezed,Object? violationReportDate = freezed,Object? violationReportEditor = freezed,Object? violationReportEditDate = freezed,Object? totalLosses = freezed,Object? directLosses = freezed,Object? directLossesInputer = freezed,Object? directLossesDate = freezed,Object? directLossesEditor = freezed,Object? directLossesLastEditDate = freezed,Object? endPeriodLossesInputer = freezed,Object? endPeriodLossesDate = freezed,Object? endPeriodLossesEditor = freezed,Object? endPeriodLossesLastEditDate = freezed,Object? breedingUniqueId = freezed,Object? licenceNumber = freezed,Object? temporaryTrash = freezed,Object? temporaryDeleted = freezed,Object? firstDateInputArchive = freezed,Object? secondDateInputArchive = freezed,Object? inputArchiver = freezed,Object? outputArchiveDate = freezed,Object? outputArchiver = freezed,Object? barDifferenceRequestWeight = freezed,Object? barDifferenceRequestQuantity = freezed,Object? healthCertificate = freezed,Object? samasatDischargePercentage = freezed,Object? personTypeName = freezed,Object? interactTypeName = freezed,Object? unionTypeName = freezed,Object? certId = freezed,Object? increaseQuantity = freezed,Object? tenantFullname = freezed,Object? tenantNationalCode = freezed,Object? tenantMobile = freezed,Object? tenantCity = freezed,Object? hasTenant = freezed,Object? createdBy = freezed,Object? modifiedBy = freezed,Object? poultry = freezed,}) { return _then(_self.copyWith( -id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable -as int,chainCompany: freezed == chainCompany ? _self.chainCompany : chainCompany // ignore: cast_nullable_to_non_nullable +id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as int?,chainCompany: freezed == chainCompany ? _self.chainCompany : chainCompany // ignore: cast_nullable_to_non_nullable as String?,age: freezed == age ? _self.age : age // ignore: cast_nullable_to_non_nullable as int?,inspectionLosses: freezed == inspectionLosses ? _self.inspectionLosses : inspectionLosses // ignore: cast_nullable_to_non_nullable as dynamic,vetFarm: freezed == vetFarm ? _self.vetFarm : vetFarm // ignore: cast_nullable_to_non_nullable @@ -325,7 +325,7 @@ return $default(_that);case _: /// } /// ``` -@optionalTypeArgs TResult maybeWhen(TResult Function( int id, String? chainCompany, int? age, dynamic inspectionLosses, VetFarm? vetFarm, ActiveKill? activeKill, KillingInfo? killingInfo, FreeGovernmentalInfo? freeGovernmentalInfo, String? key, DateTime? createDate, DateTime? modifyDate, bool? trash, bool? hasChainCompany, dynamic poultryIdForeignKey, dynamic poultryHatchingIdKey, int? quantity, int? losses, int? leftOver, int? killedQuantity, int? extraKilledQuantity, double? governmentalKilledQuantity, double? governmentalQuantity, double? freeKilledQuantity, double? freeQuantity, double? chainKilledQuantity, double? chainKilledWeight, double? outProvinceKilledWeight, double? outProvinceKilledQuantity, double? exportKilledWeight, double? exportKilledQuantity, double? totalCommitment, String? commitmentType, double? totalCommitmentQuantity, double? totalFreeCommitmentQuantity, double? totalFreeCommitmentWeight, double? totalKilledWeight, double? totalAverageKilledWeight, int? requestLeftOver, int? hall, DateTime? date, DateTime? predicateDate, String? chickenBreed, int? period, String? allowHatching, String? state, bool? archive, bool? violation, dynamic message, dynamic registrar, List? breed, int? cityNumber, String? cityName, int? provinceNumber, String? provinceName, LastChange? lastChange, int? chickenAge, int? nowAge, LatestHatchingChange? latestHatchingChange, dynamic violationReport, String? violationMessage, dynamic violationImage, dynamic violationReporter, dynamic violationReportDate, dynamic violationReportEditor, dynamic violationReportEditDate, int? totalLosses, int? directLosses, dynamic directLossesInputer, dynamic directLossesDate, dynamic directLossesEditor, dynamic directLossesLastEditDate, dynamic endPeriodLossesInputer, dynamic endPeriodLossesDate, dynamic endPeriodLossesEditor, dynamic endPeriodLossesLastEditDate, String? breedingUniqueId, String? licenceNumber, bool? temporaryTrash, bool? temporaryDeleted, dynamic firstDateInputArchive, dynamic secondDateInputArchive, dynamic inputArchiver, dynamic outputArchiveDate, dynamic outputArchiver, double? barDifferenceRequestWeight, double? barDifferenceRequestQuantity, dynamic healthCertificate, int? samasatDischargePercentage, String? personTypeName, String? interactTypeName, String? unionTypeName, String? certId, int? increaseQuantity, dynamic tenantFullname, dynamic tenantNationalCode, dynamic tenantMobile, dynamic tenantCity, bool? hasTenant, dynamic createdBy, dynamic modifiedBy, int? poultry)? $default,{required TResult orElse(),}) {final _that = this; +@optionalTypeArgs TResult maybeWhen(TResult Function( int? id, String? chainCompany, int? age, dynamic inspectionLosses, VetFarm? vetFarm, ActiveKill? activeKill, KillingInfo? killingInfo, FreeGovernmentalInfo? freeGovernmentalInfo, String? key, DateTime? createDate, DateTime? modifyDate, bool? trash, bool? hasChainCompany, dynamic poultryIdForeignKey, dynamic poultryHatchingIdKey, int? quantity, int? losses, int? leftOver, int? killedQuantity, int? extraKilledQuantity, double? governmentalKilledQuantity, double? governmentalQuantity, double? freeKilledQuantity, double? freeQuantity, double? chainKilledQuantity, double? chainKilledWeight, double? outProvinceKilledWeight, double? outProvinceKilledQuantity, double? exportKilledWeight, double? exportKilledQuantity, double? totalCommitment, String? commitmentType, double? totalCommitmentQuantity, double? totalFreeCommitmentQuantity, double? totalFreeCommitmentWeight, double? totalKilledWeight, double? totalAverageKilledWeight, int? requestLeftOver, int? hall, DateTime? date, DateTime? predicateDate, String? chickenBreed, int? period, String? allowHatching, String? state, bool? archive, bool? violation, dynamic message, dynamic registrar, List? breed, int? cityNumber, String? cityName, int? provinceNumber, String? provinceName, LastChange? lastChange, int? chickenAge, int? nowAge, LatestHatchingChange? latestHatchingChange, dynamic violationReport, String? violationMessage, dynamic violationImage, dynamic violationReporter, dynamic violationReportDate, dynamic violationReportEditor, dynamic violationReportEditDate, int? totalLosses, int? directLosses, dynamic directLossesInputer, dynamic directLossesDate, dynamic directLossesEditor, dynamic directLossesLastEditDate, dynamic endPeriodLossesInputer, dynamic endPeriodLossesDate, dynamic endPeriodLossesEditor, dynamic endPeriodLossesLastEditDate, String? breedingUniqueId, String? licenceNumber, bool? temporaryTrash, bool? temporaryDeleted, dynamic firstDateInputArchive, dynamic secondDateInputArchive, dynamic inputArchiver, dynamic outputArchiveDate, dynamic outputArchiver, double? barDifferenceRequestWeight, double? barDifferenceRequestQuantity, dynamic healthCertificate, int? samasatDischargePercentage, String? personTypeName, String? interactTypeName, String? unionTypeName, String? certId, int? increaseQuantity, dynamic tenantFullname, dynamic tenantNationalCode, dynamic tenantMobile, dynamic tenantCity, bool? hasTenant, dynamic createdBy, dynamic modifiedBy, int? poultry)? $default,{required TResult orElse(),}) {final _that = this; switch (_that) { case _HatchingDetails() when $default != null: return $default(_that.id,_that.chainCompany,_that.age,_that.inspectionLosses,_that.vetFarm,_that.activeKill,_that.killingInfo,_that.freeGovernmentalInfo,_that.key,_that.createDate,_that.modifyDate,_that.trash,_that.hasChainCompany,_that.poultryIdForeignKey,_that.poultryHatchingIdKey,_that.quantity,_that.losses,_that.leftOver,_that.killedQuantity,_that.extraKilledQuantity,_that.governmentalKilledQuantity,_that.governmentalQuantity,_that.freeKilledQuantity,_that.freeQuantity,_that.chainKilledQuantity,_that.chainKilledWeight,_that.outProvinceKilledWeight,_that.outProvinceKilledQuantity,_that.exportKilledWeight,_that.exportKilledQuantity,_that.totalCommitment,_that.commitmentType,_that.totalCommitmentQuantity,_that.totalFreeCommitmentQuantity,_that.totalFreeCommitmentWeight,_that.totalKilledWeight,_that.totalAverageKilledWeight,_that.requestLeftOver,_that.hall,_that.date,_that.predicateDate,_that.chickenBreed,_that.period,_that.allowHatching,_that.state,_that.archive,_that.violation,_that.message,_that.registrar,_that.breed,_that.cityNumber,_that.cityName,_that.provinceNumber,_that.provinceName,_that.lastChange,_that.chickenAge,_that.nowAge,_that.latestHatchingChange,_that.violationReport,_that.violationMessage,_that.violationImage,_that.violationReporter,_that.violationReportDate,_that.violationReportEditor,_that.violationReportEditDate,_that.totalLosses,_that.directLosses,_that.directLossesInputer,_that.directLossesDate,_that.directLossesEditor,_that.directLossesLastEditDate,_that.endPeriodLossesInputer,_that.endPeriodLossesDate,_that.endPeriodLossesEditor,_that.endPeriodLossesLastEditDate,_that.breedingUniqueId,_that.licenceNumber,_that.temporaryTrash,_that.temporaryDeleted,_that.firstDateInputArchive,_that.secondDateInputArchive,_that.inputArchiver,_that.outputArchiveDate,_that.outputArchiver,_that.barDifferenceRequestWeight,_that.barDifferenceRequestQuantity,_that.healthCertificate,_that.samasatDischargePercentage,_that.personTypeName,_that.interactTypeName,_that.unionTypeName,_that.certId,_that.increaseQuantity,_that.tenantFullname,_that.tenantNationalCode,_that.tenantMobile,_that.tenantCity,_that.hasTenant,_that.createdBy,_that.modifiedBy,_that.poultry);case _: @@ -346,7 +346,7 @@ return $default(_that.id,_that.chainCompany,_that.age,_that.inspectionLosses,_th /// } /// ``` -@optionalTypeArgs TResult when(TResult Function( int id, String? chainCompany, int? age, dynamic inspectionLosses, VetFarm? vetFarm, ActiveKill? activeKill, KillingInfo? killingInfo, FreeGovernmentalInfo? freeGovernmentalInfo, String? key, DateTime? createDate, DateTime? modifyDate, bool? trash, bool? hasChainCompany, dynamic poultryIdForeignKey, dynamic poultryHatchingIdKey, int? quantity, int? losses, int? leftOver, int? killedQuantity, int? extraKilledQuantity, double? governmentalKilledQuantity, double? governmentalQuantity, double? freeKilledQuantity, double? freeQuantity, double? chainKilledQuantity, double? chainKilledWeight, double? outProvinceKilledWeight, double? outProvinceKilledQuantity, double? exportKilledWeight, double? exportKilledQuantity, double? totalCommitment, String? commitmentType, double? totalCommitmentQuantity, double? totalFreeCommitmentQuantity, double? totalFreeCommitmentWeight, double? totalKilledWeight, double? totalAverageKilledWeight, int? requestLeftOver, int? hall, DateTime? date, DateTime? predicateDate, String? chickenBreed, int? period, String? allowHatching, String? state, bool? archive, bool? violation, dynamic message, dynamic registrar, List? breed, int? cityNumber, String? cityName, int? provinceNumber, String? provinceName, LastChange? lastChange, int? chickenAge, int? nowAge, LatestHatchingChange? latestHatchingChange, dynamic violationReport, String? violationMessage, dynamic violationImage, dynamic violationReporter, dynamic violationReportDate, dynamic violationReportEditor, dynamic violationReportEditDate, int? totalLosses, int? directLosses, dynamic directLossesInputer, dynamic directLossesDate, dynamic directLossesEditor, dynamic directLossesLastEditDate, dynamic endPeriodLossesInputer, dynamic endPeriodLossesDate, dynamic endPeriodLossesEditor, dynamic endPeriodLossesLastEditDate, String? breedingUniqueId, String? licenceNumber, bool? temporaryTrash, bool? temporaryDeleted, dynamic firstDateInputArchive, dynamic secondDateInputArchive, dynamic inputArchiver, dynamic outputArchiveDate, dynamic outputArchiver, double? barDifferenceRequestWeight, double? barDifferenceRequestQuantity, dynamic healthCertificate, int? samasatDischargePercentage, String? personTypeName, String? interactTypeName, String? unionTypeName, String? certId, int? increaseQuantity, dynamic tenantFullname, dynamic tenantNationalCode, dynamic tenantMobile, dynamic tenantCity, bool? hasTenant, dynamic createdBy, dynamic modifiedBy, int? poultry) $default,) {final _that = this; +@optionalTypeArgs TResult when(TResult Function( int? id, String? chainCompany, int? age, dynamic inspectionLosses, VetFarm? vetFarm, ActiveKill? activeKill, KillingInfo? killingInfo, FreeGovernmentalInfo? freeGovernmentalInfo, String? key, DateTime? createDate, DateTime? modifyDate, bool? trash, bool? hasChainCompany, dynamic poultryIdForeignKey, dynamic poultryHatchingIdKey, int? quantity, int? losses, int? leftOver, int? killedQuantity, int? extraKilledQuantity, double? governmentalKilledQuantity, double? governmentalQuantity, double? freeKilledQuantity, double? freeQuantity, double? chainKilledQuantity, double? chainKilledWeight, double? outProvinceKilledWeight, double? outProvinceKilledQuantity, double? exportKilledWeight, double? exportKilledQuantity, double? totalCommitment, String? commitmentType, double? totalCommitmentQuantity, double? totalFreeCommitmentQuantity, double? totalFreeCommitmentWeight, double? totalKilledWeight, double? totalAverageKilledWeight, int? requestLeftOver, int? hall, DateTime? date, DateTime? predicateDate, String? chickenBreed, int? period, String? allowHatching, String? state, bool? archive, bool? violation, dynamic message, dynamic registrar, List? breed, int? cityNumber, String? cityName, int? provinceNumber, String? provinceName, LastChange? lastChange, int? chickenAge, int? nowAge, LatestHatchingChange? latestHatchingChange, dynamic violationReport, String? violationMessage, dynamic violationImage, dynamic violationReporter, dynamic violationReportDate, dynamic violationReportEditor, dynamic violationReportEditDate, int? totalLosses, int? directLosses, dynamic directLossesInputer, dynamic directLossesDate, dynamic directLossesEditor, dynamic directLossesLastEditDate, dynamic endPeriodLossesInputer, dynamic endPeriodLossesDate, dynamic endPeriodLossesEditor, dynamic endPeriodLossesLastEditDate, String? breedingUniqueId, String? licenceNumber, bool? temporaryTrash, bool? temporaryDeleted, dynamic firstDateInputArchive, dynamic secondDateInputArchive, dynamic inputArchiver, dynamic outputArchiveDate, dynamic outputArchiver, double? barDifferenceRequestWeight, double? barDifferenceRequestQuantity, dynamic healthCertificate, int? samasatDischargePercentage, String? personTypeName, String? interactTypeName, String? unionTypeName, String? certId, int? increaseQuantity, dynamic tenantFullname, dynamic tenantNationalCode, dynamic tenantMobile, dynamic tenantCity, bool? hasTenant, dynamic createdBy, dynamic modifiedBy, int? poultry) $default,) {final _that = this; switch (_that) { case _HatchingDetails(): return $default(_that.id,_that.chainCompany,_that.age,_that.inspectionLosses,_that.vetFarm,_that.activeKill,_that.killingInfo,_that.freeGovernmentalInfo,_that.key,_that.createDate,_that.modifyDate,_that.trash,_that.hasChainCompany,_that.poultryIdForeignKey,_that.poultryHatchingIdKey,_that.quantity,_that.losses,_that.leftOver,_that.killedQuantity,_that.extraKilledQuantity,_that.governmentalKilledQuantity,_that.governmentalQuantity,_that.freeKilledQuantity,_that.freeQuantity,_that.chainKilledQuantity,_that.chainKilledWeight,_that.outProvinceKilledWeight,_that.outProvinceKilledQuantity,_that.exportKilledWeight,_that.exportKilledQuantity,_that.totalCommitment,_that.commitmentType,_that.totalCommitmentQuantity,_that.totalFreeCommitmentQuantity,_that.totalFreeCommitmentWeight,_that.totalKilledWeight,_that.totalAverageKilledWeight,_that.requestLeftOver,_that.hall,_that.date,_that.predicateDate,_that.chickenBreed,_that.period,_that.allowHatching,_that.state,_that.archive,_that.violation,_that.message,_that.registrar,_that.breed,_that.cityNumber,_that.cityName,_that.provinceNumber,_that.provinceName,_that.lastChange,_that.chickenAge,_that.nowAge,_that.latestHatchingChange,_that.violationReport,_that.violationMessage,_that.violationImage,_that.violationReporter,_that.violationReportDate,_that.violationReportEditor,_that.violationReportEditDate,_that.totalLosses,_that.directLosses,_that.directLossesInputer,_that.directLossesDate,_that.directLossesEditor,_that.directLossesLastEditDate,_that.endPeriodLossesInputer,_that.endPeriodLossesDate,_that.endPeriodLossesEditor,_that.endPeriodLossesLastEditDate,_that.breedingUniqueId,_that.licenceNumber,_that.temporaryTrash,_that.temporaryDeleted,_that.firstDateInputArchive,_that.secondDateInputArchive,_that.inputArchiver,_that.outputArchiveDate,_that.outputArchiver,_that.barDifferenceRequestWeight,_that.barDifferenceRequestQuantity,_that.healthCertificate,_that.samasatDischargePercentage,_that.personTypeName,_that.interactTypeName,_that.unionTypeName,_that.certId,_that.increaseQuantity,_that.tenantFullname,_that.tenantNationalCode,_that.tenantMobile,_that.tenantCity,_that.hasTenant,_that.createdBy,_that.modifiedBy,_that.poultry);case _: @@ -366,7 +366,7 @@ return $default(_that.id,_that.chainCompany,_that.age,_that.inspectionLosses,_th /// } /// ``` -@optionalTypeArgs TResult? whenOrNull(TResult? Function( int id, String? chainCompany, int? age, dynamic inspectionLosses, VetFarm? vetFarm, ActiveKill? activeKill, KillingInfo? killingInfo, FreeGovernmentalInfo? freeGovernmentalInfo, String? key, DateTime? createDate, DateTime? modifyDate, bool? trash, bool? hasChainCompany, dynamic poultryIdForeignKey, dynamic poultryHatchingIdKey, int? quantity, int? losses, int? leftOver, int? killedQuantity, int? extraKilledQuantity, double? governmentalKilledQuantity, double? governmentalQuantity, double? freeKilledQuantity, double? freeQuantity, double? chainKilledQuantity, double? chainKilledWeight, double? outProvinceKilledWeight, double? outProvinceKilledQuantity, double? exportKilledWeight, double? exportKilledQuantity, double? totalCommitment, String? commitmentType, double? totalCommitmentQuantity, double? totalFreeCommitmentQuantity, double? totalFreeCommitmentWeight, double? totalKilledWeight, double? totalAverageKilledWeight, int? requestLeftOver, int? hall, DateTime? date, DateTime? predicateDate, String? chickenBreed, int? period, String? allowHatching, String? state, bool? archive, bool? violation, dynamic message, dynamic registrar, List? breed, int? cityNumber, String? cityName, int? provinceNumber, String? provinceName, LastChange? lastChange, int? chickenAge, int? nowAge, LatestHatchingChange? latestHatchingChange, dynamic violationReport, String? violationMessage, dynamic violationImage, dynamic violationReporter, dynamic violationReportDate, dynamic violationReportEditor, dynamic violationReportEditDate, int? totalLosses, int? directLosses, dynamic directLossesInputer, dynamic directLossesDate, dynamic directLossesEditor, dynamic directLossesLastEditDate, dynamic endPeriodLossesInputer, dynamic endPeriodLossesDate, dynamic endPeriodLossesEditor, dynamic endPeriodLossesLastEditDate, String? breedingUniqueId, String? licenceNumber, bool? temporaryTrash, bool? temporaryDeleted, dynamic firstDateInputArchive, dynamic secondDateInputArchive, dynamic inputArchiver, dynamic outputArchiveDate, dynamic outputArchiver, double? barDifferenceRequestWeight, double? barDifferenceRequestQuantity, dynamic healthCertificate, int? samasatDischargePercentage, String? personTypeName, String? interactTypeName, String? unionTypeName, String? certId, int? increaseQuantity, dynamic tenantFullname, dynamic tenantNationalCode, dynamic tenantMobile, dynamic tenantCity, bool? hasTenant, dynamic createdBy, dynamic modifiedBy, int? poultry)? $default,) {final _that = this; +@optionalTypeArgs TResult? whenOrNull(TResult? Function( int? id, String? chainCompany, int? age, dynamic inspectionLosses, VetFarm? vetFarm, ActiveKill? activeKill, KillingInfo? killingInfo, FreeGovernmentalInfo? freeGovernmentalInfo, String? key, DateTime? createDate, DateTime? modifyDate, bool? trash, bool? hasChainCompany, dynamic poultryIdForeignKey, dynamic poultryHatchingIdKey, int? quantity, int? losses, int? leftOver, int? killedQuantity, int? extraKilledQuantity, double? governmentalKilledQuantity, double? governmentalQuantity, double? freeKilledQuantity, double? freeQuantity, double? chainKilledQuantity, double? chainKilledWeight, double? outProvinceKilledWeight, double? outProvinceKilledQuantity, double? exportKilledWeight, double? exportKilledQuantity, double? totalCommitment, String? commitmentType, double? totalCommitmentQuantity, double? totalFreeCommitmentQuantity, double? totalFreeCommitmentWeight, double? totalKilledWeight, double? totalAverageKilledWeight, int? requestLeftOver, int? hall, DateTime? date, DateTime? predicateDate, String? chickenBreed, int? period, String? allowHatching, String? state, bool? archive, bool? violation, dynamic message, dynamic registrar, List? breed, int? cityNumber, String? cityName, int? provinceNumber, String? provinceName, LastChange? lastChange, int? chickenAge, int? nowAge, LatestHatchingChange? latestHatchingChange, dynamic violationReport, String? violationMessage, dynamic violationImage, dynamic violationReporter, dynamic violationReportDate, dynamic violationReportEditor, dynamic violationReportEditDate, int? totalLosses, int? directLosses, dynamic directLossesInputer, dynamic directLossesDate, dynamic directLossesEditor, dynamic directLossesLastEditDate, dynamic endPeriodLossesInputer, dynamic endPeriodLossesDate, dynamic endPeriodLossesEditor, dynamic endPeriodLossesLastEditDate, String? breedingUniqueId, String? licenceNumber, bool? temporaryTrash, bool? temporaryDeleted, dynamic firstDateInputArchive, dynamic secondDateInputArchive, dynamic inputArchiver, dynamic outputArchiveDate, dynamic outputArchiver, double? barDifferenceRequestWeight, double? barDifferenceRequestQuantity, dynamic healthCertificate, int? samasatDischargePercentage, String? personTypeName, String? interactTypeName, String? unionTypeName, String? certId, int? increaseQuantity, dynamic tenantFullname, dynamic tenantNationalCode, dynamic tenantMobile, dynamic tenantCity, bool? hasTenant, dynamic createdBy, dynamic modifiedBy, int? poultry)? $default,) {final _that = this; switch (_that) { case _HatchingDetails() when $default != null: return $default(_that.id,_that.chainCompany,_that.age,_that.inspectionLosses,_that.vetFarm,_that.activeKill,_that.killingInfo,_that.freeGovernmentalInfo,_that.key,_that.createDate,_that.modifyDate,_that.trash,_that.hasChainCompany,_that.poultryIdForeignKey,_that.poultryHatchingIdKey,_that.quantity,_that.losses,_that.leftOver,_that.killedQuantity,_that.extraKilledQuantity,_that.governmentalKilledQuantity,_that.governmentalQuantity,_that.freeKilledQuantity,_that.freeQuantity,_that.chainKilledQuantity,_that.chainKilledWeight,_that.outProvinceKilledWeight,_that.outProvinceKilledQuantity,_that.exportKilledWeight,_that.exportKilledQuantity,_that.totalCommitment,_that.commitmentType,_that.totalCommitmentQuantity,_that.totalFreeCommitmentQuantity,_that.totalFreeCommitmentWeight,_that.totalKilledWeight,_that.totalAverageKilledWeight,_that.requestLeftOver,_that.hall,_that.date,_that.predicateDate,_that.chickenBreed,_that.period,_that.allowHatching,_that.state,_that.archive,_that.violation,_that.message,_that.registrar,_that.breed,_that.cityNumber,_that.cityName,_that.provinceNumber,_that.provinceName,_that.lastChange,_that.chickenAge,_that.nowAge,_that.latestHatchingChange,_that.violationReport,_that.violationMessage,_that.violationImage,_that.violationReporter,_that.violationReportDate,_that.violationReportEditor,_that.violationReportEditDate,_that.totalLosses,_that.directLosses,_that.directLossesInputer,_that.directLossesDate,_that.directLossesEditor,_that.directLossesLastEditDate,_that.endPeriodLossesInputer,_that.endPeriodLossesDate,_that.endPeriodLossesEditor,_that.endPeriodLossesLastEditDate,_that.breedingUniqueId,_that.licenceNumber,_that.temporaryTrash,_that.temporaryDeleted,_that.firstDateInputArchive,_that.secondDateInputArchive,_that.inputArchiver,_that.outputArchiveDate,_that.outputArchiver,_that.barDifferenceRequestWeight,_that.barDifferenceRequestQuantity,_that.healthCertificate,_that.samasatDischargePercentage,_that.personTypeName,_that.interactTypeName,_that.unionTypeName,_that.certId,_that.increaseQuantity,_that.tenantFullname,_that.tenantNationalCode,_that.tenantMobile,_that.tenantCity,_that.hasTenant,_that.createdBy,_that.modifiedBy,_that.poultry);case _: @@ -381,10 +381,10 @@ return $default(_that.id,_that.chainCompany,_that.age,_that.inspectionLosses,_th @JsonSerializable() class _HatchingDetails implements HatchingDetails { - const _HatchingDetails({required this.id, this.chainCompany, this.age, this.inspectionLosses, this.vetFarm, this.activeKill, this.killingInfo, this.freeGovernmentalInfo, this.key, this.createDate, this.modifyDate, this.trash, this.hasChainCompany, this.poultryIdForeignKey, this.poultryHatchingIdKey, this.quantity, this.losses, this.leftOver, this.killedQuantity, this.extraKilledQuantity, this.governmentalKilledQuantity, this.governmentalQuantity, this.freeKilledQuantity, this.freeQuantity, this.chainKilledQuantity, this.chainKilledWeight, this.outProvinceKilledWeight, this.outProvinceKilledQuantity, this.exportKilledWeight, this.exportKilledQuantity, this.totalCommitment, this.commitmentType, this.totalCommitmentQuantity, this.totalFreeCommitmentQuantity, this.totalFreeCommitmentWeight, this.totalKilledWeight, this.totalAverageKilledWeight, this.requestLeftOver, this.hall, this.date, this.predicateDate, this.chickenBreed, this.period, this.allowHatching, this.state, this.archive, this.violation, this.message, this.registrar, final List? breed, this.cityNumber, this.cityName, this.provinceNumber, this.provinceName, this.lastChange, this.chickenAge, this.nowAge, this.latestHatchingChange, this.violationReport, this.violationMessage, this.violationImage, this.violationReporter, this.violationReportDate, this.violationReportEditor, this.violationReportEditDate, this.totalLosses, this.directLosses, this.directLossesInputer, this.directLossesDate, this.directLossesEditor, this.directLossesLastEditDate, this.endPeriodLossesInputer, this.endPeriodLossesDate, this.endPeriodLossesEditor, this.endPeriodLossesLastEditDate, this.breedingUniqueId, this.licenceNumber, this.temporaryTrash, this.temporaryDeleted, this.firstDateInputArchive, this.secondDateInputArchive, this.inputArchiver, this.outputArchiveDate, this.outputArchiver, this.barDifferenceRequestWeight, this.barDifferenceRequestQuantity, this.healthCertificate, this.samasatDischargePercentage, this.personTypeName, this.interactTypeName, this.unionTypeName, this.certId, this.increaseQuantity, this.tenantFullname, this.tenantNationalCode, this.tenantMobile, this.tenantCity, this.hasTenant, this.createdBy, this.modifiedBy, this.poultry}): _breed = breed; + const _HatchingDetails({this.id, this.chainCompany, this.age, this.inspectionLosses, this.vetFarm, this.activeKill, this.killingInfo, this.freeGovernmentalInfo, this.key, this.createDate, this.modifyDate, this.trash, this.hasChainCompany, this.poultryIdForeignKey, this.poultryHatchingIdKey, this.quantity, this.losses, this.leftOver, this.killedQuantity, this.extraKilledQuantity, this.governmentalKilledQuantity, this.governmentalQuantity, this.freeKilledQuantity, this.freeQuantity, this.chainKilledQuantity, this.chainKilledWeight, this.outProvinceKilledWeight, this.outProvinceKilledQuantity, this.exportKilledWeight, this.exportKilledQuantity, this.totalCommitment, this.commitmentType, this.totalCommitmentQuantity, this.totalFreeCommitmentQuantity, this.totalFreeCommitmentWeight, this.totalKilledWeight, this.totalAverageKilledWeight, this.requestLeftOver, this.hall, this.date, this.predicateDate, this.chickenBreed, this.period, this.allowHatching, this.state, this.archive, this.violation, this.message, this.registrar, final List? breed, this.cityNumber, this.cityName, this.provinceNumber, this.provinceName, this.lastChange, this.chickenAge, this.nowAge, this.latestHatchingChange, this.violationReport, this.violationMessage, this.violationImage, this.violationReporter, this.violationReportDate, this.violationReportEditor, this.violationReportEditDate, this.totalLosses, this.directLosses, this.directLossesInputer, this.directLossesDate, this.directLossesEditor, this.directLossesLastEditDate, this.endPeriodLossesInputer, this.endPeriodLossesDate, this.endPeriodLossesEditor, this.endPeriodLossesLastEditDate, this.breedingUniqueId, this.licenceNumber, this.temporaryTrash, this.temporaryDeleted, this.firstDateInputArchive, this.secondDateInputArchive, this.inputArchiver, this.outputArchiveDate, this.outputArchiver, this.barDifferenceRequestWeight, this.barDifferenceRequestQuantity, this.healthCertificate, this.samasatDischargePercentage, this.personTypeName, this.interactTypeName, this.unionTypeName, this.certId, this.increaseQuantity, this.tenantFullname, this.tenantNationalCode, this.tenantMobile, this.tenantCity, this.hasTenant, this.createdBy, this.modifiedBy, this.poultry}): _breed = breed; factory _HatchingDetails.fromJson(Map json) => _$HatchingDetailsFromJson(json); -@override final int id; +@override final int? id; @override final String? chainCompany; @override final int? age; @override final dynamic inspectionLosses; @@ -527,7 +527,7 @@ abstract mixin class _$HatchingDetailsCopyWith<$Res> implements $HatchingDetails factory _$HatchingDetailsCopyWith(_HatchingDetails value, $Res Function(_HatchingDetails) _then) = __$HatchingDetailsCopyWithImpl; @override @useResult $Res call({ - int id, String? chainCompany, int? age, dynamic inspectionLosses, VetFarm? vetFarm, ActiveKill? activeKill, KillingInfo? killingInfo, FreeGovernmentalInfo? freeGovernmentalInfo, String? key, DateTime? createDate, DateTime? modifyDate, bool? trash, bool? hasChainCompany, dynamic poultryIdForeignKey, dynamic poultryHatchingIdKey, int? quantity, int? losses, int? leftOver, int? killedQuantity, int? extraKilledQuantity, double? governmentalKilledQuantity, double? governmentalQuantity, double? freeKilledQuantity, double? freeQuantity, double? chainKilledQuantity, double? chainKilledWeight, double? outProvinceKilledWeight, double? outProvinceKilledQuantity, double? exportKilledWeight, double? exportKilledQuantity, double? totalCommitment, String? commitmentType, double? totalCommitmentQuantity, double? totalFreeCommitmentQuantity, double? totalFreeCommitmentWeight, double? totalKilledWeight, double? totalAverageKilledWeight, int? requestLeftOver, int? hall, DateTime? date, DateTime? predicateDate, String? chickenBreed, int? period, String? allowHatching, String? state, bool? archive, bool? violation, dynamic message, dynamic registrar, List? breed, int? cityNumber, String? cityName, int? provinceNumber, String? provinceName, LastChange? lastChange, int? chickenAge, int? nowAge, LatestHatchingChange? latestHatchingChange, dynamic violationReport, String? violationMessage, dynamic violationImage, dynamic violationReporter, dynamic violationReportDate, dynamic violationReportEditor, dynamic violationReportEditDate, int? totalLosses, int? directLosses, dynamic directLossesInputer, dynamic directLossesDate, dynamic directLossesEditor, dynamic directLossesLastEditDate, dynamic endPeriodLossesInputer, dynamic endPeriodLossesDate, dynamic endPeriodLossesEditor, dynamic endPeriodLossesLastEditDate, String? breedingUniqueId, String? licenceNumber, bool? temporaryTrash, bool? temporaryDeleted, dynamic firstDateInputArchive, dynamic secondDateInputArchive, dynamic inputArchiver, dynamic outputArchiveDate, dynamic outputArchiver, double? barDifferenceRequestWeight, double? barDifferenceRequestQuantity, dynamic healthCertificate, int? samasatDischargePercentage, String? personTypeName, String? interactTypeName, String? unionTypeName, String? certId, int? increaseQuantity, dynamic tenantFullname, dynamic tenantNationalCode, dynamic tenantMobile, dynamic tenantCity, bool? hasTenant, dynamic createdBy, dynamic modifiedBy, int? poultry + int? id, String? chainCompany, int? age, dynamic inspectionLosses, VetFarm? vetFarm, ActiveKill? activeKill, KillingInfo? killingInfo, FreeGovernmentalInfo? freeGovernmentalInfo, String? key, DateTime? createDate, DateTime? modifyDate, bool? trash, bool? hasChainCompany, dynamic poultryIdForeignKey, dynamic poultryHatchingIdKey, int? quantity, int? losses, int? leftOver, int? killedQuantity, int? extraKilledQuantity, double? governmentalKilledQuantity, double? governmentalQuantity, double? freeKilledQuantity, double? freeQuantity, double? chainKilledQuantity, double? chainKilledWeight, double? outProvinceKilledWeight, double? outProvinceKilledQuantity, double? exportKilledWeight, double? exportKilledQuantity, double? totalCommitment, String? commitmentType, double? totalCommitmentQuantity, double? totalFreeCommitmentQuantity, double? totalFreeCommitmentWeight, double? totalKilledWeight, double? totalAverageKilledWeight, int? requestLeftOver, int? hall, DateTime? date, DateTime? predicateDate, String? chickenBreed, int? period, String? allowHatching, String? state, bool? archive, bool? violation, dynamic message, dynamic registrar, List? breed, int? cityNumber, String? cityName, int? provinceNumber, String? provinceName, LastChange? lastChange, int? chickenAge, int? nowAge, LatestHatchingChange? latestHatchingChange, dynamic violationReport, String? violationMessage, dynamic violationImage, dynamic violationReporter, dynamic violationReportDate, dynamic violationReportEditor, dynamic violationReportEditDate, int? totalLosses, int? directLosses, dynamic directLossesInputer, dynamic directLossesDate, dynamic directLossesEditor, dynamic directLossesLastEditDate, dynamic endPeriodLossesInputer, dynamic endPeriodLossesDate, dynamic endPeriodLossesEditor, dynamic endPeriodLossesLastEditDate, String? breedingUniqueId, String? licenceNumber, bool? temporaryTrash, bool? temporaryDeleted, dynamic firstDateInputArchive, dynamic secondDateInputArchive, dynamic inputArchiver, dynamic outputArchiveDate, dynamic outputArchiver, double? barDifferenceRequestWeight, double? barDifferenceRequestQuantity, dynamic healthCertificate, int? samasatDischargePercentage, String? personTypeName, String? interactTypeName, String? unionTypeName, String? certId, int? increaseQuantity, dynamic tenantFullname, dynamic tenantNationalCode, dynamic tenantMobile, dynamic tenantCity, bool? hasTenant, dynamic createdBy, dynamic modifiedBy, int? poultry }); @@ -544,10 +544,10 @@ class __$HatchingDetailsCopyWithImpl<$Res> /// Create a copy of HatchingDetails /// with the given fields replaced by the non-null parameter values. -@override @pragma('vm:prefer-inline') $Res call({Object? id = null,Object? chainCompany = freezed,Object? age = freezed,Object? inspectionLosses = freezed,Object? vetFarm = freezed,Object? activeKill = freezed,Object? killingInfo = freezed,Object? freeGovernmentalInfo = freezed,Object? key = freezed,Object? createDate = freezed,Object? modifyDate = freezed,Object? trash = freezed,Object? hasChainCompany = freezed,Object? poultryIdForeignKey = freezed,Object? poultryHatchingIdKey = freezed,Object? quantity = freezed,Object? losses = freezed,Object? leftOver = freezed,Object? killedQuantity = freezed,Object? extraKilledQuantity = freezed,Object? governmentalKilledQuantity = freezed,Object? governmentalQuantity = freezed,Object? freeKilledQuantity = freezed,Object? freeQuantity = freezed,Object? chainKilledQuantity = freezed,Object? chainKilledWeight = freezed,Object? outProvinceKilledWeight = freezed,Object? outProvinceKilledQuantity = freezed,Object? exportKilledWeight = freezed,Object? exportKilledQuantity = freezed,Object? totalCommitment = freezed,Object? commitmentType = freezed,Object? totalCommitmentQuantity = freezed,Object? totalFreeCommitmentQuantity = freezed,Object? totalFreeCommitmentWeight = freezed,Object? totalKilledWeight = freezed,Object? totalAverageKilledWeight = freezed,Object? requestLeftOver = freezed,Object? hall = freezed,Object? date = freezed,Object? predicateDate = freezed,Object? chickenBreed = freezed,Object? period = freezed,Object? allowHatching = freezed,Object? state = freezed,Object? archive = freezed,Object? violation = freezed,Object? message = freezed,Object? registrar = freezed,Object? breed = freezed,Object? cityNumber = freezed,Object? cityName = freezed,Object? provinceNumber = freezed,Object? provinceName = freezed,Object? lastChange = freezed,Object? chickenAge = freezed,Object? nowAge = freezed,Object? latestHatchingChange = freezed,Object? violationReport = freezed,Object? violationMessage = freezed,Object? violationImage = freezed,Object? violationReporter = freezed,Object? violationReportDate = freezed,Object? violationReportEditor = freezed,Object? violationReportEditDate = freezed,Object? totalLosses = freezed,Object? directLosses = freezed,Object? directLossesInputer = freezed,Object? directLossesDate = freezed,Object? directLossesEditor = freezed,Object? directLossesLastEditDate = freezed,Object? endPeriodLossesInputer = freezed,Object? endPeriodLossesDate = freezed,Object? endPeriodLossesEditor = freezed,Object? endPeriodLossesLastEditDate = freezed,Object? breedingUniqueId = freezed,Object? licenceNumber = freezed,Object? temporaryTrash = freezed,Object? temporaryDeleted = freezed,Object? firstDateInputArchive = freezed,Object? secondDateInputArchive = freezed,Object? inputArchiver = freezed,Object? outputArchiveDate = freezed,Object? outputArchiver = freezed,Object? barDifferenceRequestWeight = freezed,Object? barDifferenceRequestQuantity = freezed,Object? healthCertificate = freezed,Object? samasatDischargePercentage = freezed,Object? personTypeName = freezed,Object? interactTypeName = freezed,Object? unionTypeName = freezed,Object? certId = freezed,Object? increaseQuantity = freezed,Object? tenantFullname = freezed,Object? tenantNationalCode = freezed,Object? tenantMobile = freezed,Object? tenantCity = freezed,Object? hasTenant = freezed,Object? createdBy = freezed,Object? modifiedBy = freezed,Object? poultry = freezed,}) { +@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? chainCompany = freezed,Object? age = freezed,Object? inspectionLosses = freezed,Object? vetFarm = freezed,Object? activeKill = freezed,Object? killingInfo = freezed,Object? freeGovernmentalInfo = freezed,Object? key = freezed,Object? createDate = freezed,Object? modifyDate = freezed,Object? trash = freezed,Object? hasChainCompany = freezed,Object? poultryIdForeignKey = freezed,Object? poultryHatchingIdKey = freezed,Object? quantity = freezed,Object? losses = freezed,Object? leftOver = freezed,Object? killedQuantity = freezed,Object? extraKilledQuantity = freezed,Object? governmentalKilledQuantity = freezed,Object? governmentalQuantity = freezed,Object? freeKilledQuantity = freezed,Object? freeQuantity = freezed,Object? chainKilledQuantity = freezed,Object? chainKilledWeight = freezed,Object? outProvinceKilledWeight = freezed,Object? outProvinceKilledQuantity = freezed,Object? exportKilledWeight = freezed,Object? exportKilledQuantity = freezed,Object? totalCommitment = freezed,Object? commitmentType = freezed,Object? totalCommitmentQuantity = freezed,Object? totalFreeCommitmentQuantity = freezed,Object? totalFreeCommitmentWeight = freezed,Object? totalKilledWeight = freezed,Object? totalAverageKilledWeight = freezed,Object? requestLeftOver = freezed,Object? hall = freezed,Object? date = freezed,Object? predicateDate = freezed,Object? chickenBreed = freezed,Object? period = freezed,Object? allowHatching = freezed,Object? state = freezed,Object? archive = freezed,Object? violation = freezed,Object? message = freezed,Object? registrar = freezed,Object? breed = freezed,Object? cityNumber = freezed,Object? cityName = freezed,Object? provinceNumber = freezed,Object? provinceName = freezed,Object? lastChange = freezed,Object? chickenAge = freezed,Object? nowAge = freezed,Object? latestHatchingChange = freezed,Object? violationReport = freezed,Object? violationMessage = freezed,Object? violationImage = freezed,Object? violationReporter = freezed,Object? violationReportDate = freezed,Object? violationReportEditor = freezed,Object? violationReportEditDate = freezed,Object? totalLosses = freezed,Object? directLosses = freezed,Object? directLossesInputer = freezed,Object? directLossesDate = freezed,Object? directLossesEditor = freezed,Object? directLossesLastEditDate = freezed,Object? endPeriodLossesInputer = freezed,Object? endPeriodLossesDate = freezed,Object? endPeriodLossesEditor = freezed,Object? endPeriodLossesLastEditDate = freezed,Object? breedingUniqueId = freezed,Object? licenceNumber = freezed,Object? temporaryTrash = freezed,Object? temporaryDeleted = freezed,Object? firstDateInputArchive = freezed,Object? secondDateInputArchive = freezed,Object? inputArchiver = freezed,Object? outputArchiveDate = freezed,Object? outputArchiver = freezed,Object? barDifferenceRequestWeight = freezed,Object? barDifferenceRequestQuantity = freezed,Object? healthCertificate = freezed,Object? samasatDischargePercentage = freezed,Object? personTypeName = freezed,Object? interactTypeName = freezed,Object? unionTypeName = freezed,Object? certId = freezed,Object? increaseQuantity = freezed,Object? tenantFullname = freezed,Object? tenantNationalCode = freezed,Object? tenantMobile = freezed,Object? tenantCity = freezed,Object? hasTenant = freezed,Object? createdBy = freezed,Object? modifiedBy = freezed,Object? poultry = freezed,}) { return _then(_HatchingDetails( -id: null == id ? _self.id : id // ignore: cast_nullable_to_non_nullable -as int,chainCompany: freezed == chainCompany ? _self.chainCompany : chainCompany // ignore: cast_nullable_to_non_nullable +id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable +as int?,chainCompany: freezed == chainCompany ? _self.chainCompany : chainCompany // ignore: cast_nullable_to_non_nullable as String?,age: freezed == age ? _self.age : age // ignore: cast_nullable_to_non_nullable as int?,inspectionLosses: freezed == inspectionLosses ? _self.inspectionLosses : inspectionLosses // ignore: cast_nullable_to_non_nullable as dynamic,vetFarm: freezed == vetFarm ? _self.vetFarm : vetFarm // ignore: cast_nullable_to_non_nullable diff --git a/packages/inspection/lib/data/model/response/hatching_details/hatching_details.g.dart b/packages/inspection/lib/data/model/response/hatching_details/hatching_details.g.dart index 0c94208..2522641 100644 --- a/packages/inspection/lib/data/model/response/hatching_details/hatching_details.g.dart +++ b/packages/inspection/lib/data/model/response/hatching_details/hatching_details.g.dart @@ -9,7 +9,7 @@ part of 'hatching_details.dart'; _HatchingDetails _$HatchingDetailsFromJson( Map json, ) => _HatchingDetails( - id: (json['id'] as num).toInt(), + id: (json['id'] as num?)?.toInt(), chainCompany: json['chain_company'] as String?, age: (json['age'] as num?)?.toInt(), inspectionLosses: json['inspection_losses'], diff --git a/packages/inspection/lib/data/repositories/inspection/inspection_repository.dart b/packages/inspection/lib/data/repositories/inspection/inspection_repository.dart index 148ce5b..283b5ca 100644 --- a/packages/inspection/lib/data/repositories/inspection/inspection_repository.dart +++ b/packages/inspection/lib/data/repositories/inspection/inspection_repository.dart @@ -1,3 +1,4 @@ +import 'package:rasadyar_inspection/data/model/response/hatching_details/hatching_details.dart'; import 'package:rasadyar_inspection/data/model/response/poultry_location/poultry_location_model.dart'; abstract class InspectionRepository { @@ -21,4 +22,9 @@ abstract class InspectionRepository { double? centerLng, double? radius, }); + + Future?> getHatchingDetails({ + String? code, + bool? active, + }); } \ No newline at end of file diff --git a/packages/inspection/lib/data/repositories/inspection/inspection_repository_imp.dart b/packages/inspection/lib/data/repositories/inspection/inspection_repository_imp.dart index 67a8d92..5eecf18 100644 --- a/packages/inspection/lib/data/repositories/inspection/inspection_repository_imp.dart +++ b/packages/inspection/lib/data/repositories/inspection/inspection_repository_imp.dart @@ -1,4 +1,5 @@ import 'package:rasadyar_inspection/data/data_source/remote/inspection/inspection_remote.dart'; +import 'package:rasadyar_inspection/data/model/response/hatching_details/hatching_details.dart'; import 'package:rasadyar_inspection/data/model/response/poultry_location/poultry_location_model.dart'; import 'package:rasadyar_inspection/data/repositories/inspection/inspection_repository.dart'; @@ -33,4 +34,9 @@ class InspectionRepositoryImp implements InspectionRepository { value: value, ); } + + @override + Future?> getHatchingDetails({String? code, bool? active}) async { + return await remoteDataSource.getHatchingDetails(code: code, active: active ?? false); + } } diff --git a/packages/inspection/lib/presentation/pages/inspection_map/widget/map/logic.dart b/packages/inspection/lib/presentation/pages/inspection_map/widget/map/logic.dart index 7612628..1d217b4 100644 --- a/packages/inspection/lib/presentation/pages/inspection_map/widget/map/logic.dart +++ b/packages/inspection/lib/presentation/pages/inspection_map/widget/map/logic.dart @@ -3,7 +3,10 @@ import 'dart:math'; import 'package:flutter/material.dart'; import 'package:rasadyar_core/core.dart'; +import 'package:rasadyar_inspection/data/model/response/hatching_details/hatching_details.dart'; import 'package:rasadyar_inspection/data/model/response/poultry_location/poultry_location_model.dart'; +import 'package:rasadyar_inspection/data/repositories/inspection/inspection_repository_imp.dart'; +import 'package:rasadyar_inspection/injection/inspection_di.dart'; import 'package:rasadyar_inspection/presentation/widget/base_page/logic.dart'; class MapLogic extends GetxController with GetTickerProviderStateMixin { @@ -12,6 +15,7 @@ class MapLogic extends GetxController with GetTickerProviderStateMixin { RxDouble currentZoom = (15.0).obs; Rx mapController = MapController().obs; BaseLogic baseLogic = Get.find(); + InspectionRepositoryImp inspectionRepository = diInspection.get(); Rx currentLocation = LatLng(34.798315281272544, 48.51479142983491).obs; RxBool hasFilterOrSearch = false.obs; @@ -31,6 +35,9 @@ class MapLogic extends GetxController with GetTickerProviderStateMixin { Rx>> filteredLocations = Resource>.initial().obs; + Rx>> hatchingDetails = + Resource>.initial().obs; + @override void onInit() { super.onInit(); @@ -154,4 +161,29 @@ class MapLogic extends GetxController with GetTickerProviderStateMixin { point.longitude >= bounds.west && point.longitude <= bounds.east; } + + Future getFullDetailsLocation(PoultryLocationModel model) async { + hatchingDetails.value = Resource>.loading(); + await safeCall( + call: () => inspectionRepository.getHatchingDetails( + code: model.breedingUniqueId, + active: (model.hatching != null && model.hatching!.isNotEmpty), + ), + onSuccess: (result) { + if (result != null && result.isNotEmpty) { + hatchingDetails.value = Resource>.success(result); + } else { + hatchingDetails.value = Resource>.empty(); + } + }, + onError: (error, stackTrace) { + hatchingDetails.value = Resource>.error('$error / $stackTrace'); + }, + ); + } + + void cleanDataAfterBottomSheet() { + eLog('cleanDataAfterBottomSheet'); + hatchingDetails.value = Resource>.initial(); + } } diff --git a/packages/inspection/lib/presentation/pages/inspection_map/widget/map/view.dart b/packages/inspection/lib/presentation/pages/inspection_map/widget/map/view.dart index 84a5a73..1d057c0 100644 --- a/packages/inspection/lib/presentation/pages/inspection_map/widget/map/view.dart +++ b/packages/inspection/lib/presentation/pages/inspection_map/widget/map/view.dart @@ -1,5 +1,7 @@ +import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:rasadyar_core/core.dart'; +import 'package:rasadyar_inspection/data/model/response/hatching_details/hatching_details.dart'; import 'package:rasadyar_inspection/data/model/response/poultry_location/poultry_location_model.dart'; import 'logic.dart'; @@ -109,675 +111,457 @@ class MapPage extends GetView { final isVisible = controller.isInVisibleBounds(point, visibleBounds); if (isZoomedIn && isVisible) { - return Marker( - point: point, - width: 180.w, - height: 50.h, - child: GestureDetector( - onTap: () { - bool hasHatching = location.hatching != null && location.hatching!.isNotEmpty; - iLog(hasHatching); - Get.bottomSheet( - ObxValue((data) { - return BaseBottomSheet( - height: data.value - ? hasHatching - ? 550.h - : 400.h - : 150.h, - child: Column( - spacing: 12, - children: [ - ListItemWithOutCounter( - secondChild: Column( - spacing: 8, - children: [ - Padding( - padding: EdgeInsets.symmetric(horizontal: 12.w), - child: Column( - spacing: 8, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text( - location.unitName ?? 'N/A', - textAlign: TextAlign.center, - style: AppFonts.yekan16.copyWith( - color: AppColor.greenDark, - ), - ), - ], - ), - Container( - height: 32.h, - padding: EdgeInsets.symmetric(horizontal: 8), - decoration: ShapeDecoration( - color: AppColor.blueLight, - shape: RoundedRectangleBorder( - side: BorderSide( - width: 1.w, - color: AppColor.blueLightHover, - ), - borderRadius: BorderRadius.circular(8), - ), - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - spacing: 3, - children: [ - Text( - 'جوجه ریزی فعال', - style: AppFonts.yekan14.copyWith( - color: AppColor.textColor, - ), - ), - - Text( - hasHatching ? 'دارد' : 'ندارد', - style: AppFonts.yekan14.copyWith( - color: AppColor.blueNormal, - ), - ), - ], - ), - ), - buildRow( - title: 'مشخصات خریدار', - value: location.user?.fullname ?? 'N/A', - ), - - buildRow( - title: 'تلفن خریدار', - value: location.user?.mobile ?? 'N/A', - valueStyle: AppFonts.yekan14.copyWith( - color: AppColor.blueNormal, - ), - ), - - Visibility( - visible: location.address?.city?.name != null, - child: buildRow( - title: 'شهر', - value: location.address?.city?.name ?? 'N/A', - ), - ), - Visibility( - visible: location.address?.address != null, - child: buildRow( - title: 'آردس', - value: location.address?.address ?? 'N/A', - ), - ), - - buildRow( - title: 'شناسه یکتا', - value: location.breedingUniqueId ?? 'N/A', - ), - ], - ), - ), - Row( - children: [ - Expanded( - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - spacing: 7, - children: [ - RElevated( - width: 40.h, - height: 38.h, - backgroundColor: AppColor.greenNormal, - child: Assets.vec.messageAddSvg.svg( - width: 24.w, - height: 24.h, - colorFilter: ColorFilter.mode( - Colors.white, - BlendMode.srcIn, - ), - ), - onPressed: () {}, - ), - RElevated( - width: 150.w, - height: 40.h, - backgroundColor: AppColor.blueNormal, - onPressed: () { - /* controller.setEditData(item); - Get.bottomSheet( - addOrEditBottomSheet(true), - isScrollControlled: true, - backgroundColor: Colors.transparent, - ).whenComplete(() {});*/ - }, - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - spacing: 8, - children: [ - Assets.vec.mapSvg.svg( - width: 24.w, - height: 24.h, - colorFilter: ColorFilter.mode( - Colors.white, - BlendMode.srcIn, - ), - ), - Text( - 'جزییات کامل', - style: AppFonts.yekan14Bold.copyWith( - color: Colors.white, - ), - ), - ], - ), - ), - ROutlinedElevated( - width: 150.w, - height: 40.h, - onPressed: () { - buildDeleteDialog( - onConfirm: () async {}, - onRefresh: () async {}, - ); - }, - borderColor: AppColor.bgIcon, - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - spacing: 8, - children: [ - Assets.vec.securityTimeSvg.svg( - width: 24.w, - height: 24.h, - colorFilter: ColorFilter.mode( - AppColor.bgIcon, - BlendMode.srcIn, - ), - ), - Text( - 'سوابق بازرسی', - style: AppFonts.yekan14Bold.copyWith( - color: AppColor.bgIcon, - ), - ), - ], - ), - ), - ], - ), - ), - ], - ), - ], - ), - labelColor: AppColor.blueLight, - labelIcon: Assets.vec.cowSvg.path, - labelIconColor: AppColor.bgIcon, - onTap: () => data.value = !data.value, - selected: data.value, - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text( - location.unitName ?? 'N/A', - style: AppFonts.yekan10.copyWith(color: AppColor.blueNormal), - ), - Text( - location.user?.fullname ?? '', - style: AppFonts.yekan12.copyWith( - color: AppColor.darkGreyDarkHover, - ), - ), - ], - ), - Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text( - 'جوجه ریزی فعال', - style: AppFonts.yekan10.copyWith(color: AppColor.blueNormal), - ), - Text( - (location.hatching != null && location.hatching!.isNotEmpty) - ? 'دارد' - : 'ندراد', - style: AppFonts.yekan12.copyWith( - color: AppColor.darkGreyDarkHover, - ), - ), - ], - ), - Assets.vec.scanBarcodeSvg.svg(), - ], - ), - ), - - Visibility( - visible: hasHatching, - child: Container( - width: Get.width, - margin: const EdgeInsets.fromLTRB(0, 0, 10, 0), - padding: EdgeInsets.all(8.r), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(8), - border: Border.all(width: 1, color: AppColor.lightGreyNormalHover), - ), - child: Column( - spacing: 8.h, - children: [ - Container( - height: 32.h, - padding: EdgeInsets.symmetric(horizontal: 8), - decoration: ShapeDecoration( - color: AppColor.blueLight, - shape: RoundedRectangleBorder( - side: BorderSide(width: 1.w, color: AppColor.blueLightHover), - borderRadius: BorderRadius.circular(8), - ), - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - spacing: 3, - children: [ - Text( - 'تاریخ', - style: AppFonts.yekan14.copyWith(color: AppColor.textColor), - ), - - Text( - location.hatching?.first.date?.formattedJalaliDate ?? 'N/A', - style: AppFonts.yekan14.copyWith( - color: AppColor.blueNormal, - ), - ), - ], - ), - ), - buildRow( - title: 'باقیمانده', - value: - location.hatching?.first.leftOver.separatedByComma ?? 'N/A', - ), - buildRow( - title: 'سن جوجه ریزی', - value: '${location.hatching?.first.chickenAge ?? 'N/A'} روز', - ), - buildRow( - title: 'شماره مجوز جوجه ریزی', - value: location.hatching?.first.licenceNumber.toString() ?? 'N/A', - ), - ], - ), - ), - ), - ], - ), - ); - }, controller.isSelectedDetailsLocation), - isScrollControlled: true, - isDismissible: true, - ); - }, - child: Container( - height: 30.h, - padding: EdgeInsets.all(5.r), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(15.r), - boxShadow: [ - BoxShadow( - color: Colors.black.withValues(alpha: 0.1), - blurRadius: 5, - offset: const Offset(0, 2), - ), - ], - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - spacing: 8, - children: [ - Assets.vec.chickenMapMarkerSvg.svg(width: 24.w, height: 24.h), - Text(location.user?.fullname ?? '', style: AppFonts.yekan12), - ], - ), - ), - ), - ); + return buildMarkerWithHatching(point, location); } else { - return Marker( - point: point, - width: 40.h, - height: 50.h, - child: GestureDetector( - onTap: () { - bool hasHatching = location.hatching != null && location.hatching!.isNotEmpty; - Get.bottomSheet( - ObxValue((data) { - return BaseBottomSheet( - height: data.value - ? hasHatching - ? 550.h - : 400.h - : 150.h, - child: Column( - spacing: 12, - children: [ - ListItemWithOutCounter( - secondChild: Column( - spacing: 8, - children: [ - Padding( - padding: EdgeInsets.symmetric(horizontal: 12.w), - child: Column( - spacing: 8, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text( - location.unitName ?? 'N/A', - textAlign: TextAlign.center, - style: AppFonts.yekan16.copyWith( - color: AppColor.greenDark, - ), - ), - ], - ), - Container( - height: 32.h, - padding: EdgeInsets.symmetric(horizontal: 8), - decoration: ShapeDecoration( - color: AppColor.blueLight, - shape: RoundedRectangleBorder( - side: BorderSide( - width: 1.w, - color: AppColor.blueLightHover, - ), - borderRadius: BorderRadius.circular(8), - ), - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - spacing: 3, - children: [ - Text( - 'جوجه ریزی فعال', - style: AppFonts.yekan14.copyWith( - color: AppColor.textColor, - ), - ), - - Text( - hasHatching ? 'دارد' : 'ندارد', - style: AppFonts.yekan14.copyWith( - color: AppColor.blueNormal, - ), - ), - ], - ), - ), - buildRow( - title: 'مشخصات مرغدار', - value: location.user?.fullname ?? 'N/A', - ), - - buildRow( - title: 'تلفن مرغدار', - value: location.user?.mobile ?? 'N/A', - valueStyle: AppFonts.yekan14.copyWith( - color: AppColor.blueNormal, - ), - ), - - Visibility( - visible: location.address?.city?.name != null, - child: buildRow( - title: 'شهر', - value: location.address?.city?.name ?? 'N/A', - ), - ), - Visibility( - visible: location.address?.address != null, - child: buildRow( - title: 'آردس', - value: location.address?.address ?? 'N/A', - ), - ), - - buildRow( - title: 'شناسه یکتا', - value: location.breedingUniqueId ?? 'N/A', - ), - ], - ), - ), - Row( - children: [ - Expanded( - child: Row( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - spacing: 7, - children: [ - RElevated( - width: 40.h, - height: 38.h, - backgroundColor: AppColor.greenNormal, - child: Assets.vec.messageAddSvg.svg( - width: 24.w, - height: 24.h, - colorFilter: ColorFilter.mode( - Colors.white, - BlendMode.srcIn, - ), - ), - onPressed: () {}, - ), - RElevated( - width: 150.w, - height: 40.h, - backgroundColor: AppColor.blueNormal, - onPressed: () { - /* controller.setEditData(item); - Get.bottomSheet( - addOrEditBottomSheet(true), - isScrollControlled: true, - backgroundColor: Colors.transparent, - ).whenComplete(() {});*/ - }, - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - spacing: 8, - children: [ - Assets.vec.mapSvg.svg( - width: 24.w, - height: 24.h, - colorFilter: ColorFilter.mode( - Colors.white, - BlendMode.srcIn, - ), - ), - Text( - 'جزییات کامل', - style: AppFonts.yekan14Bold.copyWith( - color: Colors.white, - ), - ), - ], - ), - ), - ROutlinedElevated( - width: 150.w, - height: 40.h, - onPressed: () { - buildDeleteDialog( - onConfirm: () async {}, - onRefresh: () async {}, - ); - }, - borderColor: AppColor.bgIcon, - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - spacing: 8, - children: [ - Assets.vec.securityTimeSvg.svg( - width: 24.w, - height: 24.h, - colorFilter: ColorFilter.mode( - AppColor.bgIcon, - BlendMode.srcIn, - ), - ), - Text( - 'سوابق بازرسی', - style: AppFonts.yekan14Bold.copyWith( - color: AppColor.bgIcon, - ), - ), - ], - ), - ), - ], - ), - ), - ], - ), - ], - ), - labelColor: AppColor.blueLight, - labelIcon: Assets.vec.cowSvg.path, - labelIconColor: AppColor.bgIcon, - onTap: () => data.value = !data.value, - selected: data.value, - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text( - location.unitName ?? 'N/A', - style: AppFonts.yekan10.copyWith(color: AppColor.blueNormal), - ), - Text( - location.user?.fullname ?? '', - style: AppFonts.yekan12.copyWith( - color: AppColor.darkGreyDarkHover, - ), - ), - ], - ), - Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text( - 'جوجه ریزی فعال', - style: AppFonts.yekan10.copyWith(color: AppColor.blueNormal), - ), - Text( - (location.hatching != null && location.hatching!.isNotEmpty) - ? 'دارد' - : 'ندراد', - style: AppFonts.yekan12.copyWith( - color: AppColor.darkGreyDarkHover, - ), - ), - ], - ), - Assets.vec.scanBarcodeSvg.svg(), - ], - ), - ), - - if (hasHatching) ...{ - Container( - width: Get.width, - margin: const EdgeInsets.fromLTRB(0, 0, 10, 0), - padding: EdgeInsets.all(8.r), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(8), - border: Border.all(width: 1, color: AppColor.lightGreyNormalHover), - ), - child: Column( - spacing: 8.h, - children: [ - Container( - height: 32.h, - padding: EdgeInsets.symmetric(horizontal: 8), - decoration: ShapeDecoration( - color: AppColor.blueLight, - shape: RoundedRectangleBorder( - side: BorderSide(width: 1.w, color: AppColor.blueLightHover), - borderRadius: BorderRadius.circular(8), - ), - ), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - spacing: 3, - children: [ - Text( - 'تاریخ', - style: AppFonts.yekan14.copyWith(color: AppColor.textColor), - ), - - Text( - location.hatching?.first.date?.formattedJalaliDate ?? 'N/A', - style: AppFonts.yekan14.copyWith( - color: AppColor.blueNormal, - ), - ), - ], - ), - ), - buildRow( - title: 'باقیمانده', - value: - '${location.hatching?.first.leftOver.separatedByComma ?? 'N/A'} عدد', - ), - buildRow( - title: 'سن جوجه ریزی', - value: '${location.hatching?.first.chickenAge ?? 'N/A'} روز', - ), - buildRow( - title: 'شماره مجوز جوجه ریزی', - value: location.hatching?.first.licenceNumber.toString() ?? 'N/A', - ), - ], - ), - ), - }, - ], - ), - ); - }, controller.isSelectedDetailsLocation), - isScrollControlled: true, - isDismissible: true, - ); - }, - child: Assets.vec.chickenMapMarkerSvg.svg(width: 24.w, height: 24.h), - ), - ); + return buildMarkerWithOutHatching(point, location); } }).toList(); return updatedMarkers; } - Marker markerWidget({required LatLng marker, required VoidCallback onTap}) { + Marker buildMarkerWithHatching(LatLng point, PoultryLocationModel location) { return Marker( - point: marker, + point: point, + width: 180.w, + height: 50.h, child: GestureDetector( - onTap: onTap, - behavior: HitTestBehavior.opaque, - child: SizedBox( - width: 36, - height: 36, - child: Assets.vec.mapMarkerSvg.svg(width: 30, height: 30), + onTap: () { + bool hasHatching = location.hatching != null && location.hatching!.isNotEmpty; + Get.bottomSheet( + detailsBottomSheet(hasHatching, location), + isScrollControlled: true, + isDismissible: true, + ).then((_) => controller.cleanDataAfterBottomSheet()); + }, + child: Container( + height: 30.h, + padding: EdgeInsets.all(5.r), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(15.r), + boxShadow: [ + BoxShadow( + color: Colors.black.withValues(alpha: 0.1), + blurRadius: 5, + offset: const Offset(0, 2), + ), + ], + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + spacing: 8, + children: [ + Assets.vec.chickenMapMarkerSvg.svg(width: 24.w, height: 24.h), + Text(location.user?.fullname ?? '', style: AppFonts.yekan12), + ], + ), ), ), ); } + + Marker buildMarkerWithOutHatching(LatLng point, PoultryLocationModel location) { + return Marker( + point: point, + width: 40.h, + height: 50.h, + child: GestureDetector( + onTap: () { + bool hasHatching = location.hatching != null && location.hatching!.isNotEmpty; + Get.bottomSheet( + detailsBottomSheet(hasHatching, location), + isScrollControlled: true, + isDismissible: true, + ).then((_) => controller.cleanDataAfterBottomSheet()); + }, + child: Assets.vec.chickenMapMarkerSvg.svg(width: 24.w, height: 24.h), + ), + ); + } + + Widget detailsBottomSheet(bool hasHatching, PoultryLocationModel location) { + return ObxValue((data) { + return BaseBottomSheet( + height: data.value + ? hasHatching + ? 550.h + : 400.h + : 150.h, + child: Column( + spacing: 12, + children: [ + ListItemWithOutCounter( + secondChild: Column( + spacing: 8, + children: [ + Padding( + padding: EdgeInsets.symmetric(horizontal: 12.w), + child: Column( + spacing: 8, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + location.unitName ?? 'N/A', + textAlign: TextAlign.center, + style: AppFonts.yekan16.copyWith(color: AppColor.greenDark), + ), + ], + ), + Container( + height: 32.h, + padding: EdgeInsets.symmetric(horizontal: 8), + decoration: ShapeDecoration( + color: AppColor.blueLight, + shape: RoundedRectangleBorder( + side: BorderSide(width: 1.w, color: AppColor.blueLightHover), + borderRadius: BorderRadius.circular(8), + ), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + spacing: 3, + children: [ + Text( + 'جوجه ریزی فعال', + style: AppFonts.yekan14.copyWith(color: AppColor.textColor), + ), + + Text( + hasHatching ? 'دارد' : 'ندارد', + style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal), + ), + ], + ), + ), + buildRow(title: 'مشخصات مرغدار', value: location.user?.fullname ?? 'N/A'), + + buildRow( + title: 'تلفن مرغدار', + value: location.user?.mobile ?? 'N/A', + valueStyle: AppFonts.yekan14.copyWith(color: AppColor.blueNormal), + ), + + Visibility( + visible: location.address?.city?.name != null, + child: buildRow( + title: 'شهر', + value: location.address?.city?.name ?? 'N/A', + ), + ), + Visibility( + visible: location.address?.address != null, + child: buildRow(title: 'آردس', value: location.address?.address ?? 'N/A'), + ), + + buildRow(title: 'شناسه یکتا', value: location.breedingUniqueId ?? 'N/A'), + ], + ), + ), + Row( + children: [ + Expanded( + child: Row( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + spacing: 7, + children: [ + RElevated( + width: 40.h, + height: 38.h, + backgroundColor: AppColor.greenNormal, + child: Assets.vec.messageAddSvg.svg( + width: 24.w, + height: 24.h, + colorFilter: ColorFilter.mode(Colors.white, BlendMode.srcIn), + ), + onPressed: () {}, + ), + RElevated( + width: 150.w, + height: 40.h, + backgroundColor: AppColor.blueNormal, + onPressed: () { + if (controller.hatchingDetails.value.status != + ResourceStatus.success) { + controller.getFullDetailsLocation(location); + } + Get.bottomSheet( + fullDetailsBottomSheet(location), + isScrollControlled: true, + isDismissible: true, + ignoreSafeArea: false, + ); + }, + child: Row( + mainAxisAlignment: MainAxisAlignment.start, + spacing: 8, + children: [ + Assets.vec.mapSvg.svg( + width: 24.w, + height: 24.h, + colorFilter: ColorFilter.mode(Colors.white, BlendMode.srcIn), + ), + Text( + 'جزییات کامل', + style: AppFonts.yekan14Bold.copyWith(color: Colors.white), + ), + ], + ), + ), + ROutlinedElevated( + width: 150.w, + height: 40.h, + onPressed: () { + // buildDeleteDialog(onConfirm: () async {}, onRefresh: () async {}); + }, + borderColor: AppColor.bgIcon, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + spacing: 8, + children: [ + Assets.vec.securityTimeSvg.svg( + width: 24.w, + height: 24.h, + colorFilter: ColorFilter.mode(AppColor.bgIcon, BlendMode.srcIn), + ), + Text( + 'سوابق بازرسی', + style: AppFonts.yekan14Bold.copyWith(color: AppColor.bgIcon), + ), + ], + ), + ), + ], + ), + ), + ], + ), + ], + ), + labelColor: AppColor.blueLight, + labelIcon: Assets.vec.cowSvg.path, + labelIconColor: AppColor.bgIcon, + onTap: () => data.value = !data.value, + selected: data.value, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + location.unitName ?? 'N/A', + style: AppFonts.yekan10.copyWith(color: AppColor.blueNormal), + ), + Text( + location.user?.fullname ?? '', + style: AppFonts.yekan12.copyWith(color: AppColor.darkGreyDarkHover), + ), + ], + ), + Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + 'جوجه ریزی فعال', + style: AppFonts.yekan10.copyWith(color: AppColor.blueNormal), + ), + Text( + (location.hatching != null && location.hatching!.isNotEmpty) + ? 'دارد' + : 'ندراد', + style: AppFonts.yekan12.copyWith(color: AppColor.darkGreyDarkHover), + ), + ], + ), + Assets.vec.scanBarcodeSvg.svg(), + ], + ), + ), + + if (hasHatching) ...{hatchingWidget(location)}, + ], + ), + ); + }, controller.isSelectedDetailsLocation); + } + + Container hatchingWidget(PoultryLocationModel location) { + return Container( + width: Get.width, + margin: const EdgeInsets.fromLTRB(0, 0, 10, 0), + padding: EdgeInsets.all(8.r), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(8), + border: Border.all(width: 1, color: AppColor.lightGreyNormalHover), + ), + child: Column( + spacing: 8.h, + children: [ + Container( + height: 32.h, + padding: EdgeInsets.symmetric(horizontal: 8), + decoration: ShapeDecoration( + color: AppColor.blueLight, + shape: RoundedRectangleBorder( + side: BorderSide(width: 1.w, color: AppColor.blueLightHover), + borderRadius: BorderRadius.circular(8), + ), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + spacing: 3, + children: [ + Text('تاریخ', style: AppFonts.yekan14.copyWith(color: AppColor.textColor)), + + Text( + location.hatching?.first.date?.formattedJalaliDate ?? 'N/A', + style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal), + ), + ], + ), + ), + buildRow( + title: 'باقیمانده', + value: '${location.hatching?.first.leftOver.separatedByComma ?? 'N/A'} عدد', + ), + buildRow( + title: 'سن جوجه ریزی', + value: '${location.hatching?.first.chickenAge ?? 'N/A'} روز', + ), + buildRow( + title: 'شماره مجوز جوجه ریزی', + value: location.hatching?.first.licenceNumber.toString() ?? 'N/A', + ), + ], + ), + ); + } + + Widget fullDetailsBottomSheet(PoultryLocationModel location) { + return BaseBottomSheet( + height: 550.h, + child: ObxValue((state) { + switch (state.value.status) { + case ResourceStatus.initial: + case ResourceStatus.loading: + return Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [CupertinoActivityIndicator(), Text('در حال دریافت اطلاعات ...')], + ); + + case ResourceStatus.success: + return widgetFullDetailsBottomSheet(); + case ResourceStatus.error: + return ErrorWidget(state.value.message ?? 'خطا در دریافت اطلاعات'); + case ResourceStatus.empty: + return EmptyWidget(); + } + }, controller.hatchingDetails), + ); + } + + Container widgetFullDetailsBottomSheet() => Container( + padding: EdgeInsets.all(8.r), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8.r), + border: Border.all(width: 1.w, color: AppColor.lightGreyNormalHover), + ), + child: ObxValue((data) { + final HatchingDetails? hatchingDetails = data.value.data?.first; + return Column( + spacing: 6.h, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + height: 32.h, + padding: EdgeInsets.symmetric(horizontal: 8), + decoration: ShapeDecoration( + color: AppColor.blueLight, + shape: RoundedRectangleBorder( + side: BorderSide(width: 1.w, color: AppColor.blueLightHover), + borderRadius: BorderRadius.circular(8), + ), + ), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + spacing: 3, + children: [ + Text( + 'تاریخ جوجه ریزی', + style: AppFonts.yekan14.copyWith(color: AppColor.textColor), + ), + + Text( + hatchingDetails?.date.toString().formattedJalaliDate ?? 'N/A', + style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal), + ), + ], + ), + ), + + buildRow( + title: 'مشخصات مرغدار', + value: hatchingDetails?.vetFarm?.vetFarmFullName ?? 'N/A', + ), + + buildRow( + title: 'تلفن مرغدار', + value: hatchingDetails?.vetFarm?.vetFarmMobile ?? 'N/A', + valueStyle: AppFonts.yekan14.copyWith(color: AppColor.blueNormal), + ), + buildRow( + title: 'جوجه ریزی فعال', + value: (hatchingDetails?.archive ?? false) ? 'ندارد' : 'دارد', + ), + buildRow(title: 'دوره', value: hatchingDetails?.period.toString() ?? 'N/A'), + + buildRow( + title: 'تعداد جوجه ریزی', + value: hatchingDetails?.quantity.separatedByComma.addCountEXT ?? 'N/A', + ), + + buildRow( + title: 'تلفات کل', + value: hatchingDetails?.totalLosses.separatedByComma.addCountEXT ?? 'N/A', + ), + buildRow( + title: 'تلفات دامپزشکی', + value: hatchingDetails?.losses.separatedByComma.addCountEXT ?? 'N/A', + ), + + buildRow( + title: 'باقیمانده در سالن', + value: hatchingDetails?.leftOver.separatedByComma.addCountEXT ?? 'N/A', + ), + + buildRow(title: 'نژاد', value: hatchingDetails?.chickenBreed ?? 'N/A'), + + buildRow(title: 'شماره مجوز جوجه ریزی', value: hatchingDetails?.licenceNumber ?? 'N/A'), + + buildRow( + title: 'سن جوجه', + value: ((hatchingDetails?.archive ?? false) == true) + ? hatchingDetails?.nowAge.toString().addDayEXT ?? 'N/A' + : hatchingDetails?.chickenAge.toString().addDayEXT ?? 'N/A', + ), + + buildRow( + title: 'تعداد کشتار', + value: hatchingDetails?.killedQuantity.separatedByComma.addCountEXT ?? 'N/A', + ), + + buildRow( + title: 'وزن کشتار', + value: hatchingDetails?.totalKilledWeight.separatedByComma.addKgEXT ?? 'N/A', + ), + ], + ); + }, controller.hatchingDetails), + ); } diff --git a/tools/vecGeneratoe.sh b/tools/vecGeneratoe.sh index 0240a5d..0e52b5d 100644 --- a/tools/vecGeneratoe.sh +++ b/tools/vecGeneratoe.sh @@ -65,6 +65,7 @@ find "$targetPath" -type f -name "*.vec" -exec rm {} \; # Generate .vec files in parallel echo "⚙️ Generating .vec files in parallel..." +# shellcheck disable=SC2016 find "$sourcePath" -type f | xargs -P 10 -I {} bash -c ' input="{}" filename=$(basename "$input")