1 - search in map with api
2 - show details in selected location
This commit is contained in:
2025-07-30 12:31:47 +03:30
parent 2806301367
commit f563c6188e
25 changed files with 3960 additions and 337 deletions

View File

@@ -15,6 +15,7 @@ abstract class PoultryLocationModel with _$PoultryLocationModel {
User? user,
List<Hatching>? hatching,
Address? address,
String? breedingUniqueId,
}) = _PoultryLocationModel;
factory PoultryLocationModel.fromJson(Map<String, dynamic> json) =>
@@ -34,13 +35,12 @@ abstract class User with _$User {
@freezed
abstract class Hatching with _$Hatching {
const factory Hatching({
int? quantity,
int? leftOver,
int? period,
int? chickenAge,
DateTime? date,
bool?violation,
bool?archive,
String? licenceNumber,
}) = _Hatching;
factory Hatching.fromJson(Map<String, dynamic> json) =>

View File

@@ -15,7 +15,7 @@ T _$identity<T>(T value) => value;
/// @nodoc
mixin _$PoultryLocationModel {
int? get id; String? get unitName;@JsonKey(name: 'Lat') double? get lat;@JsonKey(name: 'Long') double? get long; User? get user; List<Hatching>? get hatching; Address? get address;
int? get id; String? get unitName;@JsonKey(name: 'Lat') double? get lat;@JsonKey(name: 'Long') double? get long; User? get user; List<Hatching>? get hatching; Address? get address; String? get breedingUniqueId;
/// Create a copy of PoultryLocationModel
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@@ -28,16 +28,16 @@ $PoultryLocationModelCopyWith<PoultryLocationModel> get copyWith => _$PoultryLoc
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is PoultryLocationModel&&(identical(other.id, id) || other.id == id)&&(identical(other.unitName, unitName) || other.unitName == unitName)&&(identical(other.lat, lat) || other.lat == lat)&&(identical(other.long, long) || other.long == long)&&(identical(other.user, user) || other.user == user)&&const DeepCollectionEquality().equals(other.hatching, hatching)&&(identical(other.address, address) || other.address == address));
return identical(this, other) || (other.runtimeType == runtimeType&&other is PoultryLocationModel&&(identical(other.id, id) || other.id == id)&&(identical(other.unitName, unitName) || other.unitName == unitName)&&(identical(other.lat, lat) || other.lat == lat)&&(identical(other.long, long) || other.long == long)&&(identical(other.user, user) || other.user == user)&&const DeepCollectionEquality().equals(other.hatching, hatching)&&(identical(other.address, address) || other.address == address)&&(identical(other.breedingUniqueId, breedingUniqueId) || other.breedingUniqueId == breedingUniqueId));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,id,unitName,lat,long,user,const DeepCollectionEquality().hash(hatching),address);
int get hashCode => Object.hash(runtimeType,id,unitName,lat,long,user,const DeepCollectionEquality().hash(hatching),address,breedingUniqueId);
@override
String toString() {
return 'PoultryLocationModel(id: $id, unitName: $unitName, lat: $lat, long: $long, user: $user, hatching: $hatching, address: $address)';
return 'PoultryLocationModel(id: $id, unitName: $unitName, lat: $lat, long: $long, user: $user, hatching: $hatching, address: $address, breedingUniqueId: $breedingUniqueId)';
}
@@ -48,7 +48,7 @@ abstract mixin class $PoultryLocationModelCopyWith<$Res> {
factory $PoultryLocationModelCopyWith(PoultryLocationModel value, $Res Function(PoultryLocationModel) _then) = _$PoultryLocationModelCopyWithImpl;
@useResult
$Res call({
int? id, String? unitName,@JsonKey(name: 'Lat') double? lat,@JsonKey(name: 'Long') double? long, User? user, List<Hatching>? hatching, Address? address
int? id, String? unitName,@JsonKey(name: 'Lat') double? lat,@JsonKey(name: 'Long') double? long, User? user, List<Hatching>? hatching, Address? address, String? breedingUniqueId
});
@@ -65,7 +65,7 @@ class _$PoultryLocationModelCopyWithImpl<$Res>
/// Create a copy of PoultryLocationModel
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? unitName = freezed,Object? lat = freezed,Object? long = freezed,Object? user = freezed,Object? hatching = freezed,Object? address = freezed,}) {
@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? unitName = freezed,Object? lat = freezed,Object? long = freezed,Object? user = freezed,Object? hatching = freezed,Object? address = freezed,Object? breedingUniqueId = freezed,}) {
return _then(_self.copyWith(
id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as int?,unitName: freezed == unitName ? _self.unitName : unitName // ignore: cast_nullable_to_non_nullable
@@ -74,7 +74,8 @@ as double?,long: freezed == long ? _self.long : long // ignore: cast_nullable_to
as double?,user: freezed == user ? _self.user : user // ignore: cast_nullable_to_non_nullable
as User?,hatching: freezed == hatching ? _self.hatching : hatching // ignore: cast_nullable_to_non_nullable
as List<Hatching>?,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable
as Address?,
as Address?,breedingUniqueId: freezed == breedingUniqueId ? _self.breedingUniqueId : breedingUniqueId // ignore: cast_nullable_to_non_nullable
as String?,
));
}
/// Create a copy of PoultryLocationModel
@@ -183,10 +184,10 @@ return $default(_that);case _:
/// }
/// ```
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( int? id, String? unitName, @JsonKey(name: 'Lat') double? lat, @JsonKey(name: 'Long') double? long, User? user, List<Hatching>? hatching, Address? address)? $default,{required TResult orElse(),}) {final _that = this;
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( int? id, String? unitName, @JsonKey(name: 'Lat') double? lat, @JsonKey(name: 'Long') double? long, User? user, List<Hatching>? hatching, Address? address, String? breedingUniqueId)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _PoultryLocationModel() when $default != null:
return $default(_that.id,_that.unitName,_that.lat,_that.long,_that.user,_that.hatching,_that.address);case _:
return $default(_that.id,_that.unitName,_that.lat,_that.long,_that.user,_that.hatching,_that.address,_that.breedingUniqueId);case _:
return orElse();
}
@@ -204,10 +205,10 @@ return $default(_that.id,_that.unitName,_that.lat,_that.long,_that.user,_that.ha
/// }
/// ```
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( int? id, String? unitName, @JsonKey(name: 'Lat') double? lat, @JsonKey(name: 'Long') double? long, User? user, List<Hatching>? hatching, Address? address) $default,) {final _that = this;
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( int? id, String? unitName, @JsonKey(name: 'Lat') double? lat, @JsonKey(name: 'Long') double? long, User? user, List<Hatching>? hatching, Address? address, String? breedingUniqueId) $default,) {final _that = this;
switch (_that) {
case _PoultryLocationModel():
return $default(_that.id,_that.unitName,_that.lat,_that.long,_that.user,_that.hatching,_that.address);case _:
return $default(_that.id,_that.unitName,_that.lat,_that.long,_that.user,_that.hatching,_that.address,_that.breedingUniqueId);case _:
throw StateError('Unexpected subclass');
}
@@ -224,10 +225,10 @@ return $default(_that.id,_that.unitName,_that.lat,_that.long,_that.user,_that.ha
/// }
/// ```
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( int? id, String? unitName, @JsonKey(name: 'Lat') double? lat, @JsonKey(name: 'Long') double? long, User? user, List<Hatching>? hatching, Address? address)? $default,) {final _that = this;
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( int? id, String? unitName, @JsonKey(name: 'Lat') double? lat, @JsonKey(name: 'Long') double? long, User? user, List<Hatching>? hatching, Address? address, String? breedingUniqueId)? $default,) {final _that = this;
switch (_that) {
case _PoultryLocationModel() when $default != null:
return $default(_that.id,_that.unitName,_that.lat,_that.long,_that.user,_that.hatching,_that.address);case _:
return $default(_that.id,_that.unitName,_that.lat,_that.long,_that.user,_that.hatching,_that.address,_that.breedingUniqueId);case _:
return null;
}
@@ -239,7 +240,7 @@ return $default(_that.id,_that.unitName,_that.lat,_that.long,_that.user,_that.ha
@JsonSerializable()
class _PoultryLocationModel implements PoultryLocationModel {
const _PoultryLocationModel({this.id, this.unitName, @JsonKey(name: 'Lat') this.lat, @JsonKey(name: 'Long') this.long, this.user, final List<Hatching>? hatching, this.address}): _hatching = hatching;
const _PoultryLocationModel({this.id, this.unitName, @JsonKey(name: 'Lat') this.lat, @JsonKey(name: 'Long') this.long, this.user, final List<Hatching>? hatching, this.address, this.breedingUniqueId}): _hatching = hatching;
factory _PoultryLocationModel.fromJson(Map<String, dynamic> json) => _$PoultryLocationModelFromJson(json);
@override final int? id;
@@ -257,6 +258,7 @@ class _PoultryLocationModel implements PoultryLocationModel {
}
@override final Address? address;
@override final String? breedingUniqueId;
/// Create a copy of PoultryLocationModel
/// with the given fields replaced by the non-null parameter values.
@@ -271,16 +273,16 @@ Map<String, dynamic> toJson() {
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _PoultryLocationModel&&(identical(other.id, id) || other.id == id)&&(identical(other.unitName, unitName) || other.unitName == unitName)&&(identical(other.lat, lat) || other.lat == lat)&&(identical(other.long, long) || other.long == long)&&(identical(other.user, user) || other.user == user)&&const DeepCollectionEquality().equals(other._hatching, _hatching)&&(identical(other.address, address) || other.address == address));
return identical(this, other) || (other.runtimeType == runtimeType&&other is _PoultryLocationModel&&(identical(other.id, id) || other.id == id)&&(identical(other.unitName, unitName) || other.unitName == unitName)&&(identical(other.lat, lat) || other.lat == lat)&&(identical(other.long, long) || other.long == long)&&(identical(other.user, user) || other.user == user)&&const DeepCollectionEquality().equals(other._hatching, _hatching)&&(identical(other.address, address) || other.address == address)&&(identical(other.breedingUniqueId, breedingUniqueId) || other.breedingUniqueId == breedingUniqueId));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,id,unitName,lat,long,user,const DeepCollectionEquality().hash(_hatching),address);
int get hashCode => Object.hash(runtimeType,id,unitName,lat,long,user,const DeepCollectionEquality().hash(_hatching),address,breedingUniqueId);
@override
String toString() {
return 'PoultryLocationModel(id: $id, unitName: $unitName, lat: $lat, long: $long, user: $user, hatching: $hatching, address: $address)';
return 'PoultryLocationModel(id: $id, unitName: $unitName, lat: $lat, long: $long, user: $user, hatching: $hatching, address: $address, breedingUniqueId: $breedingUniqueId)';
}
@@ -291,7 +293,7 @@ abstract mixin class _$PoultryLocationModelCopyWith<$Res> implements $PoultryLoc
factory _$PoultryLocationModelCopyWith(_PoultryLocationModel value, $Res Function(_PoultryLocationModel) _then) = __$PoultryLocationModelCopyWithImpl;
@override @useResult
$Res call({
int? id, String? unitName,@JsonKey(name: 'Lat') double? lat,@JsonKey(name: 'Long') double? long, User? user, List<Hatching>? hatching, Address? address
int? id, String? unitName,@JsonKey(name: 'Lat') double? lat,@JsonKey(name: 'Long') double? long, User? user, List<Hatching>? hatching, Address? address, String? breedingUniqueId
});
@@ -308,7 +310,7 @@ class __$PoultryLocationModelCopyWithImpl<$Res>
/// Create a copy of PoultryLocationModel
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? unitName = freezed,Object? lat = freezed,Object? long = freezed,Object? user = freezed,Object? hatching = freezed,Object? address = freezed,}) {
@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? unitName = freezed,Object? lat = freezed,Object? long = freezed,Object? user = freezed,Object? hatching = freezed,Object? address = freezed,Object? breedingUniqueId = freezed,}) {
return _then(_PoultryLocationModel(
id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
as int?,unitName: freezed == unitName ? _self.unitName : unitName // ignore: cast_nullable_to_non_nullable
@@ -317,7 +319,8 @@ as double?,long: freezed == long ? _self.long : long // ignore: cast_nullable_to
as double?,user: freezed == user ? _self.user : user // ignore: cast_nullable_to_non_nullable
as User?,hatching: freezed == hatching ? _self._hatching : hatching // ignore: cast_nullable_to_non_nullable
as List<Hatching>?,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable
as Address?,
as Address?,breedingUniqueId: freezed == breedingUniqueId ? _self.breedingUniqueId : breedingUniqueId // ignore: cast_nullable_to_non_nullable
as String?,
));
}
@@ -618,7 +621,7 @@ as String?,
/// @nodoc
mixin _$Hatching {
int? get quantity; int? get leftOver; int? get period; int? get chickenAge; DateTime? get date; bool? get violation; bool? get archive;
int? get leftOver; int? get chickenAge; DateTime? get date; String? get licenceNumber;
/// Create a copy of Hatching
/// with the given fields replaced by the non-null parameter values.
@JsonKey(includeFromJson: false, includeToJson: false)
@@ -631,16 +634,16 @@ $HatchingCopyWith<Hatching> get copyWith => _$HatchingCopyWithImpl<Hatching>(thi
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is Hatching&&(identical(other.quantity, quantity) || other.quantity == quantity)&&(identical(other.leftOver, leftOver) || other.leftOver == leftOver)&&(identical(other.period, period) || other.period == period)&&(identical(other.chickenAge, chickenAge) || other.chickenAge == chickenAge)&&(identical(other.date, date) || other.date == date)&&(identical(other.violation, violation) || other.violation == violation)&&(identical(other.archive, archive) || other.archive == archive));
return identical(this, other) || (other.runtimeType == runtimeType&&other is Hatching&&(identical(other.leftOver, leftOver) || other.leftOver == leftOver)&&(identical(other.chickenAge, chickenAge) || other.chickenAge == chickenAge)&&(identical(other.date, date) || other.date == date)&&(identical(other.licenceNumber, licenceNumber) || other.licenceNumber == licenceNumber));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,quantity,leftOver,period,chickenAge,date,violation,archive);
int get hashCode => Object.hash(runtimeType,leftOver,chickenAge,date,licenceNumber);
@override
String toString() {
return 'Hatching(quantity: $quantity, leftOver: $leftOver, period: $period, chickenAge: $chickenAge, date: $date, violation: $violation, archive: $archive)';
return 'Hatching(leftOver: $leftOver, chickenAge: $chickenAge, date: $date, licenceNumber: $licenceNumber)';
}
@@ -651,7 +654,7 @@ abstract mixin class $HatchingCopyWith<$Res> {
factory $HatchingCopyWith(Hatching value, $Res Function(Hatching) _then) = _$HatchingCopyWithImpl;
@useResult
$Res call({
int? quantity, int? leftOver, int? period, int? chickenAge, DateTime? date, bool? violation, bool? archive
int? leftOver, int? chickenAge, DateTime? date, String? licenceNumber
});
@@ -668,16 +671,13 @@ class _$HatchingCopyWithImpl<$Res>
/// Create a copy of Hatching
/// with the given fields replaced by the non-null parameter values.
@pragma('vm:prefer-inline') @override $Res call({Object? quantity = freezed,Object? leftOver = freezed,Object? period = freezed,Object? chickenAge = freezed,Object? date = freezed,Object? violation = freezed,Object? archive = freezed,}) {
@pragma('vm:prefer-inline') @override $Res call({Object? leftOver = freezed,Object? chickenAge = freezed,Object? date = freezed,Object? licenceNumber = freezed,}) {
return _then(_self.copyWith(
quantity: freezed == quantity ? _self.quantity : quantity // ignore: cast_nullable_to_non_nullable
as int?,leftOver: freezed == leftOver ? _self.leftOver : leftOver // ignore: cast_nullable_to_non_nullable
as int?,period: freezed == period ? _self.period : period // ignore: cast_nullable_to_non_nullable
leftOver: freezed == leftOver ? _self.leftOver : leftOver // ignore: cast_nullable_to_non_nullable
as int?,chickenAge: freezed == chickenAge ? _self.chickenAge : chickenAge // ignore: cast_nullable_to_non_nullable
as int?,date: freezed == date ? _self.date : date // ignore: cast_nullable_to_non_nullable
as DateTime?,violation: freezed == violation ? _self.violation : violation // ignore: cast_nullable_to_non_nullable
as bool?,archive: freezed == archive ? _self.archive : archive // ignore: cast_nullable_to_non_nullable
as bool?,
as DateTime?,licenceNumber: freezed == licenceNumber ? _self.licenceNumber : licenceNumber // ignore: cast_nullable_to_non_nullable
as String?,
));
}
@@ -762,10 +762,10 @@ return $default(_that);case _:
/// }
/// ```
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( int? quantity, int? leftOver, int? period, int? chickenAge, DateTime? date, bool? violation, bool? archive)? $default,{required TResult orElse(),}) {final _that = this;
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( int? leftOver, int? chickenAge, DateTime? date, String? licenceNumber)? $default,{required TResult orElse(),}) {final _that = this;
switch (_that) {
case _Hatching() when $default != null:
return $default(_that.quantity,_that.leftOver,_that.period,_that.chickenAge,_that.date,_that.violation,_that.archive);case _:
return $default(_that.leftOver,_that.chickenAge,_that.date,_that.licenceNumber);case _:
return orElse();
}
@@ -783,10 +783,10 @@ return $default(_that.quantity,_that.leftOver,_that.period,_that.chickenAge,_tha
/// }
/// ```
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( int? quantity, int? leftOver, int? period, int? chickenAge, DateTime? date, bool? violation, bool? archive) $default,) {final _that = this;
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( int? leftOver, int? chickenAge, DateTime? date, String? licenceNumber) $default,) {final _that = this;
switch (_that) {
case _Hatching():
return $default(_that.quantity,_that.leftOver,_that.period,_that.chickenAge,_that.date,_that.violation,_that.archive);case _:
return $default(_that.leftOver,_that.chickenAge,_that.date,_that.licenceNumber);case _:
throw StateError('Unexpected subclass');
}
@@ -803,10 +803,10 @@ return $default(_that.quantity,_that.leftOver,_that.period,_that.chickenAge,_tha
/// }
/// ```
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( int? quantity, int? leftOver, int? period, int? chickenAge, DateTime? date, bool? violation, bool? archive)? $default,) {final _that = this;
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( int? leftOver, int? chickenAge, DateTime? date, String? licenceNumber)? $default,) {final _that = this;
switch (_that) {
case _Hatching() when $default != null:
return $default(_that.quantity,_that.leftOver,_that.period,_that.chickenAge,_that.date,_that.violation,_that.archive);case _:
return $default(_that.leftOver,_that.chickenAge,_that.date,_that.licenceNumber);case _:
return null;
}
@@ -818,16 +818,13 @@ return $default(_that.quantity,_that.leftOver,_that.period,_that.chickenAge,_tha
@JsonSerializable()
class _Hatching implements Hatching {
const _Hatching({this.quantity, this.leftOver, this.period, this.chickenAge, this.date, this.violation, this.archive});
const _Hatching({this.leftOver, this.chickenAge, this.date, this.licenceNumber});
factory _Hatching.fromJson(Map<String, dynamic> json) => _$HatchingFromJson(json);
@override final int? quantity;
@override final int? leftOver;
@override final int? period;
@override final int? chickenAge;
@override final DateTime? date;
@override final bool? violation;
@override final bool? archive;
@override final String? licenceNumber;
/// Create a copy of Hatching
/// with the given fields replaced by the non-null parameter values.
@@ -842,16 +839,16 @@ Map<String, dynamic> toJson() {
@override
bool operator ==(Object other) {
return identical(this, other) || (other.runtimeType == runtimeType&&other is _Hatching&&(identical(other.quantity, quantity) || other.quantity == quantity)&&(identical(other.leftOver, leftOver) || other.leftOver == leftOver)&&(identical(other.period, period) || other.period == period)&&(identical(other.chickenAge, chickenAge) || other.chickenAge == chickenAge)&&(identical(other.date, date) || other.date == date)&&(identical(other.violation, violation) || other.violation == violation)&&(identical(other.archive, archive) || other.archive == archive));
return identical(this, other) || (other.runtimeType == runtimeType&&other is _Hatching&&(identical(other.leftOver, leftOver) || other.leftOver == leftOver)&&(identical(other.chickenAge, chickenAge) || other.chickenAge == chickenAge)&&(identical(other.date, date) || other.date == date)&&(identical(other.licenceNumber, licenceNumber) || other.licenceNumber == licenceNumber));
}
@JsonKey(includeFromJson: false, includeToJson: false)
@override
int get hashCode => Object.hash(runtimeType,quantity,leftOver,period,chickenAge,date,violation,archive);
int get hashCode => Object.hash(runtimeType,leftOver,chickenAge,date,licenceNumber);
@override
String toString() {
return 'Hatching(quantity: $quantity, leftOver: $leftOver, period: $period, chickenAge: $chickenAge, date: $date, violation: $violation, archive: $archive)';
return 'Hatching(leftOver: $leftOver, chickenAge: $chickenAge, date: $date, licenceNumber: $licenceNumber)';
}
@@ -862,7 +859,7 @@ abstract mixin class _$HatchingCopyWith<$Res> implements $HatchingCopyWith<$Res>
factory _$HatchingCopyWith(_Hatching value, $Res Function(_Hatching) _then) = __$HatchingCopyWithImpl;
@override @useResult
$Res call({
int? quantity, int? leftOver, int? period, int? chickenAge, DateTime? date, bool? violation, bool? archive
int? leftOver, int? chickenAge, DateTime? date, String? licenceNumber
});
@@ -879,16 +876,13 @@ class __$HatchingCopyWithImpl<$Res>
/// Create a copy of Hatching
/// with the given fields replaced by the non-null parameter values.
@override @pragma('vm:prefer-inline') $Res call({Object? quantity = freezed,Object? leftOver = freezed,Object? period = freezed,Object? chickenAge = freezed,Object? date = freezed,Object? violation = freezed,Object? archive = freezed,}) {
@override @pragma('vm:prefer-inline') $Res call({Object? leftOver = freezed,Object? chickenAge = freezed,Object? date = freezed,Object? licenceNumber = freezed,}) {
return _then(_Hatching(
quantity: freezed == quantity ? _self.quantity : quantity // ignore: cast_nullable_to_non_nullable
as int?,leftOver: freezed == leftOver ? _self.leftOver : leftOver // ignore: cast_nullable_to_non_nullable
as int?,period: freezed == period ? _self.period : period // ignore: cast_nullable_to_non_nullable
leftOver: freezed == leftOver ? _self.leftOver : leftOver // ignore: cast_nullable_to_non_nullable
as int?,chickenAge: freezed == chickenAge ? _self.chickenAge : chickenAge // ignore: cast_nullable_to_non_nullable
as int?,date: freezed == date ? _self.date : date // ignore: cast_nullable_to_non_nullable
as DateTime?,violation: freezed == violation ? _self.violation : violation // ignore: cast_nullable_to_non_nullable
as bool?,archive: freezed == archive ? _self.archive : archive // ignore: cast_nullable_to_non_nullable
as bool?,
as DateTime?,licenceNumber: freezed == licenceNumber ? _self.licenceNumber : licenceNumber // ignore: cast_nullable_to_non_nullable
as String?,
));
}

View File

@@ -22,6 +22,7 @@ _PoultryLocationModel _$PoultryLocationModelFromJson(
address: json['address'] == null
? null
: Address.fromJson(json['address'] as Map<String, dynamic>),
breedingUniqueId: json['breeding_unique_id'] as String?,
);
Map<String, dynamic> _$PoultryLocationModelToJson(
@@ -34,6 +35,7 @@ Map<String, dynamic> _$PoultryLocationModelToJson(
'user': instance.user,
'hatching': instance.hatching,
'address': instance.address,
'breeding_unique_id': instance.breedingUniqueId,
};
_User _$UserFromJson(Map<String, dynamic> json) => _User(
@@ -47,23 +49,17 @@ Map<String, dynamic> _$UserToJson(_User instance) => <String, dynamic>{
};
_Hatching _$HatchingFromJson(Map<String, dynamic> json) => _Hatching(
quantity: (json['quantity'] as num?)?.toInt(),
leftOver: (json['left_over'] as num?)?.toInt(),
period: (json['period'] as num?)?.toInt(),
chickenAge: (json['chicken_age'] as num?)?.toInt(),
date: json['date'] == null ? null : DateTime.parse(json['date'] as String),
violation: json['violation'] as bool?,
archive: json['archive'] as bool?,
licenceNumber: json['licence_number'] as String?,
);
Map<String, dynamic> _$HatchingToJson(_Hatching instance) => <String, dynamic>{
'quantity': instance.quantity,
'left_over': instance.leftOver,
'period': instance.period,
'chicken_age': instance.chickenAge,
'date': instance.date?.toIso8601String(),
'violation': instance.violation,
'archive': instance.archive,
'licence_number': instance.licenceNumber,
};
_Address _$AddressFromJson(Map<String, dynamic> json) => _Address(