feat : inspection
This commit is contained in:
@@ -1,8 +1,28 @@
|
||||
import 'package:rasadyar_chicken/data/models/response/hatching/hatching_models.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/hatching_report/hatching_report.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/poultry_science/home_poultry_science/home_poultry_science_model.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
abstract class PoultryScienceRemoteDatasource {
|
||||
Future<HomePoultryScienceModel?> getHomePoultryScience({
|
||||
required String token,
|
||||
required String type,
|
||||
});
|
||||
|
||||
Future<PaginationModel<HatchingModel>?> getHatchingPoultry({
|
||||
required String token,
|
||||
Map<String, dynamic>? queryParameters,
|
||||
});
|
||||
|
||||
Future<void> submitPoultryScienceReport({
|
||||
required String token,
|
||||
required IFormData data,
|
||||
ProgressCallback? onSendProgress,
|
||||
});
|
||||
|
||||
|
||||
Future<PaginationModel<HatchingReport>?> getPoultryScienceReport({
|
||||
required String token,
|
||||
Map<String, dynamic>? queryParameters,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import 'package:rasadyar_chicken/data/models/response/hatching/hatching_models.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/hatching_report/hatching_report.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/poultry_science/home_poultry_science/home_poultry_science_model.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
@@ -14,7 +16,7 @@ class PoultryScienceRemoteDatasourceImp implements PoultryScienceRemoteDatasourc
|
||||
required String type,
|
||||
}) async {
|
||||
var res = await _httpClient.get(
|
||||
'poultry_and_hatching_for_poultry_science/',
|
||||
'/poultry_and_hatching_for_poultry_science/',
|
||||
queryParameters: {'type': type},
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
fromJson: (json) => HomePoultryScienceModel.fromJson(json),
|
||||
@@ -22,4 +24,52 @@ class PoultryScienceRemoteDatasourceImp implements PoultryScienceRemoteDatasourc
|
||||
|
||||
return res.data;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<PaginationModel<HatchingModel>?> getHatchingPoultry({
|
||||
required String token,
|
||||
Map<String, dynamic>? queryParameters,
|
||||
}) async {
|
||||
var res = await _httpClient.get(
|
||||
'/poultry_and_hatching_for_poultry_science/',
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
queryParameters: queryParameters,
|
||||
fromJson: (json) => PaginationModel<HatchingModel>.fromJson(
|
||||
json,
|
||||
(json) => HatchingModel.fromJson(json as Map<String, dynamic>),
|
||||
),
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> submitPoultryScienceReport({
|
||||
required String token,
|
||||
required IFormData data,
|
||||
ProgressCallback? onSendProgress,
|
||||
}) async {
|
||||
await _httpClient.upload(
|
||||
'/poultry_science_report/',
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
formData: data,
|
||||
onSendProgress: onSendProgress,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<PaginationModel<HatchingReport>?> getPoultryScienceReport({
|
||||
required String token,
|
||||
Map<String, dynamic>? queryParameters,
|
||||
}) async {
|
||||
var res = await _httpClient.get(
|
||||
'/poultry_science_report/',
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
queryParameters: queryParameters,
|
||||
fromJson: (json) => PaginationModel<HatchingReport>.fromJson(
|
||||
json,
|
||||
(json) => HatchingReport.fromJson(json as Map<String, dynamic>),
|
||||
),
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,421 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'hatching_models.freezed.dart';
|
||||
part 'hatching_models.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class HatchingModel with _$HatchingModel{
|
||||
const factory HatchingModel({
|
||||
int? id,
|
||||
Poultry? poultry,
|
||||
ChainCompany? chainCompany,
|
||||
num? age,
|
||||
dynamic inspectionLosses,
|
||||
VetFarm? vetFarm,
|
||||
ActiveKill? activeKill,
|
||||
KillingInfo? killingInfo,
|
||||
FreeGovernmentalInfo? freeGovernmentalInfo,
|
||||
ReportInfo? reportInfo,
|
||||
String? key,
|
||||
String? createDate,
|
||||
String? modifyDate,
|
||||
bool? trash,
|
||||
bool? hasChainCompany,
|
||||
int? poultryIdForeignKey,
|
||||
int? poultryHatchingIdKey,
|
||||
num? quantity,
|
||||
num? losses,
|
||||
num? leftOver,
|
||||
num? killedQuantity,
|
||||
num? extraKilledQuantity,
|
||||
num? governmentalKilledQuantity,
|
||||
num? governmentalQuantity,
|
||||
num? freeKilledQuantity,
|
||||
num? freeQuantity,
|
||||
num? chainKilledQuantity,
|
||||
num? chainKilledWeight,
|
||||
num? outProvinceKilledWeight,
|
||||
num? outProvinceKilledQuantity,
|
||||
num? exportKilledWeight,
|
||||
num? exportKilledQuantity,
|
||||
num? totalCommitment,
|
||||
String? commitmentType,
|
||||
num? totalCommitmentQuantity,
|
||||
num? totalFreeCommitmentQuantity,
|
||||
num? totalFreeCommitmentWeight,
|
||||
num? totalKilledWeight,
|
||||
num? totalAverageKilledWeight,
|
||||
num? requestLeftOver,
|
||||
num? hall,
|
||||
String? date,
|
||||
String? predicateDate,
|
||||
String? chickenBreed,
|
||||
num? period,
|
||||
String? allowHatching,
|
||||
String? state,
|
||||
bool? archive,
|
||||
bool? violation,
|
||||
String? message,
|
||||
Registrar? registrar,
|
||||
List<BreedItem>? breed,
|
||||
num? cityNumber,
|
||||
String? cityName,
|
||||
num? provinceNumber,
|
||||
String? provinceName,
|
||||
LastChange? lastChange,
|
||||
num? chickenAge,
|
||||
num? nowAge,
|
||||
LatestHatchingChange? latestHatchingChange,
|
||||
String? violationReport,
|
||||
String? violationMessage,
|
||||
List<String>? violationImage,
|
||||
String? violationReporter,
|
||||
String? violationReportDate,
|
||||
String? violationReportEditor,
|
||||
String? violationReportEditDate,
|
||||
num? totalLosses,
|
||||
num? directLosses,
|
||||
String? directLossesInputer,
|
||||
String? directLossesDate,
|
||||
String? directLossesEditor,
|
||||
String? directLossesLastEditDate,
|
||||
String? endPeriodLossesInputer,
|
||||
String? endPeriodLossesDate,
|
||||
String? endPeriodLossesEditor,
|
||||
String? endPeriodLossesLastEditDate,
|
||||
String? breedingUniqueId,
|
||||
String? licenceNumber,
|
||||
bool? temporaryTrash,
|
||||
bool? temporaryDeleted,
|
||||
String? firstDateInputArchive,
|
||||
String? secondDateInputArchive,
|
||||
String? inputArchiver,
|
||||
String? outputArchiveDate,
|
||||
String? outputArchiver,
|
||||
num? barDifferenceRequestWeight,
|
||||
num? barDifferenceRequestQuantity,
|
||||
String? healthCertificate,
|
||||
num? samasatDischargePercentage,
|
||||
String? personTypeName,
|
||||
String? interactTypeName,
|
||||
String? unionTypeName,
|
||||
String? certId,
|
||||
num? increaseQuantity,
|
||||
String? tenantFullname,
|
||||
String? tenantNationalCode,
|
||||
String? tenantMobile,
|
||||
String? tenantCity,
|
||||
bool? hasTenant,
|
||||
String? archiveDate,
|
||||
String? createdBy,
|
||||
String? modifiedBy,
|
||||
}) = _HatchingModel;
|
||||
|
||||
factory HatchingModel.fromJson(Map<String, dynamic> json) => _$HatchingModelFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class Poultry with _$Poultry {
|
||||
const factory Poultry({
|
||||
int? id,
|
||||
PoultryUser? user,
|
||||
PoultryAddress? address,
|
||||
String? key,
|
||||
bool? trash,
|
||||
int? ownerIdForeignKey,
|
||||
int? userIdForeignKey,
|
||||
int? addressIdForeignKey,
|
||||
bool? hasChainCompany,
|
||||
int? userBankIdForeignKey,
|
||||
String? cityOperator,
|
||||
String? unitName,
|
||||
String? gisCode,
|
||||
num? operatingLicenceCapacity,
|
||||
num? numberOfHalls,
|
||||
bool? tenant,
|
||||
bool? hasTenant,
|
||||
String? personType,
|
||||
String? economicCode,
|
||||
String? systemCode,
|
||||
String? epidemiologicalCode,
|
||||
String? breedingUniqueId,
|
||||
num? totalCapacity,
|
||||
String? licenceNumber,
|
||||
String? healthCertificateNumber,
|
||||
num? numberOfRequests,
|
||||
String? hatchingDate,
|
||||
String? lastPartyDate,
|
||||
num? numberOfIncubators,
|
||||
num? herdAgeByDay,
|
||||
num? herdAgeByWeek,
|
||||
num? numberOfParty,
|
||||
String? communicationType,
|
||||
String? cooperative,
|
||||
String? dateOfRegister,
|
||||
String? unitStatus,
|
||||
bool? active,
|
||||
dynamic identityDocuments,
|
||||
String? samasatUserCode,
|
||||
String? baseOrder,
|
||||
String? incubationDate,
|
||||
num? walletAmount,
|
||||
num? city,
|
||||
num? cityNumber,
|
||||
String? cityName,
|
||||
num? provinceNumber,
|
||||
String? provinceName,
|
||||
int? walletIdForeignKey,
|
||||
int? poultryIdKey,
|
||||
num? lat,
|
||||
num? long,
|
||||
String? date,
|
||||
num? killingAveAge,
|
||||
num? activeLeftOver,
|
||||
num? killingAveCount,
|
||||
num? killingAveWeight,
|
||||
num? killingLiveWeight,
|
||||
num? killingCarcassesWeight,
|
||||
num? killingLossWeightPercent,
|
||||
num? realKillingAveWeight,
|
||||
num? realKillingLiveWeight,
|
||||
num? realKillingCarcassesWeight,
|
||||
num? realKillingLossWeightPercent,
|
||||
int? interestLicenseId,
|
||||
bool? orderLimit,
|
||||
int? owner,
|
||||
int? userBankInfo,
|
||||
int? wallet,
|
||||
}) = _Poultry;
|
||||
|
||||
factory Poultry.fromJson(Map<String, dynamic> json) => _$PoultryFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class PoultryUser with _$PoultryUser {
|
||||
const factory PoultryUser({
|
||||
String? fullname,
|
||||
String? mobile,
|
||||
}) = _PoultryUser;
|
||||
|
||||
factory PoultryUser.fromJson(Map<String, dynamic> json) => _$PoultryUserFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class PoultryAddress with _$PoultryAddress {
|
||||
const factory PoultryAddress({
|
||||
ProvinceRef? province,
|
||||
CityRef? city,
|
||||
String? address,
|
||||
String? postalCode,
|
||||
}) = _PoultryAddress;
|
||||
|
||||
factory PoultryAddress.fromJson(Map<String, dynamic> json) => _$PoultryAddressFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class ProvinceRef with _$ProvinceRef {
|
||||
const factory ProvinceRef({
|
||||
String? key,
|
||||
String? name,
|
||||
}) = _ProvinceRef;
|
||||
|
||||
factory ProvinceRef.fromJson(Map<String, dynamic> json) => _$ProvinceRefFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class CityRef with _$CityRef {
|
||||
const factory CityRef({
|
||||
String? key,
|
||||
String? name,
|
||||
}) = _CityRef;
|
||||
|
||||
factory CityRef.fromJson(Map<String, dynamic> json) => _$CityRefFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class ChainCompany with _$ChainCompany {
|
||||
const factory ChainCompany({
|
||||
ChainUser? user,
|
||||
dynamic userBankInfo,
|
||||
String? key,
|
||||
bool? trash,
|
||||
String? name,
|
||||
String? city,
|
||||
String? province,
|
||||
String? postalCode,
|
||||
String? address,
|
||||
num? wallet,
|
||||
}) = _ChainCompany;
|
||||
|
||||
factory ChainCompany.fromJson(Map<String, dynamic> json) => _$ChainCompanyFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class ChainUser with _$ChainUser {
|
||||
const factory ChainUser({
|
||||
List<String>? role,
|
||||
String? city,
|
||||
String? province,
|
||||
String? key,
|
||||
String? userGateWayId,
|
||||
int? userDjangoIdForeignKey,
|
||||
int? provinceIdForeignKey,
|
||||
int? cityIdForeignKey,
|
||||
int? systemUserProfileIdKey,
|
||||
String? fullname,
|
||||
String? firstName,
|
||||
String? lastName,
|
||||
String? nationalCode,
|
||||
String? nationalCodeImage,
|
||||
String? nationalId,
|
||||
String? mobile,
|
||||
String? birthday,
|
||||
String? image,
|
||||
String? password,
|
||||
bool? active,
|
||||
ChainUserState? state,
|
||||
num? baseOrder,
|
||||
num? cityNumber,
|
||||
String? cityName,
|
||||
num? provinceNumber,
|
||||
String? provinceName,
|
||||
String? unitName,
|
||||
String? unitNationalId,
|
||||
String? unitRegistrationNumber,
|
||||
String? unitEconomicalNumber,
|
||||
String? unitProvince,
|
||||
String? unitCity,
|
||||
String? unitPostalCode,
|
||||
String? unitAddress,
|
||||
}) = _ChainUser;
|
||||
|
||||
factory ChainUser.fromJson(Map<String, dynamic> json) => _$ChainUserFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class ChainUserState with _$ChainUserState {
|
||||
const factory ChainUserState({
|
||||
String? city,
|
||||
String? image,
|
||||
String? mobile,
|
||||
String? birthday,
|
||||
String? province,
|
||||
String? lastName,
|
||||
String? firstName,
|
||||
String? nationalId,
|
||||
String? nationalCode,
|
||||
}) = _ChainUserState;
|
||||
|
||||
factory ChainUserState.fromJson(Map<String, dynamic> json) => _$ChainUserStateFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class VetFarm with _$VetFarm {
|
||||
const factory VetFarm({
|
||||
String? vetFarmFullName,
|
||||
String? vetFarmMobile,
|
||||
}) = _VetFarm;
|
||||
|
||||
factory VetFarm.fromJson(Map<String, dynamic> json) => _$VetFarmFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class ActiveKill with _$ActiveKill {
|
||||
const factory ActiveKill({
|
||||
bool? activeKill,
|
||||
num? countOfRequest,
|
||||
}) = _ActiveKill;
|
||||
|
||||
factory ActiveKill.fromJson(Map<String, dynamic> json) => _$ActiveKillFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class KillingInfo with _$KillingInfo {
|
||||
const factory KillingInfo({
|
||||
String? violationMessage,
|
||||
num? provinceKillRequests,
|
||||
num? provinceKillRequestsQuantity,
|
||||
num? provinceKillRequestsWeight,
|
||||
num? killHouseRequests,
|
||||
num? killHouseRequestsFirstQuantity,
|
||||
num? killHouseRequestsFirstWeight,
|
||||
num? barCompleteWithKillHouse,
|
||||
num? acceptedRealQuantityFinal,
|
||||
num? acceptedRealWightFinal,
|
||||
num? wareHouseBars,
|
||||
num? wareHouseBarsQuantity,
|
||||
num? wareHouseBarsWeight,
|
||||
num? wareHouseBarsWeightLose,
|
||||
}) = _KillingInfo;
|
||||
|
||||
factory KillingInfo.fromJson(Map<String, dynamic> json) => _$KillingInfoFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class FreeGovernmentalInfo with _$FreeGovernmentalInfo {
|
||||
const factory FreeGovernmentalInfo({
|
||||
num? governmentalAllocatedQuantity,
|
||||
num? totalCommitmentQuantity,
|
||||
num? freeAllocatedQuantity,
|
||||
num? totalFreeCommitmentQuantity,
|
||||
num? leftTotalFreeCommitmentQuantity,
|
||||
}) = _FreeGovernmentalInfo;
|
||||
|
||||
factory FreeGovernmentalInfo.fromJson(Map<String, dynamic> json) => _$FreeGovernmentalInfoFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class ReportInfo with _$ReportInfo {
|
||||
const factory ReportInfo({
|
||||
bool? poultryScience,
|
||||
bool? image,
|
||||
}) = _ReportInfo;
|
||||
|
||||
factory ReportInfo.fromJson(Map<String, dynamic> json) => _$ReportInfoFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class LatestHatchingChange with _$LatestHatchingChange {
|
||||
const factory LatestHatchingChange({
|
||||
String? date,
|
||||
String? role,
|
||||
String? fullName,
|
||||
}) = _LatestHatchingChange;
|
||||
|
||||
factory LatestHatchingChange.fromJson(Map<String, dynamic> json) => _$LatestHatchingChangeFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class Registrar with _$Registrar {
|
||||
const factory Registrar({
|
||||
String? date,
|
||||
String? role,
|
||||
String? fullname,
|
||||
}) = _Registrar;
|
||||
|
||||
factory Registrar.fromJson(Map<String, dynamic> json) => _$RegistrarFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class LastChange with _$LastChange {
|
||||
const factory LastChange({
|
||||
String? date,
|
||||
String? role,
|
||||
String? type,
|
||||
String? fullName,
|
||||
}) = _LastChange;
|
||||
|
||||
factory LastChange.fromJson(Map<String, dynamic> json) => _$LastChangeFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class BreedItem with _$BreedItem {
|
||||
const factory BreedItem({
|
||||
String? breed,
|
||||
num? mainQuantity,
|
||||
num? remainQuantity,
|
||||
}) = _BreedItem;
|
||||
|
||||
factory BreedItem.fromJson(Map<String, dynamic> json) => _$BreedItemFromJson(json);
|
||||
}
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,723 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'hatching_models.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_HatchingModel _$HatchingModelFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _HatchingModel(
|
||||
id: (json['id'] as num?)?.toInt(),
|
||||
poultry: json['poultry'] == null
|
||||
? null
|
||||
: Poultry.fromJson(json['poultry'] as Map<String, dynamic>),
|
||||
chainCompany: json['chain_company'] == null
|
||||
? null
|
||||
: ChainCompany.fromJson(json['chain_company'] as Map<String, dynamic>),
|
||||
age: json['age'] as num?,
|
||||
inspectionLosses: json['inspection_losses'],
|
||||
vetFarm: json['vet_farm'] == null
|
||||
? null
|
||||
: VetFarm.fromJson(json['vet_farm'] as Map<String, dynamic>),
|
||||
activeKill: json['active_kill'] == null
|
||||
? null
|
||||
: ActiveKill.fromJson(json['active_kill'] as Map<String, dynamic>),
|
||||
killingInfo: json['killing_info'] == null
|
||||
? null
|
||||
: KillingInfo.fromJson(json['killing_info'] as Map<String, dynamic>),
|
||||
freeGovernmentalInfo: json['free_governmental_info'] == null
|
||||
? null
|
||||
: FreeGovernmentalInfo.fromJson(
|
||||
json['free_governmental_info'] as Map<String, dynamic>,
|
||||
),
|
||||
reportInfo: json['report_info'] == null
|
||||
? null
|
||||
: ReportInfo.fromJson(json['report_info'] as Map<String, dynamic>),
|
||||
key: json['key'] as String?,
|
||||
createDate: json['create_date'] as String?,
|
||||
modifyDate: json['modify_date'] as String?,
|
||||
trash: json['trash'] as bool?,
|
||||
hasChainCompany: json['has_chain_company'] as bool?,
|
||||
poultryIdForeignKey: (json['poultry_id_foreign_key'] as num?)?.toInt(),
|
||||
poultryHatchingIdKey: (json['poultry_hatching_id_key'] as num?)?.toInt(),
|
||||
quantity: json['quantity'] as num?,
|
||||
losses: json['losses'] as num?,
|
||||
leftOver: json['left_over'] as num?,
|
||||
killedQuantity: json['killed_quantity'] as num?,
|
||||
extraKilledQuantity: json['extra_killed_quantity'] as num?,
|
||||
governmentalKilledQuantity: json['governmental_killed_quantity'] as num?,
|
||||
governmentalQuantity: json['governmental_quantity'] as num?,
|
||||
freeKilledQuantity: json['free_killed_quantity'] as num?,
|
||||
freeQuantity: json['free_quantity'] as num?,
|
||||
chainKilledQuantity: json['chain_killed_quantity'] as num?,
|
||||
chainKilledWeight: json['chain_killed_weight'] as num?,
|
||||
outProvinceKilledWeight: json['out_province_killed_weight'] as num?,
|
||||
outProvinceKilledQuantity: json['out_province_killed_quantity'] as num?,
|
||||
exportKilledWeight: json['export_killed_weight'] as num?,
|
||||
exportKilledQuantity: json['export_killed_quantity'] as num?,
|
||||
totalCommitment: json['total_commitment'] as num?,
|
||||
commitmentType: json['commitment_type'] as String?,
|
||||
totalCommitmentQuantity: json['total_commitment_quantity'] as num?,
|
||||
totalFreeCommitmentQuantity: json['total_free_commitment_quantity'] as num?,
|
||||
totalFreeCommitmentWeight: json['total_free_commitment_weight'] as num?,
|
||||
totalKilledWeight: json['total_killed_weight'] as num?,
|
||||
totalAverageKilledWeight: json['total_average_killed_weight'] as num?,
|
||||
requestLeftOver: json['request_left_over'] as num?,
|
||||
hall: json['hall'] as num?,
|
||||
date: json['date'] as String?,
|
||||
predicateDate: json['predicate_date'] as String?,
|
||||
chickenBreed: json['chicken_breed'] as String?,
|
||||
period: json['period'] as num?,
|
||||
allowHatching: json['allow_hatching'] as String?,
|
||||
state: json['state'] as String?,
|
||||
archive: json['archive'] as bool?,
|
||||
violation: json['violation'] as bool?,
|
||||
message: json['message'] as String?,
|
||||
registrar: json['registrar'] == null
|
||||
? null
|
||||
: Registrar.fromJson(json['registrar'] as Map<String, dynamic>),
|
||||
breed: (json['breed'] as List<dynamic>?)
|
||||
?.map((e) => BreedItem.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
cityNumber: json['city_number'] as num?,
|
||||
cityName: json['city_name'] as String?,
|
||||
provinceNumber: json['province_number'] as num?,
|
||||
provinceName: json['province_name'] as String?,
|
||||
lastChange: json['last_change'] == null
|
||||
? null
|
||||
: LastChange.fromJson(json['last_change'] as Map<String, dynamic>),
|
||||
chickenAge: json['chicken_age'] as num?,
|
||||
nowAge: json['now_age'] as num?,
|
||||
latestHatchingChange: json['latest_hatching_change'] == null
|
||||
? null
|
||||
: LatestHatchingChange.fromJson(
|
||||
json['latest_hatching_change'] as Map<String, dynamic>,
|
||||
),
|
||||
violationReport: json['violation_report'] as String?,
|
||||
violationMessage: json['violation_message'] as String?,
|
||||
violationImage: (json['violation_image'] as List<dynamic>?)
|
||||
?.map((e) => e as String)
|
||||
.toList(),
|
||||
violationReporter: json['violation_reporter'] as String?,
|
||||
violationReportDate: json['violation_report_date'] as String?,
|
||||
violationReportEditor: json['violation_report_editor'] as String?,
|
||||
violationReportEditDate: json['violation_report_edit_date'] as String?,
|
||||
totalLosses: json['total_losses'] as num?,
|
||||
directLosses: json['direct_losses'] as num?,
|
||||
directLossesInputer: json['direct_losses_inputer'] as String?,
|
||||
directLossesDate: json['direct_losses_date'] as String?,
|
||||
directLossesEditor: json['direct_losses_editor'] as String?,
|
||||
directLossesLastEditDate: json['direct_losses_last_edit_date'] as String?,
|
||||
endPeriodLossesInputer: json['end_period_losses_inputer'] as String?,
|
||||
endPeriodLossesDate: json['end_period_losses_date'] as String?,
|
||||
endPeriodLossesEditor: json['end_period_losses_editor'] as String?,
|
||||
endPeriodLossesLastEditDate:
|
||||
json['end_period_losses_last_edit_date'] as String?,
|
||||
breedingUniqueId: json['breeding_unique_id'] as String?,
|
||||
licenceNumber: json['licence_number'] as String?,
|
||||
temporaryTrash: json['temporary_trash'] as bool?,
|
||||
temporaryDeleted: json['temporary_deleted'] as bool?,
|
||||
firstDateInputArchive: json['first_date_input_archive'] as String?,
|
||||
secondDateInputArchive: json['second_date_input_archive'] as String?,
|
||||
inputArchiver: json['input_archiver'] as String?,
|
||||
outputArchiveDate: json['output_archive_date'] as String?,
|
||||
outputArchiver: json['output_archiver'] as String?,
|
||||
barDifferenceRequestWeight: json['bar_difference_request_weight'] as num?,
|
||||
barDifferenceRequestQuantity: json['bar_difference_request_quantity'] as num?,
|
||||
healthCertificate: json['health_certificate'] as String?,
|
||||
samasatDischargePercentage: json['samasat_discharge_percentage'] as num?,
|
||||
personTypeName: json['person_type_name'] as String?,
|
||||
interactTypeName: json['interact_type_name'] as String?,
|
||||
unionTypeName: json['union_type_name'] as String?,
|
||||
certId: json['cert_id'] as String?,
|
||||
increaseQuantity: json['increase_quantity'] as num?,
|
||||
tenantFullname: json['tenant_fullname'] as String?,
|
||||
tenantNationalCode: json['tenant_national_code'] as String?,
|
||||
tenantMobile: json['tenant_mobile'] as String?,
|
||||
tenantCity: json['tenant_city'] as String?,
|
||||
hasTenant: json['has_tenant'] as bool?,
|
||||
archiveDate: json['archive_date'] as String?,
|
||||
createdBy: json['created_by'] as String?,
|
||||
modifiedBy: json['modified_by'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$HatchingModelToJson(_HatchingModel instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'poultry': instance.poultry,
|
||||
'chain_company': instance.chainCompany,
|
||||
'age': instance.age,
|
||||
'inspection_losses': instance.inspectionLosses,
|
||||
'vet_farm': instance.vetFarm,
|
||||
'active_kill': instance.activeKill,
|
||||
'killing_info': instance.killingInfo,
|
||||
'free_governmental_info': instance.freeGovernmentalInfo,
|
||||
'report_info': instance.reportInfo,
|
||||
'key': instance.key,
|
||||
'create_date': instance.createDate,
|
||||
'modify_date': instance.modifyDate,
|
||||
'trash': instance.trash,
|
||||
'has_chain_company': instance.hasChainCompany,
|
||||
'poultry_id_foreign_key': instance.poultryIdForeignKey,
|
||||
'poultry_hatching_id_key': instance.poultryHatchingIdKey,
|
||||
'quantity': instance.quantity,
|
||||
'losses': instance.losses,
|
||||
'left_over': instance.leftOver,
|
||||
'killed_quantity': instance.killedQuantity,
|
||||
'extra_killed_quantity': instance.extraKilledQuantity,
|
||||
'governmental_killed_quantity': instance.governmentalKilledQuantity,
|
||||
'governmental_quantity': instance.governmentalQuantity,
|
||||
'free_killed_quantity': instance.freeKilledQuantity,
|
||||
'free_quantity': instance.freeQuantity,
|
||||
'chain_killed_quantity': instance.chainKilledQuantity,
|
||||
'chain_killed_weight': instance.chainKilledWeight,
|
||||
'out_province_killed_weight': instance.outProvinceKilledWeight,
|
||||
'out_province_killed_quantity': instance.outProvinceKilledQuantity,
|
||||
'export_killed_weight': instance.exportKilledWeight,
|
||||
'export_killed_quantity': instance.exportKilledQuantity,
|
||||
'total_commitment': instance.totalCommitment,
|
||||
'commitment_type': instance.commitmentType,
|
||||
'total_commitment_quantity': instance.totalCommitmentQuantity,
|
||||
'total_free_commitment_quantity': instance.totalFreeCommitmentQuantity,
|
||||
'total_free_commitment_weight': instance.totalFreeCommitmentWeight,
|
||||
'total_killed_weight': instance.totalKilledWeight,
|
||||
'total_average_killed_weight': instance.totalAverageKilledWeight,
|
||||
'request_left_over': instance.requestLeftOver,
|
||||
'hall': instance.hall,
|
||||
'date': instance.date,
|
||||
'predicate_date': instance.predicateDate,
|
||||
'chicken_breed': instance.chickenBreed,
|
||||
'period': instance.period,
|
||||
'allow_hatching': instance.allowHatching,
|
||||
'state': instance.state,
|
||||
'archive': instance.archive,
|
||||
'violation': instance.violation,
|
||||
'message': instance.message,
|
||||
'registrar': instance.registrar,
|
||||
'breed': instance.breed,
|
||||
'city_number': instance.cityNumber,
|
||||
'city_name': instance.cityName,
|
||||
'province_number': instance.provinceNumber,
|
||||
'province_name': instance.provinceName,
|
||||
'last_change': instance.lastChange,
|
||||
'chicken_age': instance.chickenAge,
|
||||
'now_age': instance.nowAge,
|
||||
'latest_hatching_change': instance.latestHatchingChange,
|
||||
'violation_report': instance.violationReport,
|
||||
'violation_message': instance.violationMessage,
|
||||
'violation_image': instance.violationImage,
|
||||
'violation_reporter': instance.violationReporter,
|
||||
'violation_report_date': instance.violationReportDate,
|
||||
'violation_report_editor': instance.violationReportEditor,
|
||||
'violation_report_edit_date': instance.violationReportEditDate,
|
||||
'total_losses': instance.totalLosses,
|
||||
'direct_losses': instance.directLosses,
|
||||
'direct_losses_inputer': instance.directLossesInputer,
|
||||
'direct_losses_date': instance.directLossesDate,
|
||||
'direct_losses_editor': instance.directLossesEditor,
|
||||
'direct_losses_last_edit_date': instance.directLossesLastEditDate,
|
||||
'end_period_losses_inputer': instance.endPeriodLossesInputer,
|
||||
'end_period_losses_date': instance.endPeriodLossesDate,
|
||||
'end_period_losses_editor': instance.endPeriodLossesEditor,
|
||||
'end_period_losses_last_edit_date': instance.endPeriodLossesLastEditDate,
|
||||
'breeding_unique_id': instance.breedingUniqueId,
|
||||
'licence_number': instance.licenceNumber,
|
||||
'temporary_trash': instance.temporaryTrash,
|
||||
'temporary_deleted': instance.temporaryDeleted,
|
||||
'first_date_input_archive': instance.firstDateInputArchive,
|
||||
'second_date_input_archive': instance.secondDateInputArchive,
|
||||
'input_archiver': instance.inputArchiver,
|
||||
'output_archive_date': instance.outputArchiveDate,
|
||||
'output_archiver': instance.outputArchiver,
|
||||
'bar_difference_request_weight': instance.barDifferenceRequestWeight,
|
||||
'bar_difference_request_quantity': instance.barDifferenceRequestQuantity,
|
||||
'health_certificate': instance.healthCertificate,
|
||||
'samasat_discharge_percentage': instance.samasatDischargePercentage,
|
||||
'person_type_name': instance.personTypeName,
|
||||
'interact_type_name': instance.interactTypeName,
|
||||
'union_type_name': instance.unionTypeName,
|
||||
'cert_id': instance.certId,
|
||||
'increase_quantity': instance.increaseQuantity,
|
||||
'tenant_fullname': instance.tenantFullname,
|
||||
'tenant_national_code': instance.tenantNationalCode,
|
||||
'tenant_mobile': instance.tenantMobile,
|
||||
'tenant_city': instance.tenantCity,
|
||||
'has_tenant': instance.hasTenant,
|
||||
'archive_date': instance.archiveDate,
|
||||
'created_by': instance.createdBy,
|
||||
'modified_by': instance.modifiedBy,
|
||||
};
|
||||
|
||||
_Poultry _$PoultryFromJson(Map<String, dynamic> json) => _Poultry(
|
||||
id: (json['id'] as num?)?.toInt(),
|
||||
user: json['user'] == null
|
||||
? null
|
||||
: PoultryUser.fromJson(json['user'] as Map<String, dynamic>),
|
||||
address: json['address'] == null
|
||||
? null
|
||||
: PoultryAddress.fromJson(json['address'] as Map<String, dynamic>),
|
||||
key: json['key'] as String?,
|
||||
trash: json['trash'] as bool?,
|
||||
ownerIdForeignKey: (json['owner_id_foreign_key'] as num?)?.toInt(),
|
||||
userIdForeignKey: (json['user_id_foreign_key'] as num?)?.toInt(),
|
||||
addressIdForeignKey: (json['address_id_foreign_key'] as num?)?.toInt(),
|
||||
hasChainCompany: json['has_chain_company'] as bool?,
|
||||
userBankIdForeignKey: (json['user_bank_id_foreign_key'] as num?)?.toInt(),
|
||||
cityOperator: json['city_operator'] as String?,
|
||||
unitName: json['unit_name'] as String?,
|
||||
gisCode: json['gis_code'] as String?,
|
||||
operatingLicenceCapacity: json['operating_licence_capacity'] as num?,
|
||||
numberOfHalls: json['number_of_halls'] as num?,
|
||||
tenant: json['tenant'] as bool?,
|
||||
hasTenant: json['has_tenant'] as bool?,
|
||||
personType: json['person_type'] as String?,
|
||||
economicCode: json['economic_code'] as String?,
|
||||
systemCode: json['system_code'] as String?,
|
||||
epidemiologicalCode: json['epidemiological_code'] as String?,
|
||||
breedingUniqueId: json['breeding_unique_id'] as String?,
|
||||
totalCapacity: json['total_capacity'] as num?,
|
||||
licenceNumber: json['licence_number'] as String?,
|
||||
healthCertificateNumber: json['health_certificate_number'] as String?,
|
||||
numberOfRequests: json['number_of_requests'] as num?,
|
||||
hatchingDate: json['hatching_date'] as String?,
|
||||
lastPartyDate: json['last_party_date'] as String?,
|
||||
numberOfIncubators: json['number_of_incubators'] as num?,
|
||||
herdAgeByDay: json['herd_age_by_day'] as num?,
|
||||
herdAgeByWeek: json['herd_age_by_week'] as num?,
|
||||
numberOfParty: json['number_of_party'] as num?,
|
||||
communicationType: json['communication_type'] as String?,
|
||||
cooperative: json['cooperative'] as String?,
|
||||
dateOfRegister: json['date_of_register'] as String?,
|
||||
unitStatus: json['unit_status'] as String?,
|
||||
active: json['active'] as bool?,
|
||||
identityDocuments: json['identity_documents'],
|
||||
samasatUserCode: json['samasat_user_code'] as String?,
|
||||
baseOrder: json['base_order'] as String?,
|
||||
incubationDate: json['incubation_date'] as String?,
|
||||
walletAmount: json['wallet_amount'] as num?,
|
||||
city: json['city'] as num?,
|
||||
cityNumber: json['city_number'] as num?,
|
||||
cityName: json['city_name'] as String?,
|
||||
provinceNumber: json['province_number'] as num?,
|
||||
provinceName: json['province_name'] as String?,
|
||||
walletIdForeignKey: (json['wallet_id_foreign_key'] as num?)?.toInt(),
|
||||
poultryIdKey: (json['poultry_id_key'] as num?)?.toInt(),
|
||||
lat: json['lat'] as num?,
|
||||
long: json['long'] as num?,
|
||||
date: json['date'] as String?,
|
||||
killingAveAge: json['killing_ave_age'] as num?,
|
||||
activeLeftOver: json['active_left_over'] as num?,
|
||||
killingAveCount: json['killing_ave_count'] as num?,
|
||||
killingAveWeight: json['killing_ave_weight'] as num?,
|
||||
killingLiveWeight: json['killing_live_weight'] as num?,
|
||||
killingCarcassesWeight: json['killing_carcasses_weight'] as num?,
|
||||
killingLossWeightPercent: json['killing_loss_weight_percent'] as num?,
|
||||
realKillingAveWeight: json['real_killing_ave_weight'] as num?,
|
||||
realKillingLiveWeight: json['real_killing_live_weight'] as num?,
|
||||
realKillingCarcassesWeight: json['real_killing_carcasses_weight'] as num?,
|
||||
realKillingLossWeightPercent:
|
||||
json['real_killing_loss_weight_percent'] as num?,
|
||||
interestLicenseId: (json['interest_license_id'] as num?)?.toInt(),
|
||||
orderLimit: json['order_limit'] as bool?,
|
||||
owner: (json['owner'] as num?)?.toInt(),
|
||||
userBankInfo: (json['user_bank_info'] as num?)?.toInt(),
|
||||
wallet: (json['wallet'] as num?)?.toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$PoultryToJson(_Poultry instance) => <String, dynamic>{
|
||||
'id': instance.id,
|
||||
'user': instance.user,
|
||||
'address': instance.address,
|
||||
'key': instance.key,
|
||||
'trash': instance.trash,
|
||||
'owner_id_foreign_key': instance.ownerIdForeignKey,
|
||||
'user_id_foreign_key': instance.userIdForeignKey,
|
||||
'address_id_foreign_key': instance.addressIdForeignKey,
|
||||
'has_chain_company': instance.hasChainCompany,
|
||||
'user_bank_id_foreign_key': instance.userBankIdForeignKey,
|
||||
'city_operator': instance.cityOperator,
|
||||
'unit_name': instance.unitName,
|
||||
'gis_code': instance.gisCode,
|
||||
'operating_licence_capacity': instance.operatingLicenceCapacity,
|
||||
'number_of_halls': instance.numberOfHalls,
|
||||
'tenant': instance.tenant,
|
||||
'has_tenant': instance.hasTenant,
|
||||
'person_type': instance.personType,
|
||||
'economic_code': instance.economicCode,
|
||||
'system_code': instance.systemCode,
|
||||
'epidemiological_code': instance.epidemiologicalCode,
|
||||
'breeding_unique_id': instance.breedingUniqueId,
|
||||
'total_capacity': instance.totalCapacity,
|
||||
'licence_number': instance.licenceNumber,
|
||||
'health_certificate_number': instance.healthCertificateNumber,
|
||||
'number_of_requests': instance.numberOfRequests,
|
||||
'hatching_date': instance.hatchingDate,
|
||||
'last_party_date': instance.lastPartyDate,
|
||||
'number_of_incubators': instance.numberOfIncubators,
|
||||
'herd_age_by_day': instance.herdAgeByDay,
|
||||
'herd_age_by_week': instance.herdAgeByWeek,
|
||||
'number_of_party': instance.numberOfParty,
|
||||
'communication_type': instance.communicationType,
|
||||
'cooperative': instance.cooperative,
|
||||
'date_of_register': instance.dateOfRegister,
|
||||
'unit_status': instance.unitStatus,
|
||||
'active': instance.active,
|
||||
'identity_documents': instance.identityDocuments,
|
||||
'samasat_user_code': instance.samasatUserCode,
|
||||
'base_order': instance.baseOrder,
|
||||
'incubation_date': instance.incubationDate,
|
||||
'wallet_amount': instance.walletAmount,
|
||||
'city': instance.city,
|
||||
'city_number': instance.cityNumber,
|
||||
'city_name': instance.cityName,
|
||||
'province_number': instance.provinceNumber,
|
||||
'province_name': instance.provinceName,
|
||||
'wallet_id_foreign_key': instance.walletIdForeignKey,
|
||||
'poultry_id_key': instance.poultryIdKey,
|
||||
'lat': instance.lat,
|
||||
'long': instance.long,
|
||||
'date': instance.date,
|
||||
'killing_ave_age': instance.killingAveAge,
|
||||
'active_left_over': instance.activeLeftOver,
|
||||
'killing_ave_count': instance.killingAveCount,
|
||||
'killing_ave_weight': instance.killingAveWeight,
|
||||
'killing_live_weight': instance.killingLiveWeight,
|
||||
'killing_carcasses_weight': instance.killingCarcassesWeight,
|
||||
'killing_loss_weight_percent': instance.killingLossWeightPercent,
|
||||
'real_killing_ave_weight': instance.realKillingAveWeight,
|
||||
'real_killing_live_weight': instance.realKillingLiveWeight,
|
||||
'real_killing_carcasses_weight': instance.realKillingCarcassesWeight,
|
||||
'real_killing_loss_weight_percent': instance.realKillingLossWeightPercent,
|
||||
'interest_license_id': instance.interestLicenseId,
|
||||
'order_limit': instance.orderLimit,
|
||||
'owner': instance.owner,
|
||||
'user_bank_info': instance.userBankInfo,
|
||||
'wallet': instance.wallet,
|
||||
};
|
||||
|
||||
_PoultryUser _$PoultryUserFromJson(Map<String, dynamic> json) => _PoultryUser(
|
||||
fullname: json['fullname'] as String?,
|
||||
mobile: json['mobile'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$PoultryUserToJson(_PoultryUser instance) =>
|
||||
<String, dynamic>{'fullname': instance.fullname, 'mobile': instance.mobile};
|
||||
|
||||
_PoultryAddress _$PoultryAddressFromJson(Map<String, dynamic> json) =>
|
||||
_PoultryAddress(
|
||||
province: json['province'] == null
|
||||
? null
|
||||
: ProvinceRef.fromJson(json['province'] as Map<String, dynamic>),
|
||||
city: json['city'] == null
|
||||
? null
|
||||
: CityRef.fromJson(json['city'] as Map<String, dynamic>),
|
||||
address: json['address'] as String?,
|
||||
postalCode: json['postal_code'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$PoultryAddressToJson(_PoultryAddress instance) =>
|
||||
<String, dynamic>{
|
||||
'province': instance.province,
|
||||
'city': instance.city,
|
||||
'address': instance.address,
|
||||
'postal_code': instance.postalCode,
|
||||
};
|
||||
|
||||
_ProvinceRef _$ProvinceRefFromJson(Map<String, dynamic> json) =>
|
||||
_ProvinceRef(key: json['key'] as String?, name: json['name'] as String?);
|
||||
|
||||
Map<String, dynamic> _$ProvinceRefToJson(_ProvinceRef instance) =>
|
||||
<String, dynamic>{'key': instance.key, 'name': instance.name};
|
||||
|
||||
_CityRef _$CityRefFromJson(Map<String, dynamic> json) =>
|
||||
_CityRef(key: json['key'] as String?, name: json['name'] as String?);
|
||||
|
||||
Map<String, dynamic> _$CityRefToJson(_CityRef instance) => <String, dynamic>{
|
||||
'key': instance.key,
|
||||
'name': instance.name,
|
||||
};
|
||||
|
||||
_ChainCompany _$ChainCompanyFromJson(Map<String, dynamic> json) =>
|
||||
_ChainCompany(
|
||||
user: json['user'] == null
|
||||
? null
|
||||
: ChainUser.fromJson(json['user'] as Map<String, dynamic>),
|
||||
userBankInfo: json['user_bank_info'],
|
||||
key: json['key'] as String?,
|
||||
trash: json['trash'] as bool?,
|
||||
name: json['name'] as String?,
|
||||
city: json['city'] as String?,
|
||||
province: json['province'] as String?,
|
||||
postalCode: json['postal_code'] as String?,
|
||||
address: json['address'] as String?,
|
||||
wallet: json['wallet'] as num?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ChainCompanyToJson(_ChainCompany instance) =>
|
||||
<String, dynamic>{
|
||||
'user': instance.user,
|
||||
'user_bank_info': instance.userBankInfo,
|
||||
'key': instance.key,
|
||||
'trash': instance.trash,
|
||||
'name': instance.name,
|
||||
'city': instance.city,
|
||||
'province': instance.province,
|
||||
'postal_code': instance.postalCode,
|
||||
'address': instance.address,
|
||||
'wallet': instance.wallet,
|
||||
};
|
||||
|
||||
_ChainUser _$ChainUserFromJson(Map<String, dynamic> json) => _ChainUser(
|
||||
role: (json['role'] as List<dynamic>?)?.map((e) => e as String).toList(),
|
||||
city: json['city'] as String?,
|
||||
province: json['province'] as String?,
|
||||
key: json['key'] as String?,
|
||||
userGateWayId: json['user_gate_way_id'] as String?,
|
||||
userDjangoIdForeignKey: (json['user_django_id_foreign_key'] as num?)?.toInt(),
|
||||
provinceIdForeignKey: (json['province_id_foreign_key'] as num?)?.toInt(),
|
||||
cityIdForeignKey: (json['city_id_foreign_key'] as num?)?.toInt(),
|
||||
systemUserProfileIdKey: (json['system_user_profile_id_key'] as num?)?.toInt(),
|
||||
fullname: json['fullname'] as String?,
|
||||
firstName: json['first_name'] as String?,
|
||||
lastName: json['last_name'] as String?,
|
||||
nationalCode: json['national_code'] as String?,
|
||||
nationalCodeImage: json['national_code_image'] as String?,
|
||||
nationalId: json['national_id'] as String?,
|
||||
mobile: json['mobile'] as String?,
|
||||
birthday: json['birthday'] as String?,
|
||||
image: json['image'] as String?,
|
||||
password: json['password'] as String?,
|
||||
active: json['active'] as bool?,
|
||||
state: json['state'] == null
|
||||
? null
|
||||
: ChainUserState.fromJson(json['state'] as Map<String, dynamic>),
|
||||
baseOrder: json['base_order'] as num?,
|
||||
cityNumber: json['city_number'] as num?,
|
||||
cityName: json['city_name'] as String?,
|
||||
provinceNumber: json['province_number'] as num?,
|
||||
provinceName: json['province_name'] as String?,
|
||||
unitName: json['unit_name'] as String?,
|
||||
unitNationalId: json['unit_national_id'] as String?,
|
||||
unitRegistrationNumber: json['unit_registration_number'] as String?,
|
||||
unitEconomicalNumber: json['unit_economical_number'] as String?,
|
||||
unitProvince: json['unit_province'] as String?,
|
||||
unitCity: json['unit_city'] as String?,
|
||||
unitPostalCode: json['unit_postal_code'] as String?,
|
||||
unitAddress: json['unit_address'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ChainUserToJson(_ChainUser instance) =>
|
||||
<String, dynamic>{
|
||||
'role': instance.role,
|
||||
'city': instance.city,
|
||||
'province': instance.province,
|
||||
'key': instance.key,
|
||||
'user_gate_way_id': instance.userGateWayId,
|
||||
'user_django_id_foreign_key': instance.userDjangoIdForeignKey,
|
||||
'province_id_foreign_key': instance.provinceIdForeignKey,
|
||||
'city_id_foreign_key': instance.cityIdForeignKey,
|
||||
'system_user_profile_id_key': instance.systemUserProfileIdKey,
|
||||
'fullname': instance.fullname,
|
||||
'first_name': instance.firstName,
|
||||
'last_name': instance.lastName,
|
||||
'national_code': instance.nationalCode,
|
||||
'national_code_image': instance.nationalCodeImage,
|
||||
'national_id': instance.nationalId,
|
||||
'mobile': instance.mobile,
|
||||
'birthday': instance.birthday,
|
||||
'image': instance.image,
|
||||
'password': instance.password,
|
||||
'active': instance.active,
|
||||
'state': instance.state,
|
||||
'base_order': instance.baseOrder,
|
||||
'city_number': instance.cityNumber,
|
||||
'city_name': instance.cityName,
|
||||
'province_number': instance.provinceNumber,
|
||||
'province_name': instance.provinceName,
|
||||
'unit_name': instance.unitName,
|
||||
'unit_national_id': instance.unitNationalId,
|
||||
'unit_registration_number': instance.unitRegistrationNumber,
|
||||
'unit_economical_number': instance.unitEconomicalNumber,
|
||||
'unit_province': instance.unitProvince,
|
||||
'unit_city': instance.unitCity,
|
||||
'unit_postal_code': instance.unitPostalCode,
|
||||
'unit_address': instance.unitAddress,
|
||||
};
|
||||
|
||||
_ChainUserState _$ChainUserStateFromJson(Map<String, dynamic> json) =>
|
||||
_ChainUserState(
|
||||
city: json['city'] as String?,
|
||||
image: json['image'] as String?,
|
||||
mobile: json['mobile'] as String?,
|
||||
birthday: json['birthday'] as String?,
|
||||
province: json['province'] as String?,
|
||||
lastName: json['last_name'] as String?,
|
||||
firstName: json['first_name'] as String?,
|
||||
nationalId: json['national_id'] as String?,
|
||||
nationalCode: json['national_code'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ChainUserStateToJson(_ChainUserState instance) =>
|
||||
<String, dynamic>{
|
||||
'city': instance.city,
|
||||
'image': instance.image,
|
||||
'mobile': instance.mobile,
|
||||
'birthday': instance.birthday,
|
||||
'province': instance.province,
|
||||
'last_name': instance.lastName,
|
||||
'first_name': instance.firstName,
|
||||
'national_id': instance.nationalId,
|
||||
'national_code': instance.nationalCode,
|
||||
};
|
||||
|
||||
_VetFarm _$VetFarmFromJson(Map<String, dynamic> json) => _VetFarm(
|
||||
vetFarmFullName: json['vet_farm_full_name'] as String?,
|
||||
vetFarmMobile: json['vet_farm_mobile'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$VetFarmToJson(_VetFarm instance) => <String, dynamic>{
|
||||
'vet_farm_full_name': instance.vetFarmFullName,
|
||||
'vet_farm_mobile': instance.vetFarmMobile,
|
||||
};
|
||||
|
||||
_ActiveKill _$ActiveKillFromJson(Map<String, dynamic> json) => _ActiveKill(
|
||||
activeKill: json['active_kill'] as bool?,
|
||||
countOfRequest: json['count_of_request'] as num?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ActiveKillToJson(_ActiveKill instance) =>
|
||||
<String, dynamic>{
|
||||
'active_kill': instance.activeKill,
|
||||
'count_of_request': instance.countOfRequest,
|
||||
};
|
||||
|
||||
_KillingInfo _$KillingInfoFromJson(Map<String, dynamic> json) => _KillingInfo(
|
||||
violationMessage: json['violation_message'] as String?,
|
||||
provinceKillRequests: json['province_kill_requests'] as num?,
|
||||
provinceKillRequestsQuantity: json['province_kill_requests_quantity'] as num?,
|
||||
provinceKillRequestsWeight: json['province_kill_requests_weight'] as num?,
|
||||
killHouseRequests: json['kill_house_requests'] as num?,
|
||||
killHouseRequestsFirstQuantity:
|
||||
json['kill_house_requests_first_quantity'] as num?,
|
||||
killHouseRequestsFirstWeight:
|
||||
json['kill_house_requests_first_weight'] as num?,
|
||||
barCompleteWithKillHouse: json['bar_complete_with_kill_house'] as num?,
|
||||
acceptedRealQuantityFinal: json['accepted_real_quantity_final'] as num?,
|
||||
acceptedRealWightFinal: json['accepted_real_wight_final'] as num?,
|
||||
wareHouseBars: json['ware_house_bars'] as num?,
|
||||
wareHouseBarsQuantity: json['ware_house_bars_quantity'] as num?,
|
||||
wareHouseBarsWeight: json['ware_house_bars_weight'] as num?,
|
||||
wareHouseBarsWeightLose: json['ware_house_bars_weight_lose'] as num?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$KillingInfoToJson(
|
||||
_KillingInfo instance,
|
||||
) => <String, dynamic>{
|
||||
'violation_message': instance.violationMessage,
|
||||
'province_kill_requests': instance.provinceKillRequests,
|
||||
'province_kill_requests_quantity': instance.provinceKillRequestsQuantity,
|
||||
'province_kill_requests_weight': instance.provinceKillRequestsWeight,
|
||||
'kill_house_requests': instance.killHouseRequests,
|
||||
'kill_house_requests_first_quantity': instance.killHouseRequestsFirstQuantity,
|
||||
'kill_house_requests_first_weight': instance.killHouseRequestsFirstWeight,
|
||||
'bar_complete_with_kill_house': instance.barCompleteWithKillHouse,
|
||||
'accepted_real_quantity_final': instance.acceptedRealQuantityFinal,
|
||||
'accepted_real_wight_final': instance.acceptedRealWightFinal,
|
||||
'ware_house_bars': instance.wareHouseBars,
|
||||
'ware_house_bars_quantity': instance.wareHouseBarsQuantity,
|
||||
'ware_house_bars_weight': instance.wareHouseBarsWeight,
|
||||
'ware_house_bars_weight_lose': instance.wareHouseBarsWeightLose,
|
||||
};
|
||||
|
||||
_FreeGovernmentalInfo _$FreeGovernmentalInfoFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _FreeGovernmentalInfo(
|
||||
governmentalAllocatedQuantity:
|
||||
json['governmental_allocated_quantity'] as num?,
|
||||
totalCommitmentQuantity: json['total_commitment_quantity'] as num?,
|
||||
freeAllocatedQuantity: json['free_allocated_quantity'] as num?,
|
||||
totalFreeCommitmentQuantity: json['total_free_commitment_quantity'] as num?,
|
||||
leftTotalFreeCommitmentQuantity:
|
||||
json['left_total_free_commitment_quantity'] as num?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$FreeGovernmentalInfoToJson(
|
||||
_FreeGovernmentalInfo instance,
|
||||
) => <String, dynamic>{
|
||||
'governmental_allocated_quantity': instance.governmentalAllocatedQuantity,
|
||||
'total_commitment_quantity': instance.totalCommitmentQuantity,
|
||||
'free_allocated_quantity': instance.freeAllocatedQuantity,
|
||||
'total_free_commitment_quantity': instance.totalFreeCommitmentQuantity,
|
||||
'left_total_free_commitment_quantity':
|
||||
instance.leftTotalFreeCommitmentQuantity,
|
||||
};
|
||||
|
||||
_ReportInfo _$ReportInfoFromJson(Map<String, dynamic> json) => _ReportInfo(
|
||||
poultryScience: json['poultry_science'] as bool?,
|
||||
image: json['image'] as bool?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ReportInfoToJson(_ReportInfo instance) =>
|
||||
<String, dynamic>{
|
||||
'poultry_science': instance.poultryScience,
|
||||
'image': instance.image,
|
||||
};
|
||||
|
||||
_LatestHatchingChange _$LatestHatchingChangeFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _LatestHatchingChange(
|
||||
date: json['date'] as String?,
|
||||
role: json['role'] as String?,
|
||||
fullName: json['full_name'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$LatestHatchingChangeToJson(
|
||||
_LatestHatchingChange instance,
|
||||
) => <String, dynamic>{
|
||||
'date': instance.date,
|
||||
'role': instance.role,
|
||||
'full_name': instance.fullName,
|
||||
};
|
||||
|
||||
_Registrar _$RegistrarFromJson(Map<String, dynamic> json) => _Registrar(
|
||||
date: json['date'] as String?,
|
||||
role: json['role'] as String?,
|
||||
fullname: json['fullname'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$RegistrarToJson(_Registrar instance) =>
|
||||
<String, dynamic>{
|
||||
'date': instance.date,
|
||||
'role': instance.role,
|
||||
'fullname': instance.fullname,
|
||||
};
|
||||
|
||||
_LastChange _$LastChangeFromJson(Map<String, dynamic> json) => _LastChange(
|
||||
date: json['date'] as String?,
|
||||
role: json['role'] as String?,
|
||||
type: json['type'] as String?,
|
||||
fullName: json['full_name'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$LastChangeToJson(_LastChange instance) =>
|
||||
<String, dynamic>{
|
||||
'date': instance.date,
|
||||
'role': instance.role,
|
||||
'type': instance.type,
|
||||
'full_name': instance.fullName,
|
||||
};
|
||||
|
||||
_BreedItem _$BreedItemFromJson(Map<String, dynamic> json) => _BreedItem(
|
||||
breed: json['breed'] as String?,
|
||||
mainQuantity: json['main_quantity'] as num?,
|
||||
remainQuantity: json['remain_quantity'] as num?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$BreedItemToJson(_BreedItem instance) =>
|
||||
<String, dynamic>{
|
||||
'breed': instance.breed,
|
||||
'main_quantity': instance.mainQuantity,
|
||||
'remain_quantity': instance.remainQuantity,
|
||||
};
|
||||
@@ -0,0 +1,122 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'hatching_report.freezed.dart';
|
||||
part 'hatching_report.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class HatchingReport with _$HatchingReport {
|
||||
const factory HatchingReport({
|
||||
int? id,
|
||||
PoultryScience? poultryScience,
|
||||
Hatching? hatching,
|
||||
String? key,
|
||||
String? createDate,
|
||||
String? modifyDate,
|
||||
bool? trash,
|
||||
String? date,
|
||||
List<String>? image,
|
||||
double? lat,
|
||||
double? log,
|
||||
String? reporterFullname,
|
||||
String? reporterMobile,
|
||||
String? createdBy,
|
||||
String? modifiedBy,
|
||||
}) = _HatchingReport;
|
||||
|
||||
factory HatchingReport.fromJson(Map<String, dynamic> json) => _$HatchingReportFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class PoultryScience with _$PoultryScience {
|
||||
const factory PoultryScience({
|
||||
int? id,
|
||||
User? user,
|
||||
String? key,
|
||||
String? createDate,
|
||||
String? modifyDate,
|
||||
bool? trash,
|
||||
String? createdBy,
|
||||
String? modifiedBy,
|
||||
List<int>? poultry,
|
||||
}) = _PoultryScience;
|
||||
|
||||
factory PoultryScience.fromJson(Map<String, dynamic> json) => _$PoultryScienceFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class User with _$User {
|
||||
const factory User({String? fullname, String? mobile}) = _User;
|
||||
|
||||
factory User.fromJson(Map<String, dynamic> json) => _$UserFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class Hatching with _$Hatching {
|
||||
const factory Hatching({
|
||||
Poultry? poultry,
|
||||
GeneralInfo? generalInfo,
|
||||
String? chickenBreed,
|
||||
String? date,
|
||||
int? quantity,
|
||||
int? leftOver,
|
||||
int? period,
|
||||
int? losses,
|
||||
bool? violation,
|
||||
String? licenceNumber,
|
||||
int? chickenAge,
|
||||
VetFarm? vetFarm,
|
||||
}) = _Hatching;
|
||||
|
||||
factory Hatching.fromJson(Map<String, dynamic> json) => _$HatchingFromJson(json);
|
||||
}
|
||||
|
||||
|
||||
@freezed
|
||||
abstract class VetFarm with _$VetFarm {
|
||||
const factory VetFarm({
|
||||
String? vetFarmFullname,
|
||||
String? vetFarmMobile,
|
||||
}) = _VetFarm;
|
||||
|
||||
factory VetFarm.fromJson(Map<String, dynamic> json) => _$VetFarmFromJson(json);
|
||||
}
|
||||
|
||||
|
||||
@freezed
|
||||
abstract class Poultry with _$Poultry {
|
||||
const factory Poultry({
|
||||
String? key,
|
||||
String? fullname,
|
||||
String? mobile,
|
||||
String? city,
|
||||
String? unitName,
|
||||
int? killingAveAge,
|
||||
int? activeLeftOver,
|
||||
int? killingAveCount,
|
||||
double? realKillingAveWeight,
|
||||
double? realKillingLiveWeight,
|
||||
double? realKillingCarcassesWeight,
|
||||
double? realKillingLossWeightPercent,
|
||||
}) = _Poultry;
|
||||
|
||||
factory Poultry.fromJson(Map<String, dynamic> json) => _$PoultryFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class GeneralInfo with _$GeneralInfo {
|
||||
const factory GeneralInfo({
|
||||
int? aveAge,
|
||||
int? age,
|
||||
double? aveWeight,
|
||||
int? provinceKillRequests,
|
||||
int? provinceKillRequestsQuantity,
|
||||
double? provinceKillRequestsWeight,
|
||||
int? killHouseRequestsQuantity,
|
||||
int? killHouseRequests,
|
||||
double? killHouseRequestsWeight,
|
||||
int? totalQuantity,
|
||||
double? totalWeight,
|
||||
}) = _GeneralInfo;
|
||||
|
||||
factory GeneralInfo.fromJson(Map<String, dynamic> json) => _$GeneralInfoFromJson(json);
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,204 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'hatching_report.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_HatchingReport _$HatchingReportFromJson(Map<String, dynamic> json) =>
|
||||
_HatchingReport(
|
||||
id: (json['id'] as num?)?.toInt(),
|
||||
poultryScience: json['poultry_science'] == null
|
||||
? null
|
||||
: PoultryScience.fromJson(
|
||||
json['poultry_science'] as Map<String, dynamic>,
|
||||
),
|
||||
hatching: json['hatching'] == null
|
||||
? null
|
||||
: Hatching.fromJson(json['hatching'] as Map<String, dynamic>),
|
||||
key: json['key'] as String?,
|
||||
createDate: json['create_date'] as String?,
|
||||
modifyDate: json['modify_date'] as String?,
|
||||
trash: json['trash'] as bool?,
|
||||
date: json['date'] as String?,
|
||||
image: (json['image'] as List<dynamic>?)
|
||||
?.map((e) => e as String)
|
||||
.toList(),
|
||||
lat: (json['lat'] as num?)?.toDouble(),
|
||||
log: (json['log'] as num?)?.toDouble(),
|
||||
reporterFullname: json['reporter_fullname'] as String?,
|
||||
reporterMobile: json['reporter_mobile'] as String?,
|
||||
createdBy: json['created_by'] as String?,
|
||||
modifiedBy: json['modified_by'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$HatchingReportToJson(_HatchingReport instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'poultry_science': instance.poultryScience,
|
||||
'hatching': instance.hatching,
|
||||
'key': instance.key,
|
||||
'create_date': instance.createDate,
|
||||
'modify_date': instance.modifyDate,
|
||||
'trash': instance.trash,
|
||||
'date': instance.date,
|
||||
'image': instance.image,
|
||||
'lat': instance.lat,
|
||||
'log': instance.log,
|
||||
'reporter_fullname': instance.reporterFullname,
|
||||
'reporter_mobile': instance.reporterMobile,
|
||||
'created_by': instance.createdBy,
|
||||
'modified_by': instance.modifiedBy,
|
||||
};
|
||||
|
||||
_PoultryScience _$PoultryScienceFromJson(Map<String, dynamic> json) =>
|
||||
_PoultryScience(
|
||||
id: (json['id'] as num?)?.toInt(),
|
||||
user: json['user'] == null
|
||||
? null
|
||||
: User.fromJson(json['user'] as Map<String, dynamic>),
|
||||
key: json['key'] as String?,
|
||||
createDate: json['create_date'] as String?,
|
||||
modifyDate: json['modify_date'] as String?,
|
||||
trash: json['trash'] as bool?,
|
||||
createdBy: json['created_by'] as String?,
|
||||
modifiedBy: json['modified_by'] as String?,
|
||||
poultry: (json['poultry'] as List<dynamic>?)
|
||||
?.map((e) => (e as num).toInt())
|
||||
.toList(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$PoultryScienceToJson(_PoultryScience instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'user': instance.user,
|
||||
'key': instance.key,
|
||||
'create_date': instance.createDate,
|
||||
'modify_date': instance.modifyDate,
|
||||
'trash': instance.trash,
|
||||
'created_by': instance.createdBy,
|
||||
'modified_by': instance.modifiedBy,
|
||||
'poultry': instance.poultry,
|
||||
};
|
||||
|
||||
_User _$UserFromJson(Map<String, dynamic> json) => _User(
|
||||
fullname: json['fullname'] as String?,
|
||||
mobile: json['mobile'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$UserToJson(_User instance) => <String, dynamic>{
|
||||
'fullname': instance.fullname,
|
||||
'mobile': instance.mobile,
|
||||
};
|
||||
|
||||
_Hatching _$HatchingFromJson(Map<String, dynamic> json) => _Hatching(
|
||||
poultry: json['poultry'] == null
|
||||
? null
|
||||
: Poultry.fromJson(json['poultry'] as Map<String, dynamic>),
|
||||
generalInfo: json['general_info'] == null
|
||||
? null
|
||||
: GeneralInfo.fromJson(json['general_info'] as Map<String, dynamic>),
|
||||
chickenBreed: json['chicken_breed'] as String?,
|
||||
date: json['date'] as String?,
|
||||
quantity: (json['quantity'] as num?)?.toInt(),
|
||||
leftOver: (json['left_over'] as num?)?.toInt(),
|
||||
period: (json['period'] as num?)?.toInt(),
|
||||
losses: (json['losses'] as num?)?.toInt(),
|
||||
violation: json['violation'] as bool?,
|
||||
licenceNumber: json['licence_number'] as String?,
|
||||
chickenAge: (json['chicken_age'] as num?)?.toInt(),
|
||||
vetFarm: json['vet_farm'] == null
|
||||
? null
|
||||
: VetFarm.fromJson(json['vet_farm'] as Map<String, dynamic>),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$HatchingToJson(_Hatching instance) => <String, dynamic>{
|
||||
'poultry': instance.poultry,
|
||||
'general_info': instance.generalInfo,
|
||||
'chicken_breed': instance.chickenBreed,
|
||||
'date': instance.date,
|
||||
'quantity': instance.quantity,
|
||||
'left_over': instance.leftOver,
|
||||
'period': instance.period,
|
||||
'losses': instance.losses,
|
||||
'violation': instance.violation,
|
||||
'licence_number': instance.licenceNumber,
|
||||
'chicken_age': instance.chickenAge,
|
||||
'vet_farm': instance.vetFarm,
|
||||
};
|
||||
|
||||
_VetFarm _$VetFarmFromJson(Map<String, dynamic> json) => _VetFarm(
|
||||
vetFarmFullname: json['vet_farm_fullname'] as String?,
|
||||
vetFarmMobile: json['vet_farm_mobile'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$VetFarmToJson(_VetFarm instance) => <String, dynamic>{
|
||||
'vet_farm_fullname': instance.vetFarmFullname,
|
||||
'vet_farm_mobile': instance.vetFarmMobile,
|
||||
};
|
||||
|
||||
_Poultry _$PoultryFromJson(Map<String, dynamic> json) => _Poultry(
|
||||
key: json['key'] as String?,
|
||||
fullname: json['fullname'] as String?,
|
||||
mobile: json['mobile'] as String?,
|
||||
city: json['city'] as String?,
|
||||
unitName: json['unit_name'] as String?,
|
||||
killingAveAge: (json['killing_ave_age'] as num?)?.toInt(),
|
||||
activeLeftOver: (json['active_left_over'] as num?)?.toInt(),
|
||||
killingAveCount: (json['killing_ave_count'] as num?)?.toInt(),
|
||||
realKillingAveWeight: (json['real_killing_ave_weight'] as num?)?.toDouble(),
|
||||
realKillingLiveWeight: (json['real_killing_live_weight'] as num?)?.toDouble(),
|
||||
realKillingCarcassesWeight: (json['real_killing_carcasses_weight'] as num?)
|
||||
?.toDouble(),
|
||||
realKillingLossWeightPercent:
|
||||
(json['real_killing_loss_weight_percent'] as num?)?.toDouble(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$PoultryToJson(_Poultry instance) => <String, dynamic>{
|
||||
'key': instance.key,
|
||||
'fullname': instance.fullname,
|
||||
'mobile': instance.mobile,
|
||||
'city': instance.city,
|
||||
'unit_name': instance.unitName,
|
||||
'killing_ave_age': instance.killingAveAge,
|
||||
'active_left_over': instance.activeLeftOver,
|
||||
'killing_ave_count': instance.killingAveCount,
|
||||
'real_killing_ave_weight': instance.realKillingAveWeight,
|
||||
'real_killing_live_weight': instance.realKillingLiveWeight,
|
||||
'real_killing_carcasses_weight': instance.realKillingCarcassesWeight,
|
||||
'real_killing_loss_weight_percent': instance.realKillingLossWeightPercent,
|
||||
};
|
||||
|
||||
_GeneralInfo _$GeneralInfoFromJson(Map<String, dynamic> json) => _GeneralInfo(
|
||||
aveAge: (json['ave_age'] as num?)?.toInt(),
|
||||
age: (json['age'] as num?)?.toInt(),
|
||||
aveWeight: (json['ave_weight'] as num?)?.toDouble(),
|
||||
provinceKillRequests: (json['province_kill_requests'] as num?)?.toInt(),
|
||||
provinceKillRequestsQuantity:
|
||||
(json['province_kill_requests_quantity'] as num?)?.toInt(),
|
||||
provinceKillRequestsWeight: (json['province_kill_requests_weight'] as num?)
|
||||
?.toDouble(),
|
||||
killHouseRequestsQuantity: (json['kill_house_requests_quantity'] as num?)
|
||||
?.toInt(),
|
||||
killHouseRequests: (json['kill_house_requests'] as num?)?.toInt(),
|
||||
killHouseRequestsWeight: (json['kill_house_requests_weight'] as num?)
|
||||
?.toDouble(),
|
||||
totalQuantity: (json['total_quantity'] as num?)?.toInt(),
|
||||
totalWeight: (json['total_weight'] as num?)?.toDouble(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$GeneralInfoToJson(_GeneralInfo instance) =>
|
||||
<String, dynamic>{
|
||||
'ave_age': instance.aveAge,
|
||||
'age': instance.age,
|
||||
'ave_weight': instance.aveWeight,
|
||||
'province_kill_requests': instance.provinceKillRequests,
|
||||
'province_kill_requests_quantity': instance.provinceKillRequestsQuantity,
|
||||
'province_kill_requests_weight': instance.provinceKillRequestsWeight,
|
||||
'kill_house_requests_quantity': instance.killHouseRequestsQuantity,
|
||||
'kill_house_requests': instance.killHouseRequests,
|
||||
'kill_house_requests_weight': instance.killHouseRequestsWeight,
|
||||
'total_quantity': instance.totalQuantity,
|
||||
'total_weight': instance.totalWeight,
|
||||
};
|
||||
@@ -1,8 +1,27 @@
|
||||
import 'package:rasadyar_chicken/data/models/response/hatching/hatching_models.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/hatching_report/hatching_report.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/poultry_science/home_poultry_science/home_poultry_science_model.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
abstract class PoultryScienceRepository {
|
||||
Future<HomePoultryScienceModel?> getHomePoultryScience({
|
||||
Future<HomePoultryScienceModel?> getHomePoultry({required String token, required String type});
|
||||
|
||||
Future<PaginationModel<HatchingModel>?> getHatchingPoultry({
|
||||
required String token,
|
||||
required String type,
|
||||
Map<String, dynamic>? queryParameters,
|
||||
});
|
||||
|
||||
|
||||
Future<void> submitPoultryScienceReport({
|
||||
required String token,
|
||||
required IFormData data,
|
||||
ProgressCallback? onSendProgress,
|
||||
});
|
||||
|
||||
|
||||
Future<PaginationModel<HatchingReport>?> getHatchingPoultryReport({
|
||||
required String token,
|
||||
Map<String, dynamic>? queryParameters,
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@@ -1,5 +1,9 @@
|
||||
import 'package:rasadyar_chicken/data/data_source/remote/poultry_science/poultry_science_remote.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/hatching/hatching_models.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/hatching_report/hatching_report.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/poultry_science/home_poultry_science/home_poultry_science_model.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
import 'poultry_science_repository.dart';
|
||||
|
||||
class PoultryScienceRepositoryImp implements PoultryScienceRepository {
|
||||
@@ -8,10 +12,33 @@ class PoultryScienceRepositoryImp implements PoultryScienceRepository {
|
||||
PoultryScienceRepositoryImp(this.datasource);
|
||||
|
||||
@override
|
||||
Future<HomePoultryScienceModel?> getHomePoultryScience({
|
||||
Future<HomePoultryScienceModel?> getHomePoultry({
|
||||
required String token,
|
||||
required String type,
|
||||
}) async => await datasource.getHomePoultryScience(token: token, type: type);
|
||||
|
||||
@override
|
||||
Future<PaginationModel<HatchingModel>?> getHatchingPoultry({
|
||||
required String token,
|
||||
Map<String, dynamic>? queryParameters,
|
||||
}) async => await datasource.getHatchingPoultry(token: token, queryParameters: queryParameters);
|
||||
|
||||
@override
|
||||
Future<void> submitPoultryScienceReport({
|
||||
required String token,
|
||||
required IFormData data,
|
||||
ProgressCallback? onSendProgress,
|
||||
}) async => await datasource.submitPoultryScienceReport(
|
||||
token: token,
|
||||
data: data,
|
||||
onSendProgress: onSendProgress,
|
||||
);
|
||||
|
||||
@override
|
||||
Future<PaginationModel<HatchingReport>?> getHatchingPoultryReport({
|
||||
required String token,
|
||||
Map<String, dynamic>? queryParameters,
|
||||
}) async {
|
||||
return await datasource.getPoultryScienceReport(token: token, queryParameters: queryParameters);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ class PoultryScienceHomeLogic extends GetxController {
|
||||
|
||||
Future<void> getHomePoultryHatching() async {
|
||||
await safeCall<HomePoultryScienceModel?>(
|
||||
call: () async => await rootLogic.poultryRepository.getHomePoultryScience(
|
||||
call: () async => await rootLogic.poultryRepository.getHomePoultry(
|
||||
token: rootLogic.tokenService.accessToken.value!,
|
||||
type: 'home',
|
||||
),
|
||||
|
||||
@@ -141,7 +141,7 @@ class PoultryScienceHomePage extends GetView<PoultryScienceHomeLogic> {
|
||||
),
|
||||
),
|
||||
|
||||
WidelyUsedWidget(),
|
||||
// WidelyUsedWidget(),
|
||||
SizedBox(height: 20),
|
||||
],
|
||||
),
|
||||
|
||||
@@ -0,0 +1,258 @@
|
||||
import 'package:rasadyar_chicken/data/models/response/hatching/hatching_models.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/hatching_report/hatching_report.dart';
|
||||
import 'package:rasadyar_chicken/presentation/pages/poultry_science/root/logic.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
class InspectionPoultryScienceLogic extends GetxController {
|
||||
Rx<Resource<PaginationModel<HatchingModel>>> hatchingList =
|
||||
Resource<PaginationModel<HatchingModel>>.loading().obs;
|
||||
|
||||
Rx<Resource<PaginationModel<HatchingReport>>> hatchingReportList =
|
||||
Resource<PaginationModel<HatchingReport>>.loading().obs;
|
||||
|
||||
PoultryScienceRootLogic rootLogic = Get.find<PoultryScienceRootLogic>();
|
||||
|
||||
Rx<LatLng> currentLocation = LatLng(34.798315281272544, 48.51479142983491).obs;
|
||||
|
||||
final RxBool isLoadingMoreAllocationsMade = false.obs;
|
||||
RxInt currentPage = 1.obs;
|
||||
RxList<int> isExpandedList = <int>[].obs;
|
||||
RxList<XFile> pickedImages = <XFile>[].obs;
|
||||
final List<MultipartFile> _multiPartPickedImages = <MultipartFile>[];
|
||||
|
||||
RxBool isOnUpload = false.obs;
|
||||
|
||||
RxDouble presentUpload = 0.0.obs;
|
||||
RxList<String> routesName = RxList();
|
||||
RxInt selectedSegmentIndex = 0.obs;
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
|
||||
routesName.value = ['اقدام'].toList();
|
||||
routesName.add(selectedSegmentIndex.value == 0 ? 'بازرسی' : 'بایگانی');
|
||||
ever(selectedSegmentIndex, (callback) {
|
||||
routesName.removeLast();
|
||||
routesName.add(callback == 0 ? 'بازرسی' : 'بایگانی');
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
super.onReady();
|
||||
getHatchingList();
|
||||
getHatchingReport();
|
||||
|
||||
checkPermission(request: true);
|
||||
ever(pickedImages, (callback) {
|
||||
_multiPartPickedImages.clear();
|
||||
for (var element in pickedImages) {
|
||||
_multiPartPickedImages.add(
|
||||
MultipartFile.fromFileSync(element.path, filename: element.name),
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
// TODO: implement onClose
|
||||
super.onClose();
|
||||
}
|
||||
|
||||
Future<void> getHatchingList([bool isLoadingMore = false]) async {
|
||||
if (isLoadingMore) {
|
||||
isLoadingMoreAllocationsMade.value = true;
|
||||
} else {
|
||||
hatchingList.value = Resource<PaginationModel<HatchingModel>>.loading();
|
||||
}
|
||||
/*
|
||||
if (searchedValue.value != null &&
|
||||
searchedValue.value!.trim().isNotEmpty &&
|
||||
currentPage.value > 1) {
|
||||
currentPage.value = 1;
|
||||
}*/
|
||||
|
||||
safeCall(
|
||||
call: () async => await rootLogic.poultryRepository.getHatchingPoultry(
|
||||
token: rootLogic.tokenService.accessToken.value!,
|
||||
queryParameters: buildQueryParams(
|
||||
queryParams: {'type': 'hatching', 'report': true},
|
||||
pageSize: 50,
|
||||
page: currentPage.value,
|
||||
),
|
||||
),
|
||||
onSuccess: (res) {
|
||||
if ((res?.count ?? 0) == 0) {
|
||||
hatchingList.value = Resource<PaginationModel<HatchingModel>>.empty();
|
||||
} else {
|
||||
hatchingList.value = Resource<PaginationModel<HatchingModel>>.success(
|
||||
PaginationModel<HatchingModel>(
|
||||
count: res?.count ?? 0,
|
||||
next: res?.next,
|
||||
previous: res?.previous,
|
||||
results: [...(hatchingList.value.data?.results ?? []), ...(res?.results ?? [])],
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> getHatchingReport([bool isLoadingMore = false]) async {
|
||||
if (isLoadingMore) {
|
||||
isLoadingMoreAllocationsMade.value = true;
|
||||
} else {
|
||||
hatchingReportList.value = Resource<PaginationModel<HatchingReport>>.loading();
|
||||
}
|
||||
/*
|
||||
if (searchedValue.value != null &&
|
||||
searchedValue.value!.trim().isNotEmpty &&
|
||||
currentPage.value > 1) {
|
||||
currentPage.value = 1;
|
||||
}*/
|
||||
|
||||
safeCall(
|
||||
call: () async => await rootLogic.poultryRepository.getHatchingPoultryReport(
|
||||
token: rootLogic.tokenService.accessToken.value!,
|
||||
queryParameters: buildQueryParams(
|
||||
role: 'PoultryScience',
|
||||
pageSize: 50,
|
||||
search: 'filter',
|
||||
value: '',
|
||||
page: currentPage.value,
|
||||
),
|
||||
),
|
||||
onSuccess: (res) {
|
||||
if ((res?.count ?? 0) == 0) {
|
||||
hatchingReportList.value = Resource<PaginationModel<HatchingReport>>.empty();
|
||||
} else {
|
||||
hatchingReportList.value = Resource<PaginationModel<HatchingReport>>.success(
|
||||
PaginationModel<HatchingReport>(
|
||||
count: res?.count ?? 0,
|
||||
next: res?.next,
|
||||
previous: res?.previous,
|
||||
results: [...(hatchingReportList.value.data?.results ?? []), ...(res?.results ?? [])],
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> pickImages() async {
|
||||
determineCurrentPosition();
|
||||
var tmp = await ImagePicker().pickImage(
|
||||
source: ImageSource.camera,
|
||||
imageQuality: 50,
|
||||
preferredCameraDevice: CameraDevice.front,
|
||||
maxHeight: 720,
|
||||
maxWidth: 1080,
|
||||
|
||||
);
|
||||
getFileSizeInKB(tmp?.path ?? '', tag: 'Picked');
|
||||
|
||||
if (tmp?.path != null && pickedImages.length < 7) {
|
||||
pickedImages.add(tmp!);
|
||||
}
|
||||
}
|
||||
|
||||
void removeImage(int index) {
|
||||
pickedImages.removeAt(index);
|
||||
}
|
||||
|
||||
void clearImages() {
|
||||
pickedImages.clear();
|
||||
}
|
||||
|
||||
Future<void> submitInspectionReport({required int id}) async {
|
||||
isOnUpload.value = true;
|
||||
|
||||
DioFormData formData = DioFormData();
|
||||
|
||||
for (var element in _multiPartPickedImages) {
|
||||
var ls = await element.finalize().toList();
|
||||
formData.addFile('file', ls[0], element.filename ?? 'image.jpg');
|
||||
}
|
||||
|
||||
formData.addField("lat", currentLocation.value.latitude.toString());
|
||||
formData.addField("log", currentLocation.value.longitude.toString());
|
||||
formData.addField("hatching_id", id.toString());
|
||||
|
||||
safeCall(
|
||||
call: () async => await rootLogic.poultryRepository.submitPoultryScienceReport(
|
||||
token: rootLogic.tokenService.accessToken.value!,
|
||||
data: formData,
|
||||
onSendProgress: (sent, total) {
|
||||
presentUpload.value = calculateUploadProgress(sent: sent, total: total);
|
||||
},
|
||||
),
|
||||
onSuccess: (res) {
|
||||
closeBottomSheet();
|
||||
clearImages();
|
||||
getHatchingList();
|
||||
getHatchingReport();
|
||||
isOnUpload.value = false;
|
||||
},
|
||||
onError: (error, stackTrace) async{
|
||||
|
||||
clearImages();
|
||||
isOnUpload.value = false;
|
||||
|
||||
await Future.delayed(const Duration(seconds: 4)).then((value) => closeBottomSheet(),);
|
||||
|
||||
|
||||
},
|
||||
showError: true,
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> determineCurrentPosition() async {
|
||||
final position = await Geolocator.getCurrentPosition(
|
||||
locationSettings: AndroidSettings(accuracy: LocationAccuracy.best),
|
||||
);
|
||||
final latLng = LatLng(position.latitude, position.longitude);
|
||||
|
||||
currentLocation.value = latLng;
|
||||
}
|
||||
|
||||
Future<bool> checkPermission({bool request = false}) async {
|
||||
try {
|
||||
final LocationPermission permission = await Geolocator.checkPermission();
|
||||
|
||||
switch (permission) {
|
||||
case LocationPermission.denied:
|
||||
final LocationPermission requestResult = await Geolocator.requestPermission();
|
||||
return requestResult != LocationPermission.denied &&
|
||||
requestResult != LocationPermission.deniedForever;
|
||||
|
||||
case LocationPermission.deniedForever:
|
||||
return request ? await Geolocator.openAppSettings() : false;
|
||||
|
||||
case LocationPermission.always:
|
||||
case LocationPermission.whileInUse:
|
||||
return true;
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
} catch (e) {
|
||||
eLog(e);
|
||||
return await Geolocator.openLocationSettings();
|
||||
}
|
||||
}
|
||||
|
||||
void closeBottomSheet() {
|
||||
Get.back();
|
||||
}
|
||||
|
||||
double calculateUploadProgress({required int sent, required int total}) {
|
||||
if (total != 0) {
|
||||
double progress = (sent * 100 / total) / 100;
|
||||
return progress;
|
||||
} else {
|
||||
return 0.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,586 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/hatching/hatching_models.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/hatching_report/hatching_report.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/page_route.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
import 'logic.dart';
|
||||
|
||||
class InspectionPoultrySciencePage extends GetView<InspectionPoultryScienceLogic> {
|
||||
const InspectionPoultrySciencePage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BasePage(
|
||||
isBase: true,
|
||||
routesWidget: ObxValue((route) => buildPageRoute(route), controller.routesName),
|
||||
onBackPressed: () => Get.back(id: 0),
|
||||
widgets: [
|
||||
segmentWidget(),
|
||||
|
||||
ObxValue((data) {
|
||||
return data.value == 0 ? hatchingWidget() : reportWidget();
|
||||
}, controller.selectedSegmentIndex),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
ObxValue<Rx<Resource<PaginationModel<HatchingModel>>>> hatchingWidget() {
|
||||
return ObxValue((data) {
|
||||
return RPaginatedListView(
|
||||
listType: ListType.separated,
|
||||
resource: data.value,
|
||||
hasMore: data.value.data?.next != null,
|
||||
padding: EdgeInsets.fromLTRB(8, 8, 8, 80),
|
||||
itemBuilder: (context, index) {
|
||||
var item = data.value.data!.results![index];
|
||||
return ObxValue((val) {
|
||||
return ExpandableListItem2(
|
||||
selected: val.contains(index),
|
||||
onTap: () => controller.isExpandedList.toggle(index),
|
||||
index: index,
|
||||
child: itemListWidget(item),
|
||||
secondChild: itemListExpandedWidget(item),
|
||||
labelColor: AppColor.blueLight,
|
||||
labelIcon: Assets.vec.checkSquareSvg.path,
|
||||
);
|
||||
}, controller.isExpandedList);
|
||||
},
|
||||
itemCount: data.value.data?.results?.length ?? 0,
|
||||
separatorBuilder: (context, index) => SizedBox(height: 8.h),
|
||||
onLoadMore: () async => controller.getHatchingList(true),
|
||||
onRefresh: () async {
|
||||
controller.currentPage.value = 1;
|
||||
await controller.getHatchingList();
|
||||
},
|
||||
);
|
||||
}, controller.hatchingList);
|
||||
}
|
||||
|
||||
|
||||
|
||||
Container itemListExpandedWidget(HatchingModel item) {
|
||||
return Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 8),
|
||||
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(8)),
|
||||
child: Column(
|
||||
spacing: 8,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
item.poultry?.user?.fullname ?? 'N/A',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan16.copyWith(color: AppColor.greenDark),
|
||||
),
|
||||
Spacer(),
|
||||
|
||||
Visibility(
|
||||
child: Text(
|
||||
item.violation == true ? 'پیگیری' : 'عادی',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan10.copyWith(color: AppColor.redDark),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Container(
|
||||
height: 32,
|
||||
padding: EdgeInsets.symmetric(horizontal: 8),
|
||||
decoration: ShapeDecoration(
|
||||
color: AppColor.blueLight,
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(width: 1, color: AppColor.blueLightHover),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Row(
|
||||
spacing: 3,
|
||||
children: [
|
||||
Text('نژاد:', style: AppFonts.yekan14.copyWith(color: AppColor.textColor)),
|
||||
Text(
|
||||
item.breed?.first.breed ?? 'N/A',
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.textColor),
|
||||
),
|
||||
|
||||
SizedBox(width: 2),
|
||||
|
||||
Text(
|
||||
' سن${item.age}',
|
||||
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Text(
|
||||
' دوره جوجه ریزی:${item.period}',
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.textColor),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
buildRow(title: 'شماره مجوز جوجه ریزی', value: item.licenceNumber ?? 'N/A'),
|
||||
buildRow(
|
||||
title: 'حجم جوجه ریزی',
|
||||
value: item.quantity.separatedByComma ?? 'N/A',
|
||||
valueStyle: AppFonts.yekan14.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
buildRow(title: 'مانده در سالن', value: item.leftOver.separatedByComma ?? 'N/A'),
|
||||
buildRow(title: 'تلفات', value: item.losses.separatedByComma ?? 'N/A'),
|
||||
buildRow(
|
||||
title: 'دامپزشک فارم',
|
||||
value: '${item.vetFarm?.vetFarmFullName}(${item.vetFarm?.vetFarmMobile})',
|
||||
),
|
||||
buildRow(
|
||||
title: 'شرح بازرسی',
|
||||
value: item.reportInfo?.image == false ? 'ارسال تصویر جوجه ریزی فارم ' : 'تکمیل شده',
|
||||
titleStyle: AppFonts.yekan14.copyWith(
|
||||
color: (item.reportInfo?.image ?? false) ? AppColor.greenNormal : AppColor.redDark,
|
||||
),
|
||||
valueStyle: AppFonts.yekan14.copyWith(
|
||||
color: (item.reportInfo?.image ?? false) ? AppColor.greenNormal : AppColor.redDark,
|
||||
),
|
||||
),
|
||||
Visibility(
|
||||
visible: (item.reportInfo?.image == false ?? false),
|
||||
child: RElevated(
|
||||
text: 'ثبت بازرسی',
|
||||
isFullWidth: true,
|
||||
width: 150.w,
|
||||
height: 40.h,
|
||||
onPressed: () {
|
||||
cameraBottomSheet(item.id!);
|
||||
},
|
||||
textStyle: AppFonts.yekan20.copyWith(color: Colors.white),
|
||||
backgroundColor: AppColor.greenNormal,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void cameraBottomSheet(int id) {
|
||||
Get.bottomSheet(
|
||||
isDismissible: false,
|
||||
isScrollControlled: false,
|
||||
|
||||
BaseBottomSheet(
|
||||
child: Column(
|
||||
children: [
|
||||
GridView.builder(
|
||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 4,
|
||||
mainAxisSpacing: 8,
|
||||
crossAxisSpacing: 8,
|
||||
childAspectRatio: 1,
|
||||
),
|
||||
shrinkWrap: true,
|
||||
itemCount: 7,
|
||||
itemBuilder: (context, index) {
|
||||
return ObxValue((data) {
|
||||
if (index + 1 > data.length) {
|
||||
return GestureDetector(
|
||||
onTap: () async {
|
||||
await controller.pickImages();
|
||||
},
|
||||
child: Container(
|
||||
width: 80.h,
|
||||
height: 80.h,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.lightGreyNormal,
|
||||
borderRadius: BorderRadius.circular(8.r),
|
||||
),
|
||||
child: Center(
|
||||
child: Icon(
|
||||
Icons.camera_alt,
|
||||
color: AppColor.lightGreyDarker,
|
||||
size: 32.h,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return Container(
|
||||
width: 80.h,
|
||||
height: 80.h,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.lightGreyNormal,
|
||||
borderRadius: BorderRadius.circular(8.r),
|
||||
),
|
||||
child: Stack(
|
||||
children: [
|
||||
Positioned.fill(
|
||||
child: Image.file(File(data[index].path), fit: BoxFit.cover),
|
||||
),
|
||||
|
||||
Positioned(
|
||||
top: 4,
|
||||
left: 4,
|
||||
child: GestureDetector(
|
||||
onTap: () {
|
||||
controller.removeImage(index);
|
||||
},
|
||||
child: Container(
|
||||
width: 24.w,
|
||||
height: 24.h,
|
||||
clipBehavior: Clip.antiAlias,
|
||||
padding: EdgeInsets.all(4),
|
||||
decoration: ShapeDecoration(
|
||||
color: Colors.white.withValues(alpha: 0.80),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
),
|
||||
),
|
||||
child: Assets.vec.trashSvg.svg(
|
||||
width: 8.w,
|
||||
height: 8.h,
|
||||
colorFilter: ColorFilter.mode(
|
||||
AppColor.redNormal,
|
||||
BlendMode.srcIn,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}, controller.pickedImages);
|
||||
},
|
||||
),
|
||||
|
||||
SizedBox(height: 20),
|
||||
Row(
|
||||
spacing: 16,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Obx(() {
|
||||
return RElevated(
|
||||
height: 40.h,
|
||||
text: 'ارسال',
|
||||
backgroundColor: AppColor.greenNormal,
|
||||
progress: controller.presentUpload.value,
|
||||
isLoading: controller.isOnUpload.value,
|
||||
enabled: controller.pickedImages.length >= 2,
|
||||
onPressed: () async {
|
||||
controller.submitInspectionReport(id: id);
|
||||
},
|
||||
);
|
||||
}),
|
||||
ObxValue((data) {
|
||||
return RElevated(
|
||||
height: 40.h,
|
||||
text: 'انصراف',
|
||||
backgroundColor: AppColor.redNormal,
|
||||
enabled: !data.value,
|
||||
onPressed: () {
|
||||
if (!data.value) {
|
||||
controller.clearImages();
|
||||
Get.back();
|
||||
}
|
||||
},
|
||||
);
|
||||
}, controller.isOnUpload),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Padding segmentWidget() {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.fromLTRB(8, 0, 8, 8),
|
||||
child: Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: RSegment(
|
||||
children: ['بازرسی', 'بایگانی'],
|
||||
selectedIndex: 0,
|
||||
borderColor: const Color(0xFFB4B4B4),
|
||||
selectedBorderColor: AppColor.blueNormal,
|
||||
selectedBackgroundColor: AppColor.blueLight,
|
||||
onSegmentSelected: (index) => controller.selectedSegmentIndex.value = index,
|
||||
backgroundColor: AppColor.whiteGreyNormal,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget reportWidget() {
|
||||
return ObxValue((data) {
|
||||
return RPaginatedListView(
|
||||
listType: ListType.separated,
|
||||
resource: data.value,
|
||||
hasMore: data.value.data?.next != null,
|
||||
padding: EdgeInsets.fromLTRB(8, 8, 8, 80),
|
||||
itemBuilder: (context, index) {
|
||||
var item = data.value.data!.results![index];
|
||||
return ObxValue((val) {
|
||||
return ExpandableListItem2(
|
||||
selected: val.contains(index),
|
||||
onTap: () => controller.isExpandedList.toggle(index),
|
||||
index: index,
|
||||
child: itemListWidgetReport(item),
|
||||
secondChild: itemListExpandedWidgetReport(item),
|
||||
labelColor: AppColor.blueLight,
|
||||
labelIcon: Assets.vec.checkSquareSvg.path,
|
||||
);
|
||||
}, controller.isExpandedList);
|
||||
},
|
||||
itemCount: data.value.data?.results?.length ?? 0,
|
||||
separatorBuilder: (context, index) => SizedBox(height: 8.h),
|
||||
onLoadMore: () async => controller.getHatchingReport(true),
|
||||
onRefresh: () async {
|
||||
controller.currentPage.value = 1;
|
||||
await controller.getHatchingReport();
|
||||
},
|
||||
);
|
||||
}, controller.hatchingReportList);
|
||||
}
|
||||
|
||||
Widget itemListExpandedWidgetReport(HatchingReport item) {
|
||||
return Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 8),
|
||||
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(8)),
|
||||
child: Column(
|
||||
spacing: 8,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
item.hatching?.poultry?.fullname ?? 'N/A',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan16.copyWith(color: AppColor.greenDark),
|
||||
),
|
||||
Spacer(),
|
||||
|
||||
Visibility(
|
||||
child: Text(
|
||||
item.hatching?.violation == true ? 'پیگیری' : 'عادی',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan10.copyWith(color: AppColor.redDark),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Container(
|
||||
height: 32,
|
||||
padding: EdgeInsets.symmetric(horizontal: 8),
|
||||
decoration: ShapeDecoration(
|
||||
color: AppColor.blueLight,
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(width: 1, color: AppColor.blueLightHover),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Row(
|
||||
spacing: 3,
|
||||
children: [
|
||||
Text('نژاد:', style: AppFonts.yekan14.copyWith(color: AppColor.textColor)),
|
||||
Text(
|
||||
item.hatching?.chickenBreed?? 'N/A',
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.textColor),
|
||||
),
|
||||
|
||||
SizedBox(width: 2),
|
||||
|
||||
Text(
|
||||
' سن${ item.hatching?.chickenAge}',
|
||||
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Text(
|
||||
' دوره جوجه ریزی:${ item.hatching?.period}',
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.textColor),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
buildRow(title: 'شماره مجوز جوجه ریزی', value: item.hatching?.licenceNumber ?? 'N/A'),
|
||||
buildRow(
|
||||
title: 'حجم جوجه ریزی',
|
||||
value: item.hatching?.quantity.separatedByComma ?? 'N/A',
|
||||
valueStyle: AppFonts.yekan14.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
buildRow(title: 'مانده در سالن', value: item.hatching?.leftOver.separatedByComma ?? 'N/A'),
|
||||
buildRow(title: 'تلفات', value: item.hatching?.losses.separatedByComma ?? 'N/A'),
|
||||
buildRow(
|
||||
title: 'دامپزشک فارم',
|
||||
value: '${item.hatching?.vetFarm?.vetFarmFullname}(${item.hatching?.vetFarm?.vetFarmMobile})',
|
||||
),
|
||||
buildRow(
|
||||
title: 'شرح بازرسی',
|
||||
value: 'تکمیل شده',
|
||||
titleStyle: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.greenNormal
|
||||
),
|
||||
valueStyle: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.greenNormal
|
||||
),
|
||||
),
|
||||
|
||||
SizedBox(
|
||||
height: 140.h,
|
||||
child: GridView.builder(
|
||||
shrinkWrap: true,
|
||||
itemCount: item.image?.length ?? 0,
|
||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 2,
|
||||
mainAxisSpacing: 10,
|
||||
crossAxisSpacing: 10,
|
||||
),
|
||||
itemBuilder: (context, index) => Container(
|
||||
height: 138.h,
|
||||
clipBehavior: Clip.hardEdge,
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(8.r),
|
||||
image: DecorationImage(
|
||||
image: NetworkImage(item.image?[index] ?? ''),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget itemListWidget(HatchingModel item) {
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
SizedBox(width: 20),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
spacing: 3,
|
||||
children: [
|
||||
Text(
|
||||
item.poultry?.user?.fullname ?? 'N/A',
|
||||
textAlign: TextAlign.start,
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
Text(
|
||||
item.poultry?.user?.mobile ?? 'N/A',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.bgDark),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 3,
|
||||
child: Column(
|
||||
spacing: 3,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
item.poultry?.unitName ?? 'N/Aaq',
|
||||
textAlign: TextAlign.start,
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.bgDark),
|
||||
),
|
||||
Text(
|
||||
item.poultry?.licenceNumber ?? 'N/A',
|
||||
textAlign: TextAlign.left,
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Assets.vec.scanSvg.svg(
|
||||
width: 32.w,
|
||||
height: 32.h,
|
||||
colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Row itemListWidgetReport(HatchingReport item) {
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
SizedBox(width: 20),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
spacing: 3,
|
||||
children: [
|
||||
Text(
|
||||
item.hatching?.poultry?.fullname ?? 'N/A',
|
||||
textAlign: TextAlign.start,
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
Text(
|
||||
item.hatching?.poultry?.mobile ?? 'N/A',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.bgDark),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 3,
|
||||
child: Column(
|
||||
spacing: 3,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
item.hatching?.poultry?.unitName ?? 'N/Aaq',
|
||||
textAlign: TextAlign.start,
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.bgDark),
|
||||
),
|
||||
Text(
|
||||
item.hatching?.licenceNumber ?? 'N/A',
|
||||
textAlign: TextAlign.left,
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Assets.vec.scanSvg.svg(
|
||||
width: 32.w,
|
||||
height: 32.h,
|
||||
colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,18 @@
|
||||
import 'package:rasadyar_chicken/presentation/routes/routes.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
class PoultryActionLogic extends GetxController {
|
||||
RxList<String> actions = ['a'].obs;
|
||||
class PoultryActionItem {
|
||||
final String title;
|
||||
final String route;
|
||||
|
||||
PoultryActionItem({required this.title, required this.route});
|
||||
}
|
||||
|
||||
class PoultryActionLogic extends GetxController {
|
||||
RxList<PoultryActionItem> items = [
|
||||
PoultryActionItem(title: "بازرسی", route: ChickenRoutes.inspectionPoultryScience),
|
||||
PoultryActionItem(title: "ثبت کشتار", route: ChickenRoutes.killingRegistrationPoultryScience),
|
||||
PoultryActionItem(title: "فارم ها", route: ChickenRoutes.farmPoultryScience),
|
||||
PoultryActionItem(title: "جوجه ریزی فعال", route: ChickenRoutes.activeHatchingPoultryScience),
|
||||
].obs;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:get/get.dart';
|
||||
import 'package:rasadyar_chicken/presentation/pages/role/view.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
import 'package:rasadyar_core/presentation/common/assets.gen.dart';
|
||||
|
||||
import '../../../widget/app_bar.dart';
|
||||
import 'logic.dart';
|
||||
@@ -13,42 +11,33 @@ class PoultryActionPage extends GetView<PoultryActionLogic> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: chickenAppBar(
|
||||
hasBack: false,
|
||||
hasFilter: false,
|
||||
hasSearch: false,
|
||||
isBase: false,
|
||||
),
|
||||
appBar: chickenAppBar(hasBack: false, hasFilter: false, hasSearch: false, isBase: false),
|
||||
body: Column(
|
||||
children: [
|
||||
Assets.images.poultryAction.image(
|
||||
height: 212.h,
|
||||
width: Get.width.w,
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
Assets.images.poultryAction.image(height: 212.h, width: Get.width.w, fit: BoxFit.cover),
|
||||
ObxValue((data) {
|
||||
return Expanded(
|
||||
child: GridView.builder(
|
||||
physics: BouncingScrollPhysics(),
|
||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 4,
|
||||
crossAxisCount: 2,
|
||||
mainAxisSpacing: 12.h,
|
||||
crossAxisSpacing: 12.w,
|
||||
childAspectRatio: 2,
|
||||
),
|
||||
itemCount: 4,
|
||||
itemCount: data.length,
|
||||
hitTestBehavior: HitTestBehavior.opaque,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
var item = data[index];
|
||||
return roleCard(
|
||||
title: data[index],
|
||||
title: item.title,
|
||||
onTap: () async {
|
||||
|
||||
Get.toNamed(item.route, id: 0);
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}, controller.actions),
|
||||
}, controller.items),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
@@ -3,7 +3,7 @@ import 'package:rasadyar_chicken/data/di/chicken_di.dart';
|
||||
import 'package:rasadyar_chicken/data/repositories/poultry_science/poultry_science_repository.dart';
|
||||
import 'package:rasadyar_chicken/presentation/pages/poultry_science/home/view.dart';
|
||||
import 'package:rasadyar_chicken/presentation/pages/poultry_science/poultry_action/view.dart';
|
||||
import 'package:rasadyar_chicken/presentation/pages/steward/profile/view.dart';
|
||||
import 'package:rasadyar_chicken/presentation/pages/poultry_science/profile/view.dart';
|
||||
import 'package:rasadyar_chicken/presentation/utils/utils.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
@@ -11,11 +11,7 @@ enum ErrorLocationType { serviceDisabled, permissionDenied, none }
|
||||
|
||||
class PoultryScienceRootLogic extends GetxController {
|
||||
RxInt currentPage = 1.obs;
|
||||
List<Widget> pages = [
|
||||
PoultryActionPage(),
|
||||
PoultryScienceHomePage(),
|
||||
ProfilePage(),
|
||||
];
|
||||
List<Widget> pages = [PoultryActionPage(), PoultryScienceHomePage(), PoultryScienceProfilePage()];
|
||||
late DioRemote dioRemote;
|
||||
var tokenService = Get.find<TokenStorageService>();
|
||||
late PoultryScienceRepository poultryRepository;
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:rasadyar_chicken/presentation/routes/pages.dart';
|
||||
import 'package:rasadyar_chicken/presentation/routes/routes.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
import 'logic.dart';
|
||||
@@ -67,18 +69,24 @@ class PoultryScienceRootPage extends GetView<PoultryScienceRootLogic> {
|
||||
),*/
|
||||
Navigator(
|
||||
key: Get.nestedKey(0),
|
||||
onGenerateRoute: (settings) =>
|
||||
GetPageRoute(page: () => controller.pages[0]),
|
||||
onGenerateRoute: (settings) {
|
||||
final page = ChickenPages.pages.firstWhere(
|
||||
(e) => e.name == settings.name,
|
||||
orElse: () => ChickenPages.pages.firstWhere(
|
||||
(e) => e.name == ChickenRoutes.actionPoultryScience,
|
||||
),
|
||||
);
|
||||
|
||||
return buildRouteFromGetPage(page);
|
||||
},
|
||||
),
|
||||
Navigator(
|
||||
key: Get.nestedKey(1),
|
||||
onGenerateRoute: (settings) =>
|
||||
GetPageRoute(page: () => controller.pages[1]),
|
||||
onGenerateRoute: (settings) => GetPageRoute(page: () => controller.pages[1]),
|
||||
),
|
||||
Navigator(
|
||||
key: Get.nestedKey(2),
|
||||
onGenerateRoute: (settings) =>
|
||||
GetPageRoute(page: () => controller.pages[1]),
|
||||
onGenerateRoute: (settings) => GetPageRoute(page: () => controller.pages[2]),
|
||||
),
|
||||
],
|
||||
index: data.value,
|
||||
@@ -92,7 +100,7 @@ class PoultryScienceRootPage extends GetView<PoultryScienceRootLogic> {
|
||||
icon: Assets.vec.settingSvg.path,
|
||||
isSelected: controller.currentPage.value == 0,
|
||||
onTap: () {
|
||||
//Get.nestedKey(1)?.currentState?.popUntil((route) => route.isFirst);
|
||||
Get.nestedKey(1)?.currentState?.popUntil((route) => route.isFirst);
|
||||
|
||||
controller.changePage(0);
|
||||
},
|
||||
@@ -102,8 +110,8 @@ class PoultryScienceRootPage extends GetView<PoultryScienceRootLogic> {
|
||||
icon: Assets.vec.homeSvg.path,
|
||||
isSelected: controller.currentPage.value == 1,
|
||||
onTap: () {
|
||||
/* Get.nestedKey(1)?.currentState?.popUntil((route) => route.isFirst);
|
||||
Get.nestedKey(0)?.currentState?.popUntil((route) => route.isFirst);*/
|
||||
Get.nestedKey(0)?.currentState?.popUntil((route) => route.isFirst);
|
||||
Get.nestedKey(2)?.currentState?.popUntil((route) => route.isFirst);
|
||||
controller.changePage(1);
|
||||
},
|
||||
),
|
||||
|
||||
@@ -1,7 +1,10 @@
|
||||
import 'package:rasadyar_chicken/presentation/pages/auth/logic.dart';
|
||||
import 'package:rasadyar_chicken/presentation/pages/auth/view.dart';
|
||||
import 'package:rasadyar_chicken/presentation/pages/poultry_science/home/logic.dart';
|
||||
import 'package:rasadyar_chicken/presentation/pages/poultry_science/inspection/logic.dart';
|
||||
import 'package:rasadyar_chicken/presentation/pages/poultry_science/inspection/view.dart';
|
||||
import 'package:rasadyar_chicken/presentation/pages/poultry_science/poultry_action/logic.dart';
|
||||
import 'package:rasadyar_chicken/presentation/pages/poultry_science/poultry_action/view.dart';
|
||||
import 'package:rasadyar_chicken/presentation/pages/poultry_science/profile/logic.dart';
|
||||
import 'package:rasadyar_chicken/presentation/pages/poultry_science/root/logic.dart';
|
||||
import 'package:rasadyar_chicken/presentation/pages/poultry_science/root/view.dart';
|
||||
@@ -157,6 +160,22 @@ sealed class ChickenPages {
|
||||
}),
|
||||
),
|
||||
|
||||
GetPage(
|
||||
name: ChickenRoutes.inspectionPoultryScience,
|
||||
page: () => InspectionPoultrySciencePage(),
|
||||
middlewares: [AuthMiddleware()],
|
||||
binding: BindingsBuilder(() {
|
||||
Get.lazyPut(() => InspectionPoultryScienceLogic());
|
||||
}),
|
||||
),
|
||||
GetPage(
|
||||
name: ChickenRoutes.actionPoultryScience,
|
||||
page: () => PoultryActionPage(),
|
||||
middlewares: [AuthMiddleware()],
|
||||
binding: BindingsBuilder(() {
|
||||
Get.lazyPut(() => PoultryActionLogic());
|
||||
}),
|
||||
),
|
||||
//endregion
|
||||
];
|
||||
}
|
||||
|
||||
@@ -27,5 +27,10 @@ sealed class ChickenRoutes {
|
||||
//region Poultry Science Routes
|
||||
static const _poultryScience = '$_base/poultryScience';
|
||||
static const initPoultryScience = '$_poultryScience/';
|
||||
static const actionPoultryScience = '$_poultryScience/action';
|
||||
static const inspectionPoultryScience = '$_poultryScience/inspection';
|
||||
static const farmPoultryScience = '$_poultryScience/farm';
|
||||
static const activeHatchingPoultryScience = '$_poultryScience/activeHatching';
|
||||
static const killingRegistrationPoultryScience = '$_poultryScience/KillingRegistration';
|
||||
//endregion
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ class RElevated extends StatelessWidget {
|
||||
this.isLoading = false,
|
||||
this.child,
|
||||
this.enabled = true,
|
||||
this.progress = 0.0, // اضافه شد
|
||||
}) : assert(text != null || child != null, 'Either text or child must be provided');
|
||||
|
||||
final String? text;
|
||||
@@ -35,7 +36,7 @@ class RElevated extends StatelessWidget {
|
||||
final TextStyle? textStyle;
|
||||
final bool isLoading;
|
||||
final bool enabled;
|
||||
|
||||
final double progress; // 0.0 تا 1.0
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final bool isEnabled = enabled && !isLoading;
|
||||
@@ -59,6 +60,7 @@ class RElevated extends StatelessWidget {
|
||||
child: CircularProgressIndicator(
|
||||
strokeWidth: 2.5,
|
||||
valueColor: AlwaysStoppedAnimation<Color>(foregroundColor),
|
||||
value: progress > 0.0 && progress <= 1.0 ? progress : null,
|
||||
),
|
||||
)
|
||||
: child ?? Text(text!),
|
||||
|
||||
@@ -6,5 +6,5 @@ void getFileSizeInKB(String filePath, {String? tag}) {
|
||||
final file = File(filePath);
|
||||
final bytes = file.lengthSync();
|
||||
var size = (bytes / 1024).ceil();
|
||||
iLog('${tag ?? 'Picked'} image Size: $size');
|
||||
iLog('${tag ?? 'Picked'} image Size: $size , fileName : ${file.path.split('/').last}');
|
||||
}
|
||||
Reference in New Issue
Block a user