refactor : rename files and update routes for poultry actions
feat : poultry kill registration and poultry OrderList ** Made With Nima **
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
part 'all_poultry.freezed.dart';
|
||||
part 'all_poultry.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class AllPoultry with _$AllPoultry {
|
||||
const factory AllPoultry({
|
||||
User? user,
|
||||
String? key,
|
||||
String? unitName,
|
||||
Address? address,
|
||||
int? lastHatchingRemainQuantity,
|
||||
bool? provinceAllowSellFree,
|
||||
ChainCompany? chainCompany,
|
||||
}) = _AllPoultry;
|
||||
|
||||
factory AllPoultry.fromJson(Map<String, dynamic> json) =>
|
||||
_$AllPoultryFromJson(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 Address with _$Address {
|
||||
const factory Address({
|
||||
City? city,
|
||||
}) = _Address;
|
||||
|
||||
factory Address.fromJson(Map<String, dynamic> json) =>
|
||||
_$AddressFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class City with _$City {
|
||||
const factory City({
|
||||
String? name,
|
||||
}) = _City;
|
||||
|
||||
factory City.fromJson(Map<String, dynamic> json) => _$CityFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class ChainCompany with _$ChainCompany {
|
||||
const factory ChainCompany({
|
||||
bool? chainCompany,
|
||||
String? hatchingKey,
|
||||
}) = _ChainCompany;
|
||||
|
||||
factory ChainCompany.fromJson(Map<String, dynamic> json) =>
|
||||
_$ChainCompanyFromJson(json);
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,74 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'all_poultry.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_AllPoultry _$AllPoultryFromJson(Map<String, dynamic> json) => _AllPoultry(
|
||||
user: json['user'] == null
|
||||
? null
|
||||
: User.fromJson(json['user'] as Map<String, dynamic>),
|
||||
key: json['key'] as String?,
|
||||
unitName: json['unit_name'] as String?,
|
||||
address: json['address'] == null
|
||||
? null
|
||||
: Address.fromJson(json['address'] as Map<String, dynamic>),
|
||||
lastHatchingRemainQuantity: (json['last_hatching_remain_quantity'] as num?)
|
||||
?.toInt(),
|
||||
provinceAllowSellFree: json['province_allow_sell_free'] as bool?,
|
||||
chainCompany: json['chain_company'] == null
|
||||
? null
|
||||
: ChainCompany.fromJson(json['chain_company'] as Map<String, dynamic>),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$AllPoultryToJson(_AllPoultry instance) =>
|
||||
<String, dynamic>{
|
||||
'user': instance.user,
|
||||
'key': instance.key,
|
||||
'unit_name': instance.unitName,
|
||||
'address': instance.address,
|
||||
'last_hatching_remain_quantity': instance.lastHatchingRemainQuantity,
|
||||
'province_allow_sell_free': instance.provinceAllowSellFree,
|
||||
'chain_company': instance.chainCompany,
|
||||
};
|
||||
|
||||
_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,
|
||||
};
|
||||
|
||||
_Address _$AddressFromJson(Map<String, dynamic> json) => _Address(
|
||||
city: json['city'] == null
|
||||
? null
|
||||
: City.fromJson(json['city'] as Map<String, dynamic>),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$AddressToJson(_Address instance) => <String, dynamic>{
|
||||
'city': instance.city,
|
||||
};
|
||||
|
||||
_City _$CityFromJson(Map<String, dynamic> json) =>
|
||||
_City(name: json['name'] as String?);
|
||||
|
||||
Map<String, dynamic> _$CityToJson(_City instance) => <String, dynamic>{
|
||||
'name': instance.name,
|
||||
};
|
||||
|
||||
_ChainCompany _$ChainCompanyFromJson(Map<String, dynamic> json) =>
|
||||
_ChainCompany(
|
||||
chainCompany: json['chain_company'] as bool?,
|
||||
hatchingKey: json['hatching_key'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ChainCompanyToJson(_ChainCompany instance) =>
|
||||
<String, dynamic>{
|
||||
'chain_company': instance.chainCompany,
|
||||
'hatching_key': instance.hatchingKey,
|
||||
};
|
||||
Reference in New Issue
Block a user