feat : sale in the province
This commit is contained in:
@@ -6,84 +6,71 @@ part 'allocated_made.g.dart';
|
|||||||
@freezed
|
@freezed
|
||||||
abstract class AllocatedMadeModel with _$AllocatedMadeModel {
|
abstract class AllocatedMadeModel with _$AllocatedMadeModel {
|
||||||
factory AllocatedMadeModel({
|
factory AllocatedMadeModel({
|
||||||
int? count,
|
int? id,
|
||||||
String? next,
|
Product? product,
|
||||||
String? previous,
|
dynamic killHouse,
|
||||||
List<AllocatedMadeResult>? results,
|
dynamic toKillHouse,
|
||||||
|
Steward? steward,
|
||||||
|
dynamic toSteward,
|
||||||
|
dynamic guilds,
|
||||||
|
Steward? toGuilds,
|
||||||
|
dynamic toColdHouse,
|
||||||
|
int? indexWeight,
|
||||||
|
int? dateTimestamp,
|
||||||
|
int? newState,
|
||||||
|
int? newReceiverState,
|
||||||
|
int? newAllocationState,
|
||||||
|
String? key,
|
||||||
|
String? createDate,
|
||||||
|
String? modifyDate,
|
||||||
|
bool? trash,
|
||||||
|
int? numberOfCarcasses,
|
||||||
|
int? realNumberOfCarcasses,
|
||||||
|
int? receiverRealNumberOfCarcasses,
|
||||||
|
int? weightOfCarcasses,
|
||||||
|
int? realWeightOfCarcasses,
|
||||||
|
int? receiverRealWeightOfCarcasses,
|
||||||
|
int? weightLossOfCarcasses,
|
||||||
|
bool? finalRegistration,
|
||||||
|
String? sellType,
|
||||||
|
String? productName,
|
||||||
|
String? sellerType,
|
||||||
|
String? type,
|
||||||
|
String? saleType,
|
||||||
|
String? allocationType,
|
||||||
|
bool? systemRegistrationCode,
|
||||||
|
int? registrationCode,
|
||||||
|
int? amount,
|
||||||
|
int? totalAmount,
|
||||||
|
int? totalAmountPaid,
|
||||||
|
int? totalAmountRemain,
|
||||||
|
String? loggedRegistrationCode,
|
||||||
|
String? state,
|
||||||
|
String? receiverState,
|
||||||
|
String? allocationState,
|
||||||
|
String? date,
|
||||||
|
String? role,
|
||||||
|
String? stewardTempKey,
|
||||||
|
bool? approvedPriceStatus,
|
||||||
|
bool? calculateStatus,
|
||||||
|
bool? temporaryTrash,
|
||||||
|
bool? temporaryDeleted,
|
||||||
|
String? createdBy,
|
||||||
|
String? modifiedBy,
|
||||||
|
dynamic wareHouse,
|
||||||
|
dynamic stewardWareHouse,
|
||||||
|
dynamic car,
|
||||||
|
dynamic dispenser,
|
||||||
}) = _AllocatedMadeModel;
|
}) = _AllocatedMadeModel;
|
||||||
|
|
||||||
factory AllocatedMadeModel.fromJson(Map<String, dynamic> json) =>
|
factory AllocatedMadeModel.fromJson(Map<String, dynamic> json) =>
|
||||||
_$AllocatedMadeModelFromJson(json);
|
_$AllocatedMadeModelFromJson(json);
|
||||||
}
|
}
|
||||||
|
|
||||||
@freezed
|
|
||||||
abstract class AllocatedMadeResult with _$AllocatedMadeResult {
|
|
||||||
factory AllocatedMadeResult({
|
|
||||||
int? id,
|
|
||||||
Product? product,
|
|
||||||
dynamic kill_house,
|
|
||||||
dynamic to_kill_house,
|
|
||||||
Steward? steward,
|
|
||||||
dynamic to_steward,
|
|
||||||
dynamic guilds,
|
|
||||||
Steward? to_guilds,
|
|
||||||
dynamic to_cold_house,
|
|
||||||
int? index_weight,
|
|
||||||
int? date_timestamp,
|
|
||||||
int? new_state,
|
|
||||||
int? new_receiver_state,
|
|
||||||
int? new_allocation_state,
|
|
||||||
String? key,
|
|
||||||
String? create_date,
|
|
||||||
String? modify_date,
|
|
||||||
bool? trash,
|
|
||||||
int? number_of_carcasses,
|
|
||||||
int? real_number_of_carcasses,
|
|
||||||
int? receiver_real_number_of_carcasses,
|
|
||||||
int? weight_of_carcasses,
|
|
||||||
int? real_weight_of_carcasses,
|
|
||||||
int? receiver_real_weight_of_carcasses,
|
|
||||||
int? weight_loss_of_carcasses,
|
|
||||||
bool? final_registration,
|
|
||||||
String? sell_type,
|
|
||||||
String? product_name,
|
|
||||||
String? seller_type,
|
|
||||||
String? type,
|
|
||||||
String? sale_type,
|
|
||||||
String? allocation_type,
|
|
||||||
bool? system_registration_code,
|
|
||||||
int? registration_code,
|
|
||||||
int? amount,
|
|
||||||
int? total_amount,
|
|
||||||
int? total_amount_paid,
|
|
||||||
int? total_amount_remain,
|
|
||||||
String? logged_registration_code,
|
|
||||||
String? state,
|
|
||||||
String? receiver_state,
|
|
||||||
String? allocation_state,
|
|
||||||
String? date,
|
|
||||||
String? role,
|
|
||||||
String? steward_temp_key,
|
|
||||||
bool? approved_price_status,
|
|
||||||
bool? calculate_status,
|
|
||||||
bool? temporary_trash,
|
|
||||||
bool? temporary_deleted,
|
|
||||||
String? created_by,
|
|
||||||
String? modified_by,
|
|
||||||
dynamic ware_house,
|
|
||||||
dynamic steward_ware_house,
|
|
||||||
dynamic car,
|
|
||||||
dynamic dispenser,
|
|
||||||
}) = _AllocatedMadeResult;
|
|
||||||
|
|
||||||
factory AllocatedMadeResult.fromJson(Map<String, dynamic> json) =>
|
|
||||||
_$AllocatedMadeResultFromJson(json);
|
|
||||||
}
|
|
||||||
|
|
||||||
@freezed
|
@freezed
|
||||||
abstract class Product with _$Product {
|
abstract class Product with _$Product {
|
||||||
factory Product({
|
factory Product({
|
||||||
int? weight_average,
|
int? weightAverage,
|
||||||
}) = _Product;
|
}) = _Product;
|
||||||
|
|
||||||
factory Product.fromJson(Map<String, dynamic> json) =>
|
factory Product.fromJson(Map<String, dynamic> json) =>
|
||||||
@@ -96,68 +83,68 @@ abstract class Steward with _$Steward {
|
|||||||
int? id,
|
int? id,
|
||||||
User? user,
|
User? user,
|
||||||
Address? address,
|
Address? address,
|
||||||
Activity? guild_area_activity,
|
Activity? guildAreaActivity,
|
||||||
Activity? guild_type_activity,
|
Activity? guildTypeActivity,
|
||||||
List<dynamic>? kill_house,
|
List<dynamic>? killHouse,
|
||||||
List<dynamic>? steward_kill_house,
|
List<dynamic>? stewardKillHouse,
|
||||||
List<dynamic>? stewards,
|
List<dynamic>? stewards,
|
||||||
PosStatus? get_pos_status,
|
PosStatus? getPosStatus,
|
||||||
String? key,
|
String? key,
|
||||||
String? create_date,
|
String? createDate,
|
||||||
String? modify_date,
|
String? modifyDate,
|
||||||
bool? trash,
|
bool? trash,
|
||||||
dynamic user_id_foreign_key,
|
dynamic userIdForeignKey,
|
||||||
dynamic address_id_foreign_key,
|
dynamic addressIdForeignKey,
|
||||||
dynamic user_bank_id_foreign_key,
|
dynamic userBankIdForeignKey,
|
||||||
dynamic wallet_id_foreign_key,
|
dynamic walletIdForeignKey,
|
||||||
dynamic provincial_government_id_key,
|
dynamic provincialGovernmentIdKey,
|
||||||
dynamic identity_documents,
|
dynamic identityDocuments,
|
||||||
bool? active,
|
bool? active,
|
||||||
int? city_number,
|
int? cityNumber,
|
||||||
String? city_name,
|
String? cityName,
|
||||||
String? guilds_id,
|
String? guildsId,
|
||||||
String? license_number,
|
String? licenseNumber,
|
||||||
String? guilds_name,
|
String? guildsName,
|
||||||
String? phone,
|
String? phone,
|
||||||
String? type_activity,
|
String? typeActivity,
|
||||||
String? area_activity,
|
String? areaActivity,
|
||||||
int? province_number,
|
int? provinceNumber,
|
||||||
String? province_name,
|
String? provinceName,
|
||||||
bool? steward,
|
bool? steward,
|
||||||
bool? has_pos,
|
bool? hasPos,
|
||||||
dynamic centers_allocation,
|
dynamic centersAllocation,
|
||||||
dynamic kill_house_centers_allocation,
|
dynamic killHouseCentersAllocation,
|
||||||
dynamic allocation_limit,
|
dynamic allocationLimit,
|
||||||
bool? limitation_allocation,
|
bool? limitationAllocation,
|
||||||
String? registerar_role,
|
String? registerarRole,
|
||||||
String? registerar_fullname,
|
String? registerarFullname,
|
||||||
String? registerar_mobile,
|
String? registerarMobile,
|
||||||
bool? kill_house_register,
|
bool? killHouseRegister,
|
||||||
bool? steward_register,
|
bool? stewardRegister,
|
||||||
bool? guilds_room_register,
|
bool? guildsRoomRegister,
|
||||||
bool? pos_company_register,
|
bool? posCompanyRegister,
|
||||||
String? province_accept_state,
|
String? provinceAcceptState,
|
||||||
String? province_message,
|
String? provinceMessage,
|
||||||
String? condition,
|
String? condition,
|
||||||
String? description_condition,
|
String? descriptionCondition,
|
||||||
bool? steward_active,
|
bool? stewardActive,
|
||||||
dynamic steward_allocation_limit,
|
dynamic stewardAllocationLimit,
|
||||||
bool? steward_limitation_allocation,
|
bool? stewardLimitationAllocation,
|
||||||
bool? license,
|
bool? license,
|
||||||
dynamic license_form,
|
dynamic licenseForm,
|
||||||
dynamic license_file,
|
dynamic licenseFile,
|
||||||
String? reviewer_role,
|
String? reviewerRole,
|
||||||
String? reviewer_fullname,
|
String? reviewerFullname,
|
||||||
String? reviewer_mobile,
|
String? reviewerMobile,
|
||||||
String? checker_message,
|
String? checkerMessage,
|
||||||
bool? final_accept,
|
bool? finalAccept,
|
||||||
bool? temporary_registration,
|
bool? temporaryRegistration,
|
||||||
String? created_by,
|
String? createdBy,
|
||||||
String? modified_by,
|
String? modifiedBy,
|
||||||
dynamic user_bank_info,
|
dynamic userBankInfo,
|
||||||
int? wallet,
|
int? wallet,
|
||||||
List<dynamic>? cars,
|
List<dynamic>? cars,
|
||||||
List<dynamic>? user_level,
|
List<dynamic>? userLevel,
|
||||||
}) = _Steward;
|
}) = _Steward;
|
||||||
|
|
||||||
factory Steward.fromJson(Map<String, dynamic> json) =>
|
factory Steward.fromJson(Map<String, dynamic> json) =>
|
||||||
@@ -168,10 +155,10 @@ abstract class Steward with _$Steward {
|
|||||||
abstract class User with _$User {
|
abstract class User with _$User {
|
||||||
factory User({
|
factory User({
|
||||||
String? fullname,
|
String? fullname,
|
||||||
String? first_name,
|
String? firstName,
|
||||||
String? last_name,
|
String? lastName,
|
||||||
String? mobile,
|
String? mobile,
|
||||||
String? national_id,
|
String? nationalId,
|
||||||
String? city,
|
String? city,
|
||||||
}) = _User;
|
}) = _User;
|
||||||
|
|
||||||
@@ -185,7 +172,7 @@ abstract class Address with _$Address {
|
|||||||
Province? province,
|
Province? province,
|
||||||
Province? city,
|
Province? city,
|
||||||
String? address,
|
String? address,
|
||||||
String? postal_code,
|
String? postalCode,
|
||||||
}) = _Address;
|
}) = _Address;
|
||||||
|
|
||||||
factory Address.fromJson(Map<String, dynamic> json) =>
|
factory Address.fromJson(Map<String, dynamic> json) =>
|
||||||
@@ -217,9 +204,9 @@ abstract class Activity with _$Activity {
|
|||||||
@freezed
|
@freezed
|
||||||
abstract class PosStatus with _$PosStatus {
|
abstract class PosStatus with _$PosStatus {
|
||||||
factory PosStatus({
|
factory PosStatus({
|
||||||
int? len_active_sessions,
|
int? lenActiveSessions,
|
||||||
bool? has_pons,
|
bool? hasPons,
|
||||||
bool? has_active_pons,
|
bool? hasActivePons,
|
||||||
}) = _PosStatus;
|
}) = _PosStatus;
|
||||||
|
|
||||||
factory PosStatus.fromJson(Map<String, dynamic> json) =>
|
factory PosStatus.fromJson(Map<String, dynamic> json) =>
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -6,159 +6,139 @@ part of 'allocated_made.dart';
|
|||||||
// JsonSerializableGenerator
|
// JsonSerializableGenerator
|
||||||
// **************************************************************************
|
// **************************************************************************
|
||||||
|
|
||||||
_AllocatedMadeModel _$AllocatedMadeModelFromJson(Map<String, dynamic> json) =>
|
_AllocatedMadeModel _$AllocatedMadeModelFromJson(
|
||||||
_AllocatedMadeModel(
|
|
||||||
count: (json['count'] as num?)?.toInt(),
|
|
||||||
next: json['next'] as String?,
|
|
||||||
previous: json['previous'] as String?,
|
|
||||||
results: (json['results'] as List<dynamic>?)
|
|
||||||
?.map((e) => AllocatedMadeResult.fromJson(e as Map<String, dynamic>))
|
|
||||||
.toList(),
|
|
||||||
);
|
|
||||||
|
|
||||||
Map<String, dynamic> _$AllocatedMadeModelToJson(_AllocatedMadeModel instance) =>
|
|
||||||
<String, dynamic>{
|
|
||||||
'count': instance.count,
|
|
||||||
'next': instance.next,
|
|
||||||
'previous': instance.previous,
|
|
||||||
'results': instance.results,
|
|
||||||
};
|
|
||||||
|
|
||||||
_AllocatedMadeResult _$AllocatedMadeResultFromJson(
|
|
||||||
Map<String, dynamic> json,
|
Map<String, dynamic> json,
|
||||||
) => _AllocatedMadeResult(
|
) => _AllocatedMadeModel(
|
||||||
id: (json['id'] as num?)?.toInt(),
|
id: (json['id'] as num?)?.toInt(),
|
||||||
product: json['product'] == null
|
product: json['product'] == null
|
||||||
? null
|
? null
|
||||||
: Product.fromJson(json['product'] as Map<String, dynamic>),
|
: Product.fromJson(json['product'] as Map<String, dynamic>),
|
||||||
kill_house: json['kill_house'],
|
killHouse: json['kill_house'],
|
||||||
to_kill_house: json['to_kill_house'],
|
toKillHouse: json['to_kill_house'],
|
||||||
steward: json['steward'] == null
|
steward: json['steward'] == null
|
||||||
? null
|
? null
|
||||||
: Steward.fromJson(json['steward'] as Map<String, dynamic>),
|
: Steward.fromJson(json['steward'] as Map<String, dynamic>),
|
||||||
to_steward: json['to_steward'],
|
toSteward: json['to_steward'],
|
||||||
guilds: json['guilds'],
|
guilds: json['guilds'],
|
||||||
to_guilds: json['to_guilds'] == null
|
toGuilds: json['to_guilds'] == null
|
||||||
? null
|
? null
|
||||||
: Steward.fromJson(json['to_guilds'] as Map<String, dynamic>),
|
: Steward.fromJson(json['to_guilds'] as Map<String, dynamic>),
|
||||||
to_cold_house: json['to_cold_house'],
|
toColdHouse: json['to_cold_house'],
|
||||||
index_weight: (json['index_weight'] as num?)?.toInt(),
|
indexWeight: (json['index_weight'] as num?)?.toInt(),
|
||||||
date_timestamp: (json['date_timestamp'] as num?)?.toInt(),
|
dateTimestamp: (json['date_timestamp'] as num?)?.toInt(),
|
||||||
new_state: (json['new_state'] as num?)?.toInt(),
|
newState: (json['new_state'] as num?)?.toInt(),
|
||||||
new_receiver_state: (json['new_receiver_state'] as num?)?.toInt(),
|
newReceiverState: (json['new_receiver_state'] as num?)?.toInt(),
|
||||||
new_allocation_state: (json['new_allocation_state'] as num?)?.toInt(),
|
newAllocationState: (json['new_allocation_state'] as num?)?.toInt(),
|
||||||
key: json['key'] as String?,
|
key: json['key'] as String?,
|
||||||
create_date: json['create_date'] as String?,
|
createDate: json['create_date'] as String?,
|
||||||
modify_date: json['modify_date'] as String?,
|
modifyDate: json['modify_date'] as String?,
|
||||||
trash: json['trash'] as bool?,
|
trash: json['trash'] as bool?,
|
||||||
number_of_carcasses: (json['number_of_carcasses'] as num?)?.toInt(),
|
numberOfCarcasses: (json['number_of_carcasses'] as num?)?.toInt(),
|
||||||
real_number_of_carcasses: (json['real_number_of_carcasses'] as num?)?.toInt(),
|
realNumberOfCarcasses: (json['real_number_of_carcasses'] as num?)?.toInt(),
|
||||||
receiver_real_number_of_carcasses:
|
receiverRealNumberOfCarcasses:
|
||||||
(json['receiver_real_number_of_carcasses'] as num?)?.toInt(),
|
(json['receiver_real_number_of_carcasses'] as num?)?.toInt(),
|
||||||
weight_of_carcasses: (json['weight_of_carcasses'] as num?)?.toInt(),
|
weightOfCarcasses: (json['weight_of_carcasses'] as num?)?.toInt(),
|
||||||
real_weight_of_carcasses: (json['real_weight_of_carcasses'] as num?)?.toInt(),
|
realWeightOfCarcasses: (json['real_weight_of_carcasses'] as num?)?.toInt(),
|
||||||
receiver_real_weight_of_carcasses:
|
receiverRealWeightOfCarcasses:
|
||||||
(json['receiver_real_weight_of_carcasses'] as num?)?.toInt(),
|
(json['receiver_real_weight_of_carcasses'] as num?)?.toInt(),
|
||||||
weight_loss_of_carcasses: (json['weight_loss_of_carcasses'] as num?)?.toInt(),
|
weightLossOfCarcasses: (json['weight_loss_of_carcasses'] as num?)?.toInt(),
|
||||||
final_registration: json['final_registration'] as bool?,
|
finalRegistration: json['final_registration'] as bool?,
|
||||||
sell_type: json['sell_type'] as String?,
|
sellType: json['sell_type'] as String?,
|
||||||
product_name: json['product_name'] as String?,
|
productName: json['product_name'] as String?,
|
||||||
seller_type: json['seller_type'] as String?,
|
sellerType: json['seller_type'] as String?,
|
||||||
type: json['type'] as String?,
|
type: json['type'] as String?,
|
||||||
sale_type: json['sale_type'] as String?,
|
saleType: json['sale_type'] as String?,
|
||||||
allocation_type: json['allocation_type'] as String?,
|
allocationType: json['allocation_type'] as String?,
|
||||||
system_registration_code: json['system_registration_code'] as bool?,
|
systemRegistrationCode: json['system_registration_code'] as bool?,
|
||||||
registration_code: (json['registration_code'] as num?)?.toInt(),
|
registrationCode: (json['registration_code'] as num?)?.toInt(),
|
||||||
amount: (json['amount'] as num?)?.toInt(),
|
amount: (json['amount'] as num?)?.toInt(),
|
||||||
total_amount: (json['total_amount'] as num?)?.toInt(),
|
totalAmount: (json['total_amount'] as num?)?.toInt(),
|
||||||
total_amount_paid: (json['total_amount_paid'] as num?)?.toInt(),
|
totalAmountPaid: (json['total_amount_paid'] as num?)?.toInt(),
|
||||||
total_amount_remain: (json['total_amount_remain'] as num?)?.toInt(),
|
totalAmountRemain: (json['total_amount_remain'] as num?)?.toInt(),
|
||||||
logged_registration_code: json['logged_registration_code'] as String?,
|
loggedRegistrationCode: json['logged_registration_code'] as String?,
|
||||||
state: json['state'] as String?,
|
state: json['state'] as String?,
|
||||||
receiver_state: json['receiver_state'] as String?,
|
receiverState: json['receiver_state'] as String?,
|
||||||
allocation_state: json['allocation_state'] as String?,
|
allocationState: json['allocation_state'] as String?,
|
||||||
date: json['date'] as String?,
|
date: json['date'] as String?,
|
||||||
role: json['role'] as String?,
|
role: json['role'] as String?,
|
||||||
steward_temp_key: json['steward_temp_key'] as String?,
|
stewardTempKey: json['steward_temp_key'] as String?,
|
||||||
approved_price_status: json['approved_price_status'] as bool?,
|
approvedPriceStatus: json['approved_price_status'] as bool?,
|
||||||
calculate_status: json['calculate_status'] as bool?,
|
calculateStatus: json['calculate_status'] as bool?,
|
||||||
temporary_trash: json['temporary_trash'] as bool?,
|
temporaryTrash: json['temporary_trash'] as bool?,
|
||||||
temporary_deleted: json['temporary_deleted'] as bool?,
|
temporaryDeleted: json['temporary_deleted'] as bool?,
|
||||||
created_by: json['created_by'] as String?,
|
createdBy: json['created_by'] as String?,
|
||||||
modified_by: json['modified_by'] as String?,
|
modifiedBy: json['modified_by'] as String?,
|
||||||
ware_house: json['ware_house'],
|
wareHouse: json['ware_house'],
|
||||||
steward_ware_house: json['steward_ware_house'],
|
stewardWareHouse: json['steward_ware_house'],
|
||||||
car: json['car'],
|
car: json['car'],
|
||||||
dispenser: json['dispenser'],
|
dispenser: json['dispenser'],
|
||||||
);
|
);
|
||||||
|
|
||||||
Map<String, dynamic> _$AllocatedMadeResultToJson(
|
Map<String, dynamic> _$AllocatedMadeModelToJson(
|
||||||
_AllocatedMadeResult instance,
|
_AllocatedMadeModel instance,
|
||||||
) => <String, dynamic>{
|
) => <String, dynamic>{
|
||||||
'id': instance.id,
|
'id': instance.id,
|
||||||
'product': instance.product,
|
'product': instance.product,
|
||||||
'kill_house': instance.kill_house,
|
'kill_house': instance.killHouse,
|
||||||
'to_kill_house': instance.to_kill_house,
|
'to_kill_house': instance.toKillHouse,
|
||||||
'steward': instance.steward,
|
'steward': instance.steward,
|
||||||
'to_steward': instance.to_steward,
|
'to_steward': instance.toSteward,
|
||||||
'guilds': instance.guilds,
|
'guilds': instance.guilds,
|
||||||
'to_guilds': instance.to_guilds,
|
'to_guilds': instance.toGuilds,
|
||||||
'to_cold_house': instance.to_cold_house,
|
'to_cold_house': instance.toColdHouse,
|
||||||
'index_weight': instance.index_weight,
|
'index_weight': instance.indexWeight,
|
||||||
'date_timestamp': instance.date_timestamp,
|
'date_timestamp': instance.dateTimestamp,
|
||||||
'new_state': instance.new_state,
|
'new_state': instance.newState,
|
||||||
'new_receiver_state': instance.new_receiver_state,
|
'new_receiver_state': instance.newReceiverState,
|
||||||
'new_allocation_state': instance.new_allocation_state,
|
'new_allocation_state': instance.newAllocationState,
|
||||||
'key': instance.key,
|
'key': instance.key,
|
||||||
'create_date': instance.create_date,
|
'create_date': instance.createDate,
|
||||||
'modify_date': instance.modify_date,
|
'modify_date': instance.modifyDate,
|
||||||
'trash': instance.trash,
|
'trash': instance.trash,
|
||||||
'number_of_carcasses': instance.number_of_carcasses,
|
'number_of_carcasses': instance.numberOfCarcasses,
|
||||||
'real_number_of_carcasses': instance.real_number_of_carcasses,
|
'real_number_of_carcasses': instance.realNumberOfCarcasses,
|
||||||
'receiver_real_number_of_carcasses':
|
'receiver_real_number_of_carcasses': instance.receiverRealNumberOfCarcasses,
|
||||||
instance.receiver_real_number_of_carcasses,
|
'weight_of_carcasses': instance.weightOfCarcasses,
|
||||||
'weight_of_carcasses': instance.weight_of_carcasses,
|
'real_weight_of_carcasses': instance.realWeightOfCarcasses,
|
||||||
'real_weight_of_carcasses': instance.real_weight_of_carcasses,
|
'receiver_real_weight_of_carcasses': instance.receiverRealWeightOfCarcasses,
|
||||||
'receiver_real_weight_of_carcasses':
|
'weight_loss_of_carcasses': instance.weightLossOfCarcasses,
|
||||||
instance.receiver_real_weight_of_carcasses,
|
'final_registration': instance.finalRegistration,
|
||||||
'weight_loss_of_carcasses': instance.weight_loss_of_carcasses,
|
'sell_type': instance.sellType,
|
||||||
'final_registration': instance.final_registration,
|
'product_name': instance.productName,
|
||||||
'sell_type': instance.sell_type,
|
'seller_type': instance.sellerType,
|
||||||
'product_name': instance.product_name,
|
|
||||||
'seller_type': instance.seller_type,
|
|
||||||
'type': instance.type,
|
'type': instance.type,
|
||||||
'sale_type': instance.sale_type,
|
'sale_type': instance.saleType,
|
||||||
'allocation_type': instance.allocation_type,
|
'allocation_type': instance.allocationType,
|
||||||
'system_registration_code': instance.system_registration_code,
|
'system_registration_code': instance.systemRegistrationCode,
|
||||||
'registration_code': instance.registration_code,
|
'registration_code': instance.registrationCode,
|
||||||
'amount': instance.amount,
|
'amount': instance.amount,
|
||||||
'total_amount': instance.total_amount,
|
'total_amount': instance.totalAmount,
|
||||||
'total_amount_paid': instance.total_amount_paid,
|
'total_amount_paid': instance.totalAmountPaid,
|
||||||
'total_amount_remain': instance.total_amount_remain,
|
'total_amount_remain': instance.totalAmountRemain,
|
||||||
'logged_registration_code': instance.logged_registration_code,
|
'logged_registration_code': instance.loggedRegistrationCode,
|
||||||
'state': instance.state,
|
'state': instance.state,
|
||||||
'receiver_state': instance.receiver_state,
|
'receiver_state': instance.receiverState,
|
||||||
'allocation_state': instance.allocation_state,
|
'allocation_state': instance.allocationState,
|
||||||
'date': instance.date,
|
'date': instance.date,
|
||||||
'role': instance.role,
|
'role': instance.role,
|
||||||
'steward_temp_key': instance.steward_temp_key,
|
'steward_temp_key': instance.stewardTempKey,
|
||||||
'approved_price_status': instance.approved_price_status,
|
'approved_price_status': instance.approvedPriceStatus,
|
||||||
'calculate_status': instance.calculate_status,
|
'calculate_status': instance.calculateStatus,
|
||||||
'temporary_trash': instance.temporary_trash,
|
'temporary_trash': instance.temporaryTrash,
|
||||||
'temporary_deleted': instance.temporary_deleted,
|
'temporary_deleted': instance.temporaryDeleted,
|
||||||
'created_by': instance.created_by,
|
'created_by': instance.createdBy,
|
||||||
'modified_by': instance.modified_by,
|
'modified_by': instance.modifiedBy,
|
||||||
'ware_house': instance.ware_house,
|
'ware_house': instance.wareHouse,
|
||||||
'steward_ware_house': instance.steward_ware_house,
|
'steward_ware_house': instance.stewardWareHouse,
|
||||||
'car': instance.car,
|
'car': instance.car,
|
||||||
'dispenser': instance.dispenser,
|
'dispenser': instance.dispenser,
|
||||||
};
|
};
|
||||||
|
|
||||||
_Product _$ProductFromJson(Map<String, dynamic> json) =>
|
_Product _$ProductFromJson(Map<String, dynamic> json) =>
|
||||||
_Product(weight_average: (json['weight_average'] as num?)?.toInt());
|
_Product(weightAverage: (json['weight_average'] as num?)?.toInt());
|
||||||
|
|
||||||
Map<String, dynamic> _$ProductToJson(_Product instance) => <String, dynamic>{
|
Map<String, dynamic> _$ProductToJson(_Product instance) => <String, dynamic>{
|
||||||
'weight_average': instance.weight_average,
|
'weight_average': instance.weightAverage,
|
||||||
};
|
};
|
||||||
|
|
||||||
_Steward _$StewardFromJson(Map<String, dynamic> json) => _Steward(
|
_Steward _$StewardFromJson(Map<String, dynamic> json) => _Steward(
|
||||||
@@ -169,159 +149,159 @@ _Steward _$StewardFromJson(Map<String, dynamic> json) => _Steward(
|
|||||||
address: json['address'] == null
|
address: json['address'] == null
|
||||||
? null
|
? null
|
||||||
: Address.fromJson(json['address'] as Map<String, dynamic>),
|
: Address.fromJson(json['address'] as Map<String, dynamic>),
|
||||||
guild_area_activity: json['guild_area_activity'] == null
|
guildAreaActivity: json['guild_area_activity'] == null
|
||||||
? null
|
? null
|
||||||
: Activity.fromJson(json['guild_area_activity'] as Map<String, dynamic>),
|
: Activity.fromJson(json['guild_area_activity'] as Map<String, dynamic>),
|
||||||
guild_type_activity: json['guild_type_activity'] == null
|
guildTypeActivity: json['guild_type_activity'] == null
|
||||||
? null
|
? null
|
||||||
: Activity.fromJson(json['guild_type_activity'] as Map<String, dynamic>),
|
: Activity.fromJson(json['guild_type_activity'] as Map<String, dynamic>),
|
||||||
kill_house: json['kill_house'] as List<dynamic>?,
|
killHouse: json['kill_house'] as List<dynamic>?,
|
||||||
steward_kill_house: json['steward_kill_house'] as List<dynamic>?,
|
stewardKillHouse: json['steward_kill_house'] as List<dynamic>?,
|
||||||
stewards: json['stewards'] as List<dynamic>?,
|
stewards: json['stewards'] as List<dynamic>?,
|
||||||
get_pos_status: json['get_pos_status'] == null
|
getPosStatus: json['get_pos_status'] == null
|
||||||
? null
|
? null
|
||||||
: PosStatus.fromJson(json['get_pos_status'] as Map<String, dynamic>),
|
: PosStatus.fromJson(json['get_pos_status'] as Map<String, dynamic>),
|
||||||
key: json['key'] as String?,
|
key: json['key'] as String?,
|
||||||
create_date: json['create_date'] as String?,
|
createDate: json['create_date'] as String?,
|
||||||
modify_date: json['modify_date'] as String?,
|
modifyDate: json['modify_date'] as String?,
|
||||||
trash: json['trash'] as bool?,
|
trash: json['trash'] as bool?,
|
||||||
user_id_foreign_key: json['user_id_foreign_key'],
|
userIdForeignKey: json['user_id_foreign_key'],
|
||||||
address_id_foreign_key: json['address_id_foreign_key'],
|
addressIdForeignKey: json['address_id_foreign_key'],
|
||||||
user_bank_id_foreign_key: json['user_bank_id_foreign_key'],
|
userBankIdForeignKey: json['user_bank_id_foreign_key'],
|
||||||
wallet_id_foreign_key: json['wallet_id_foreign_key'],
|
walletIdForeignKey: json['wallet_id_foreign_key'],
|
||||||
provincial_government_id_key: json['provincial_government_id_key'],
|
provincialGovernmentIdKey: json['provincial_government_id_key'],
|
||||||
identity_documents: json['identity_documents'],
|
identityDocuments: json['identity_documents'],
|
||||||
active: json['active'] as bool?,
|
active: json['active'] as bool?,
|
||||||
city_number: (json['city_number'] as num?)?.toInt(),
|
cityNumber: (json['city_number'] as num?)?.toInt(),
|
||||||
city_name: json['city_name'] as String?,
|
cityName: json['city_name'] as String?,
|
||||||
guilds_id: json['guilds_id'] as String?,
|
guildsId: json['guilds_id'] as String?,
|
||||||
license_number: json['license_number'] as String?,
|
licenseNumber: json['license_number'] as String?,
|
||||||
guilds_name: json['guilds_name'] as String?,
|
guildsName: json['guilds_name'] as String?,
|
||||||
phone: json['phone'] as String?,
|
phone: json['phone'] as String?,
|
||||||
type_activity: json['type_activity'] as String?,
|
typeActivity: json['type_activity'] as String?,
|
||||||
area_activity: json['area_activity'] as String?,
|
areaActivity: json['area_activity'] as String?,
|
||||||
province_number: (json['province_number'] as num?)?.toInt(),
|
provinceNumber: (json['province_number'] as num?)?.toInt(),
|
||||||
province_name: json['province_name'] as String?,
|
provinceName: json['province_name'] as String?,
|
||||||
steward: json['steward'] as bool?,
|
steward: json['steward'] as bool?,
|
||||||
has_pos: json['has_pos'] as bool?,
|
hasPos: json['has_pos'] as bool?,
|
||||||
centers_allocation: json['centers_allocation'],
|
centersAllocation: json['centers_allocation'],
|
||||||
kill_house_centers_allocation: json['kill_house_centers_allocation'],
|
killHouseCentersAllocation: json['kill_house_centers_allocation'],
|
||||||
allocation_limit: json['allocation_limit'],
|
allocationLimit: json['allocation_limit'],
|
||||||
limitation_allocation: json['limitation_allocation'] as bool?,
|
limitationAllocation: json['limitation_allocation'] as bool?,
|
||||||
registerar_role: json['registerar_role'] as String?,
|
registerarRole: json['registerar_role'] as String?,
|
||||||
registerar_fullname: json['registerar_fullname'] as String?,
|
registerarFullname: json['registerar_fullname'] as String?,
|
||||||
registerar_mobile: json['registerar_mobile'] as String?,
|
registerarMobile: json['registerar_mobile'] as String?,
|
||||||
kill_house_register: json['kill_house_register'] as bool?,
|
killHouseRegister: json['kill_house_register'] as bool?,
|
||||||
steward_register: json['steward_register'] as bool?,
|
stewardRegister: json['steward_register'] as bool?,
|
||||||
guilds_room_register: json['guilds_room_register'] as bool?,
|
guildsRoomRegister: json['guilds_room_register'] as bool?,
|
||||||
pos_company_register: json['pos_company_register'] as bool?,
|
posCompanyRegister: json['pos_company_register'] as bool?,
|
||||||
province_accept_state: json['province_accept_state'] as String?,
|
provinceAcceptState: json['province_accept_state'] as String?,
|
||||||
province_message: json['province_message'] as String?,
|
provinceMessage: json['province_message'] as String?,
|
||||||
condition: json['condition'] as String?,
|
condition: json['condition'] as String?,
|
||||||
description_condition: json['description_condition'] as String?,
|
descriptionCondition: json['description_condition'] as String?,
|
||||||
steward_active: json['steward_active'] as bool?,
|
stewardActive: json['steward_active'] as bool?,
|
||||||
steward_allocation_limit: json['steward_allocation_limit'],
|
stewardAllocationLimit: json['steward_allocation_limit'],
|
||||||
steward_limitation_allocation: json['steward_limitation_allocation'] as bool?,
|
stewardLimitationAllocation: json['steward_limitation_allocation'] as bool?,
|
||||||
license: json['license'] as bool?,
|
license: json['license'] as bool?,
|
||||||
license_form: json['license_form'],
|
licenseForm: json['license_form'],
|
||||||
license_file: json['license_file'],
|
licenseFile: json['license_file'],
|
||||||
reviewer_role: json['reviewer_role'] as String?,
|
reviewerRole: json['reviewer_role'] as String?,
|
||||||
reviewer_fullname: json['reviewer_fullname'] as String?,
|
reviewerFullname: json['reviewer_fullname'] as String?,
|
||||||
reviewer_mobile: json['reviewer_mobile'] as String?,
|
reviewerMobile: json['reviewer_mobile'] as String?,
|
||||||
checker_message: json['checker_message'] as String?,
|
checkerMessage: json['checker_message'] as String?,
|
||||||
final_accept: json['final_accept'] as bool?,
|
finalAccept: json['final_accept'] as bool?,
|
||||||
temporary_registration: json['temporary_registration'] as bool?,
|
temporaryRegistration: json['temporary_registration'] as bool?,
|
||||||
created_by: json['created_by'] as String?,
|
createdBy: json['created_by'] as String?,
|
||||||
modified_by: json['modified_by'] as String?,
|
modifiedBy: json['modified_by'] as String?,
|
||||||
user_bank_info: json['user_bank_info'],
|
userBankInfo: json['user_bank_info'],
|
||||||
wallet: (json['wallet'] as num?)?.toInt(),
|
wallet: (json['wallet'] as num?)?.toInt(),
|
||||||
cars: json['cars'] as List<dynamic>?,
|
cars: json['cars'] as List<dynamic>?,
|
||||||
user_level: json['user_level'] as List<dynamic>?,
|
userLevel: json['user_level'] as List<dynamic>?,
|
||||||
);
|
);
|
||||||
|
|
||||||
Map<String, dynamic> _$StewardToJson(_Steward instance) => <String, dynamic>{
|
Map<String, dynamic> _$StewardToJson(_Steward instance) => <String, dynamic>{
|
||||||
'id': instance.id,
|
'id': instance.id,
|
||||||
'user': instance.user,
|
'user': instance.user,
|
||||||
'address': instance.address,
|
'address': instance.address,
|
||||||
'guild_area_activity': instance.guild_area_activity,
|
'guild_area_activity': instance.guildAreaActivity,
|
||||||
'guild_type_activity': instance.guild_type_activity,
|
'guild_type_activity': instance.guildTypeActivity,
|
||||||
'kill_house': instance.kill_house,
|
'kill_house': instance.killHouse,
|
||||||
'steward_kill_house': instance.steward_kill_house,
|
'steward_kill_house': instance.stewardKillHouse,
|
||||||
'stewards': instance.stewards,
|
'stewards': instance.stewards,
|
||||||
'get_pos_status': instance.get_pos_status,
|
'get_pos_status': instance.getPosStatus,
|
||||||
'key': instance.key,
|
'key': instance.key,
|
||||||
'create_date': instance.create_date,
|
'create_date': instance.createDate,
|
||||||
'modify_date': instance.modify_date,
|
'modify_date': instance.modifyDate,
|
||||||
'trash': instance.trash,
|
'trash': instance.trash,
|
||||||
'user_id_foreign_key': instance.user_id_foreign_key,
|
'user_id_foreign_key': instance.userIdForeignKey,
|
||||||
'address_id_foreign_key': instance.address_id_foreign_key,
|
'address_id_foreign_key': instance.addressIdForeignKey,
|
||||||
'user_bank_id_foreign_key': instance.user_bank_id_foreign_key,
|
'user_bank_id_foreign_key': instance.userBankIdForeignKey,
|
||||||
'wallet_id_foreign_key': instance.wallet_id_foreign_key,
|
'wallet_id_foreign_key': instance.walletIdForeignKey,
|
||||||
'provincial_government_id_key': instance.provincial_government_id_key,
|
'provincial_government_id_key': instance.provincialGovernmentIdKey,
|
||||||
'identity_documents': instance.identity_documents,
|
'identity_documents': instance.identityDocuments,
|
||||||
'active': instance.active,
|
'active': instance.active,
|
||||||
'city_number': instance.city_number,
|
'city_number': instance.cityNumber,
|
||||||
'city_name': instance.city_name,
|
'city_name': instance.cityName,
|
||||||
'guilds_id': instance.guilds_id,
|
'guilds_id': instance.guildsId,
|
||||||
'license_number': instance.license_number,
|
'license_number': instance.licenseNumber,
|
||||||
'guilds_name': instance.guilds_name,
|
'guilds_name': instance.guildsName,
|
||||||
'phone': instance.phone,
|
'phone': instance.phone,
|
||||||
'type_activity': instance.type_activity,
|
'type_activity': instance.typeActivity,
|
||||||
'area_activity': instance.area_activity,
|
'area_activity': instance.areaActivity,
|
||||||
'province_number': instance.province_number,
|
'province_number': instance.provinceNumber,
|
||||||
'province_name': instance.province_name,
|
'province_name': instance.provinceName,
|
||||||
'steward': instance.steward,
|
'steward': instance.steward,
|
||||||
'has_pos': instance.has_pos,
|
'has_pos': instance.hasPos,
|
||||||
'centers_allocation': instance.centers_allocation,
|
'centers_allocation': instance.centersAllocation,
|
||||||
'kill_house_centers_allocation': instance.kill_house_centers_allocation,
|
'kill_house_centers_allocation': instance.killHouseCentersAllocation,
|
||||||
'allocation_limit': instance.allocation_limit,
|
'allocation_limit': instance.allocationLimit,
|
||||||
'limitation_allocation': instance.limitation_allocation,
|
'limitation_allocation': instance.limitationAllocation,
|
||||||
'registerar_role': instance.registerar_role,
|
'registerar_role': instance.registerarRole,
|
||||||
'registerar_fullname': instance.registerar_fullname,
|
'registerar_fullname': instance.registerarFullname,
|
||||||
'registerar_mobile': instance.registerar_mobile,
|
'registerar_mobile': instance.registerarMobile,
|
||||||
'kill_house_register': instance.kill_house_register,
|
'kill_house_register': instance.killHouseRegister,
|
||||||
'steward_register': instance.steward_register,
|
'steward_register': instance.stewardRegister,
|
||||||
'guilds_room_register': instance.guilds_room_register,
|
'guilds_room_register': instance.guildsRoomRegister,
|
||||||
'pos_company_register': instance.pos_company_register,
|
'pos_company_register': instance.posCompanyRegister,
|
||||||
'province_accept_state': instance.province_accept_state,
|
'province_accept_state': instance.provinceAcceptState,
|
||||||
'province_message': instance.province_message,
|
'province_message': instance.provinceMessage,
|
||||||
'condition': instance.condition,
|
'condition': instance.condition,
|
||||||
'description_condition': instance.description_condition,
|
'description_condition': instance.descriptionCondition,
|
||||||
'steward_active': instance.steward_active,
|
'steward_active': instance.stewardActive,
|
||||||
'steward_allocation_limit': instance.steward_allocation_limit,
|
'steward_allocation_limit': instance.stewardAllocationLimit,
|
||||||
'steward_limitation_allocation': instance.steward_limitation_allocation,
|
'steward_limitation_allocation': instance.stewardLimitationAllocation,
|
||||||
'license': instance.license,
|
'license': instance.license,
|
||||||
'license_form': instance.license_form,
|
'license_form': instance.licenseForm,
|
||||||
'license_file': instance.license_file,
|
'license_file': instance.licenseFile,
|
||||||
'reviewer_role': instance.reviewer_role,
|
'reviewer_role': instance.reviewerRole,
|
||||||
'reviewer_fullname': instance.reviewer_fullname,
|
'reviewer_fullname': instance.reviewerFullname,
|
||||||
'reviewer_mobile': instance.reviewer_mobile,
|
'reviewer_mobile': instance.reviewerMobile,
|
||||||
'checker_message': instance.checker_message,
|
'checker_message': instance.checkerMessage,
|
||||||
'final_accept': instance.final_accept,
|
'final_accept': instance.finalAccept,
|
||||||
'temporary_registration': instance.temporary_registration,
|
'temporary_registration': instance.temporaryRegistration,
|
||||||
'created_by': instance.created_by,
|
'created_by': instance.createdBy,
|
||||||
'modified_by': instance.modified_by,
|
'modified_by': instance.modifiedBy,
|
||||||
'user_bank_info': instance.user_bank_info,
|
'user_bank_info': instance.userBankInfo,
|
||||||
'wallet': instance.wallet,
|
'wallet': instance.wallet,
|
||||||
'cars': instance.cars,
|
'cars': instance.cars,
|
||||||
'user_level': instance.user_level,
|
'user_level': instance.userLevel,
|
||||||
};
|
};
|
||||||
|
|
||||||
_User _$UserFromJson(Map<String, dynamic> json) => _User(
|
_User _$UserFromJson(Map<String, dynamic> json) => _User(
|
||||||
fullname: json['fullname'] as String?,
|
fullname: json['fullname'] as String?,
|
||||||
first_name: json['first_name'] as String?,
|
firstName: json['first_name'] as String?,
|
||||||
last_name: json['last_name'] as String?,
|
lastName: json['last_name'] as String?,
|
||||||
mobile: json['mobile'] as String?,
|
mobile: json['mobile'] as String?,
|
||||||
national_id: json['national_id'] as String?,
|
nationalId: json['national_id'] as String?,
|
||||||
city: json['city'] as String?,
|
city: json['city'] as String?,
|
||||||
);
|
);
|
||||||
|
|
||||||
Map<String, dynamic> _$UserToJson(_User instance) => <String, dynamic>{
|
Map<String, dynamic> _$UserToJson(_User instance) => <String, dynamic>{
|
||||||
'fullname': instance.fullname,
|
'fullname': instance.fullname,
|
||||||
'first_name': instance.first_name,
|
'first_name': instance.firstName,
|
||||||
'last_name': instance.last_name,
|
'last_name': instance.lastName,
|
||||||
'mobile': instance.mobile,
|
'mobile': instance.mobile,
|
||||||
'national_id': instance.national_id,
|
'national_id': instance.nationalId,
|
||||||
'city': instance.city,
|
'city': instance.city,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -333,14 +313,14 @@ _Address _$AddressFromJson(Map<String, dynamic> json) => _Address(
|
|||||||
? null
|
? null
|
||||||
: Province.fromJson(json['city'] as Map<String, dynamic>),
|
: Province.fromJson(json['city'] as Map<String, dynamic>),
|
||||||
address: json['address'] as String?,
|
address: json['address'] as String?,
|
||||||
postal_code: json['postal_code'] as String?,
|
postalCode: json['postal_code'] as String?,
|
||||||
);
|
);
|
||||||
|
|
||||||
Map<String, dynamic> _$AddressToJson(_Address instance) => <String, dynamic>{
|
Map<String, dynamic> _$AddressToJson(_Address instance) => <String, dynamic>{
|
||||||
'province': instance.province,
|
'province': instance.province,
|
||||||
'city': instance.city,
|
'city': instance.city,
|
||||||
'address': instance.address,
|
'address': instance.address,
|
||||||
'postal_code': instance.postal_code,
|
'postal_code': instance.postalCode,
|
||||||
};
|
};
|
||||||
|
|
||||||
_Province _$ProvinceFromJson(Map<String, dynamic> json) =>
|
_Province _$ProvinceFromJson(Map<String, dynamic> json) =>
|
||||||
@@ -360,14 +340,14 @@ Map<String, dynamic> _$ActivityToJson(_Activity instance) => <String, dynamic>{
|
|||||||
};
|
};
|
||||||
|
|
||||||
_PosStatus _$PosStatusFromJson(Map<String, dynamic> json) => _PosStatus(
|
_PosStatus _$PosStatusFromJson(Map<String, dynamic> json) => _PosStatus(
|
||||||
len_active_sessions: (json['len_active_sessions'] as num?)?.toInt(),
|
lenActiveSessions: (json['len_active_sessions'] as num?)?.toInt(),
|
||||||
has_pons: json['has_pons'] as bool?,
|
hasPons: json['has_pons'] as bool?,
|
||||||
has_active_pons: json['has_active_pons'] as bool?,
|
hasActivePons: json['has_active_pons'] as bool?,
|
||||||
);
|
);
|
||||||
|
|
||||||
Map<String, dynamic> _$PosStatusToJson(_PosStatus instance) =>
|
Map<String, dynamic> _$PosStatusToJson(_PosStatus instance) =>
|
||||||
<String, dynamic>{
|
<String, dynamic>{
|
||||||
'len_active_sessions': instance.len_active_sessions,
|
'len_active_sessions': instance.lenActiveSessions,
|
||||||
'has_pons': instance.has_pons,
|
'has_pons': instance.hasPons,
|
||||||
'has_active_pons': instance.has_active_pons,
|
'has_active_pons': instance.hasActivePons,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -47,9 +47,9 @@ abstract class ChickenRepository {
|
|||||||
required int page,
|
required int page,
|
||||||
});
|
});
|
||||||
|
|
||||||
Future<AllocatedMadeModel?> getAllocatedMade({
|
Future<PaginationModel<AllocatedMadeModel>?> getAllocatedMade({
|
||||||
required String token,
|
required String token,
|
||||||
required int page,
|
Map<String, dynamic>? queryParameters,
|
||||||
});
|
});
|
||||||
|
|
||||||
Future<void> confirmAllocation({
|
Future<void> confirmAllocation({
|
||||||
@@ -71,7 +71,7 @@ abstract class ChickenRepository {
|
|||||||
|
|
||||||
Future<List<GuildModel>?> getGuilds({
|
Future<List<GuildModel>?> getGuilds({
|
||||||
required String token,
|
required String token,
|
||||||
required bool isFree,
|
Map<String, dynamic>? queryParameters,
|
||||||
});
|
});
|
||||||
|
|
||||||
Future<GuildProfile?> getProfile({required String token});
|
Future<GuildProfile?> getProfile({required String token});
|
||||||
|
|||||||
@@ -106,14 +106,18 @@ class ChickenRepositoryImpl implements ChickenRepository {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<AllocatedMadeModel?> getAllocatedMade({
|
Future<PaginationModel<AllocatedMadeModel>?> getAllocatedMade({
|
||||||
required String token,
|
required String token,
|
||||||
required int page,
|
Map<String, dynamic>? queryParameters,
|
||||||
}) async {
|
}) async {
|
||||||
var res = await _httpClient.get(
|
var res = await _httpClient.get(
|
||||||
'/steward-allocation/?search=filter&value=&role=Steward&page=$page&page_size=100',
|
'/steward-allocation/',
|
||||||
|
queryParameters:queryParameters,
|
||||||
headers: {'Authorization': 'Bearer $token'},
|
headers: {'Authorization': 'Bearer $token'},
|
||||||
fromJson: AllocatedMadeModel.fromJson,
|
fromJson: (json) => PaginationModel<AllocatedMadeModel>.fromJson(
|
||||||
|
json,
|
||||||
|
(json) => AllocatedMadeModel.fromJson(json as Map<String, dynamic>),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
return res.data;
|
return res.data;
|
||||||
}
|
}
|
||||||
@@ -168,12 +172,12 @@ class ChickenRepositoryImpl implements ChickenRepository {
|
|||||||
@override
|
@override
|
||||||
Future<List<GuildModel>?> getGuilds({
|
Future<List<GuildModel>?> getGuilds({
|
||||||
required String token,
|
required String token,
|
||||||
required bool isFree,
|
Map<String, dynamic>? queryParameters,
|
||||||
}) async {
|
}) async {
|
||||||
var res = await _httpClient.get(
|
var res = await _httpClient.get(
|
||||||
'/guilds/?role=Steward&free=$isFree',
|
'/guilds/?',
|
||||||
|
queryParameters: queryParameters,
|
||||||
headers: {'Authorization': 'Bearer $token'},
|
headers: {'Authorization': 'Bearer $token'},
|
||||||
|
|
||||||
fromJsonList: (json) => json
|
fromJsonList: (json) => json
|
||||||
.map((item) => GuildModel.fromJson(item as Map<String, dynamic>))
|
.map((item) => GuildModel.fromJson(item as Map<String, dynamic>))
|
||||||
.toList(),
|
.toList(),
|
||||||
|
|||||||
@@ -11,6 +11,14 @@ extension xStringUtils on String {
|
|||||||
|
|
||||||
get faItem => utilsMap[this] ?? this;
|
get faItem => utilsMap[this] ?? this;
|
||||||
|
|
||||||
|
get buyerIsGuild {
|
||||||
|
final tmp = split('_');
|
||||||
|
if (tmp.length > 1) {
|
||||||
|
return tmp.last == 'guild';
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, String> utilsMap = {
|
Map<String, String> utilsMap = {
|
||||||
@@ -21,5 +29,5 @@ Map<String, String> utilsMap = {
|
|||||||
'free': 'آزاد',
|
'free': 'آزاد',
|
||||||
'pending': 'در انتظار',
|
'pending': 'در انتظار',
|
||||||
'accepted': 'تایید شده',
|
'accepted': 'تایید شده',
|
||||||
'guild':'صنف'
|
'guild': 'صنف',
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -10,7 +10,8 @@ import 'package:rasadyar_core/core.dart';
|
|||||||
|
|
||||||
class OutOfProvinceLogic extends GetxController {
|
class OutOfProvinceLogic extends GetxController {
|
||||||
var rootLogic = Get.find<RootLogic>();
|
var rootLogic = Get.find<RootLogic>();
|
||||||
Rxn<AllocatedMadeModel> allocatedMadeModel = Rxn<AllocatedMadeModel>();
|
Rxn<List<AllocatedMadeModel>?> allocatedMadeModel =
|
||||||
|
Rxn<List<AllocatedMadeModel>?>();
|
||||||
RxList<ProductModel> rolesProductsModel = RxList<ProductModel>();
|
RxList<ProductModel> rolesProductsModel = RxList<ProductModel>();
|
||||||
|
|
||||||
RxList<GuildModel> guildsModel = <GuildModel>[].obs;
|
RxList<GuildModel> guildsModel = <GuildModel>[].obs;
|
||||||
@@ -29,11 +30,16 @@ class OutOfProvinceLogic extends GetxController {
|
|||||||
safeCall(
|
safeCall(
|
||||||
call: () async => await rootLogic.chickenRepository.getAllocatedMade(
|
call: () async => await rootLogic.chickenRepository.getAllocatedMade(
|
||||||
token: rootLogic.tokenService.accessToken.value!,
|
token: rootLogic.tokenService.accessToken.value!,
|
||||||
|
queryParameters: buildQueryParams(
|
||||||
page: 1,
|
page: 1,
|
||||||
|
pageSize: 20,
|
||||||
|
search: 'filter',
|
||||||
|
role: 'Steward',
|
||||||
|
),
|
||||||
),
|
),
|
||||||
onSuccess: (result) {
|
onSuccess: (result) {
|
||||||
if (result != null) {
|
if (result != null) {
|
||||||
allocatedMadeModel.value = result;
|
allocatedMadeModel.value = result.results;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onError: (error, stacktrace) {},
|
onError: (error, stacktrace) {},
|
||||||
@@ -73,8 +79,7 @@ class OutOfProvinceLogic extends GetxController {
|
|||||||
call: () async => await rootLogic.chickenRepository.confirmAllAllocation(
|
call: () async => await rootLogic.chickenRepository.confirmAllAllocation(
|
||||||
token: rootLogic.tokenService.accessToken.value!,
|
token: rootLogic.tokenService.accessToken.value!,
|
||||||
allocationTokens:
|
allocationTokens:
|
||||||
allocatedMadeModel.value?.results?.map((e) => e.key!).toList() ??
|
allocatedMadeModel.value?.map((e) => e.key!).toList() ?? [],
|
||||||
[],
|
|
||||||
),
|
),
|
||||||
onSuccess: (result) {
|
onSuccess: (result) {
|
||||||
getAllocatedMade();
|
getAllocatedMade();
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import 'package:rasadyar_chicken/data/repositories/chicken_repository.dart';
|
|||||||
import 'package:rasadyar_chicken/data/repositories/chicken_repository_imp.dart';
|
import 'package:rasadyar_chicken/data/repositories/chicken_repository_imp.dart';
|
||||||
import 'package:rasadyar_chicken/presentation/pages/home/view.dart';
|
import 'package:rasadyar_chicken/presentation/pages/home/view.dart';
|
||||||
import 'package:rasadyar_chicken/presentation/pages/out_of_province/view.dart';
|
import 'package:rasadyar_chicken/presentation/pages/out_of_province/view.dart';
|
||||||
|
import 'package:rasadyar_chicken/presentation/pages/sales_in_province/view.dart';
|
||||||
import 'package:rasadyar_chicken/presentation/utils/utils.dart';
|
import 'package:rasadyar_chicken/presentation/utils/utils.dart';
|
||||||
import 'package:rasadyar_core/core.dart';
|
import 'package:rasadyar_core/core.dart';
|
||||||
|
|
||||||
@@ -14,7 +15,7 @@ enum ErrorLocationType { serviceDisabled, permissionDenied, none }
|
|||||||
class RootLogic extends GetxController {
|
class RootLogic extends GetxController {
|
||||||
RxInt currentPage = 2.obs;
|
RxInt currentPage = 2.obs;
|
||||||
List<Widget> pages = [
|
List<Widget> pages = [
|
||||||
Container(color: Colors.red),
|
SalesInProvincePage(),
|
||||||
OutOfProvincePage(),
|
OutOfProvincePage(),
|
||||||
HomePage(),
|
HomePage(),
|
||||||
Container(color: Colors.blue),
|
Container(color: Colors.blue),
|
||||||
|
|||||||
@@ -11,7 +11,10 @@ import 'package:rasadyar_core/core.dart';
|
|||||||
|
|
||||||
class SalesInProvinceLogic extends GetxController {
|
class SalesInProvinceLogic extends GetxController {
|
||||||
var rootLogic = Get.find<RootLogic>();
|
var rootLogic = Get.find<RootLogic>();
|
||||||
Rxn<AllocatedMadeModel> allocatedMadeModel = Rxn<AllocatedMadeModel>();
|
Rxn<List<AllocatedMadeModel>?> allocatedMadeModel =
|
||||||
|
Rxn<List<AllocatedMadeModel>?>();
|
||||||
|
RxList<int> isExpandedList = <int>[].obs;
|
||||||
|
|
||||||
RxList<ProductModel> rolesProductsModel = RxList<ProductModel>();
|
RxList<ProductModel> rolesProductsModel = RxList<ProductModel>();
|
||||||
|
|
||||||
RxList<GuildModel> guildsModel = <GuildModel>[].obs;
|
RxList<GuildModel> guildsModel = <GuildModel>[].obs;
|
||||||
@@ -86,15 +89,21 @@ class SalesInProvinceLogic extends GetxController {
|
|||||||
safeCall(
|
safeCall(
|
||||||
call: () async => await rootLogic.chickenRepository.getAllocatedMade(
|
call: () async => await rootLogic.chickenRepository.getAllocatedMade(
|
||||||
token: rootLogic.tokenService.accessToken.value!,
|
token: rootLogic.tokenService.accessToken.value!,
|
||||||
|
queryParameters: buildQueryParams(
|
||||||
page: currentPageAllocationsMade.value,
|
page: currentPageAllocationsMade.value,
|
||||||
|
pageSize: 20,
|
||||||
|
search: 'filter',
|
||||||
|
role: 'Steward',
|
||||||
|
),
|
||||||
),
|
),
|
||||||
onSuccess: (result) {
|
onSuccess: (result) {
|
||||||
if (result != null) {
|
if (result != null) {
|
||||||
if (isLoadingMoreAllocationsMade.value &&
|
if (isLoadingMoreAllocationsMade.value &&
|
||||||
allocatedMadeModel.value?.results != null) {
|
allocatedMadeModel.value != null &&
|
||||||
allocatedMadeModel.value?.results?.addAll(result.results!);
|
(allocatedMadeModel.value?.isNotEmpty ?? false)) {
|
||||||
|
allocatedMadeModel.value?.addAll(result.results!);
|
||||||
} else {
|
} else {
|
||||||
allocatedMadeModel.value = result;
|
allocatedMadeModel.value = result.results;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -146,8 +155,7 @@ class SalesInProvinceLogic extends GetxController {
|
|||||||
call: () async => await rootLogic.chickenRepository.confirmAllAllocation(
|
call: () async => await rootLogic.chickenRepository.confirmAllAllocation(
|
||||||
token: rootLogic.tokenService.accessToken.value!,
|
token: rootLogic.tokenService.accessToken.value!,
|
||||||
allocationTokens:
|
allocationTokens:
|
||||||
allocatedMadeModel.value?.results?.map((e) => e.key!).toList() ??
|
allocatedMadeModel.value?.map((e) => e.key!).toList() ?? [],
|
||||||
[],
|
|
||||||
),
|
),
|
||||||
onSuccess: (result) {
|
onSuccess: (result) {
|
||||||
getAllocatedMade();
|
getAllocatedMade();
|
||||||
@@ -164,6 +172,7 @@ class SalesInProvinceLogic extends GetxController {
|
|||||||
onSuccess: (result) {
|
onSuccess: (result) {
|
||||||
if (result != null) {
|
if (result != null) {
|
||||||
rolesProductsModel.value = result;
|
rolesProductsModel.value = result;
|
||||||
|
selectedProductModel.value = result.first;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onError: (error, stacktrace) {},
|
onError: (error, stacktrace) {},
|
||||||
@@ -174,7 +183,10 @@ class SalesInProvinceLogic extends GetxController {
|
|||||||
safeCall(
|
safeCall(
|
||||||
call: () async => await rootLogic.chickenRepository.getGuilds(
|
call: () async => await rootLogic.chickenRepository.getGuilds(
|
||||||
token: rootLogic.tokenService.accessToken.value!,
|
token: rootLogic.tokenService.accessToken.value!,
|
||||||
isFree: saleType.value == 2 ? true : false,
|
queryParameters: buildQueryParams(
|
||||||
|
queryParams: {'free': saleType.value == 2 ? true : false},
|
||||||
|
role: 'Steward',
|
||||||
|
),
|
||||||
),
|
),
|
||||||
onSuccess: (result) {
|
onSuccess: (result) {
|
||||||
if (result != null) {
|
if (result != null) {
|
||||||
@@ -242,11 +254,12 @@ class SalesInProvinceLogic extends GetxController {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void dispose() {
|
void dispose() {
|
||||||
rootLogic.inventoryExpandedList.clear();
|
rootLogic.inventoryExpandedList.clear();
|
||||||
super.dispose();
|
super.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//TODO
|
||||||
|
void setEditData(AllocatedMadeModel item) {}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
import 'package:rasadyar_chicken/data/models/request/conform_allocation/conform_allocation.dart';
|
import 'package:rasadyar_chicken/data/models/request/conform_allocation/conform_allocation.dart';
|
||||||
|
import 'package:rasadyar_chicken/data/models/response/allocated_made/allocated_made.dart';
|
||||||
import 'package:rasadyar_chicken/data/models/response/guild/guild_model.dart';
|
import 'package:rasadyar_chicken/data/models/response/guild/guild_model.dart';
|
||||||
import 'package:rasadyar_chicken/data/models/response/inventory/inventory_model.dart';
|
import 'package:rasadyar_chicken/data/models/response/inventory/inventory_model.dart';
|
||||||
import 'package:rasadyar_chicken/data/models/response/roles_products/roles_products.dart';
|
import 'package:rasadyar_chicken/data/models/response/roles_products/roles_products.dart';
|
||||||
@@ -14,23 +16,85 @@ class SalesInProvincePage extends GetView<SalesInProvinceLogic> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: RAppBar(title: 'فروش در استان'),
|
appBar: RAppBar(
|
||||||
|
titleTextStyle: AppFonts.yekan16Bold.copyWith(color: Colors.white),
|
||||||
|
centerTitle: true,
|
||||||
|
hasBack: true,
|
||||||
|
onBackPressed: () {
|
||||||
|
Get.back(id: 1);
|
||||||
|
},
|
||||||
|
leadingWidth: 155,
|
||||||
|
leading: Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
spacing: 6,
|
||||||
|
children: [
|
||||||
|
Assets.vec.chickenSvg.svg(
|
||||||
|
width: 24,
|
||||||
|
height: 24,
|
||||||
|
colorFilter: const ColorFilter.mode(
|
||||||
|
Colors.white,
|
||||||
|
BlendMode.srcIn,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'رصدطیور',
|
||||||
|
style: AppFonts.yekan16Bold.copyWith(color: Colors.white),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
additionalActions: [
|
||||||
|
GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
// controller.searchIsSelected.value = !controller.searchIsSelected.value;
|
||||||
|
},
|
||||||
|
child: Assets.vec.searchSvg.svg(
|
||||||
|
width: 24,
|
||||||
|
height: 24,
|
||||||
|
colorFilter: const ColorFilter.mode(
|
||||||
|
Colors.white,
|
||||||
|
BlendMode.srcIn,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: 8),
|
||||||
|
GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
// Get.bottomSheet(filterBottomSheet());
|
||||||
|
},
|
||||||
|
child: Assets.vec.filterOutlineSvg.svg(
|
||||||
|
width: 20,
|
||||||
|
height: 20,
|
||||||
|
colorFilter: const ColorFilter.mode(
|
||||||
|
Colors.white,
|
||||||
|
BlendMode.srcIn,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: 8),
|
||||||
|
],
|
||||||
|
),
|
||||||
body: SingleChildScrollView(
|
body: SingleChildScrollView(
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
|
routePageWidget(),
|
||||||
|
|
||||||
inventoryWidget(),
|
inventoryWidget(),
|
||||||
allocationsMade(),
|
allocationsMade(),
|
||||||
SizedBox(height: 20),
|
|
||||||
RElevated(
|
|
||||||
text: 'ثبت توزیع/ فروش',
|
|
||||||
onPressed: () {
|
|
||||||
showAddBottomSheet();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
SizedBox(height: 40),
|
SizedBox(height: 40),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
floatingActionButton: RFab.add(
|
||||||
|
onPressed: () {
|
||||||
|
Get.bottomSheet(
|
||||||
|
showAddBottomSheet(),
|
||||||
|
isScrollControlled: true,
|
||||||
|
backgroundColor: Colors.transparent,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
floatingActionButtonLocation: FloatingActionButtonLocation.startFloat,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -187,12 +251,12 @@ class SalesInProvincePage extends GetView<SalesInProvinceLogic> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget allocationsMade() {
|
Widget allocationsMade() {
|
||||||
return Padding(
|
return Column(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 8.0),
|
|
||||||
child: Column(
|
|
||||||
children: [
|
children: [
|
||||||
const SizedBox(height: 20),
|
const SizedBox(height: 20),
|
||||||
Row(
|
Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(horizontal: 6),
|
||||||
|
child: Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
@@ -210,12 +274,12 @@ class SalesInProvincePage extends GetView<SalesInProvinceLogic> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
SizedBox(height: 4),
|
),
|
||||||
ObxValue((data) {
|
ObxValue((data) {
|
||||||
if (data.value == null) {
|
if (data.value == null) {
|
||||||
return Container(
|
return Container(
|
||||||
height: 80,
|
height: 80,
|
||||||
margin: const EdgeInsets.all(8),
|
margin: const EdgeInsets.all(4),
|
||||||
padding: const EdgeInsets.all(12),
|
padding: const EdgeInsets.all(12),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
@@ -224,7 +288,7 @@ class SalesInProvincePage extends GetView<SalesInProvinceLogic> {
|
|||||||
),
|
),
|
||||||
child: Center(child: CircularProgressIndicator()),
|
child: Center(child: CircularProgressIndicator()),
|
||||||
);
|
);
|
||||||
} else if (data.value?.results?.isEmpty ?? true) {
|
} else if (data.value?.isEmpty ?? true) {
|
||||||
return Container(
|
return Container(
|
||||||
height: 80,
|
height: 80,
|
||||||
margin: const EdgeInsets.all(8),
|
margin: const EdgeInsets.all(8),
|
||||||
@@ -239,142 +303,30 @@ class SalesInProvincePage extends GetView<SalesInProvinceLogic> {
|
|||||||
} else {
|
} else {
|
||||||
return Container(
|
return Container(
|
||||||
margin: const EdgeInsets.symmetric(vertical: 2),
|
margin: const EdgeInsets.symmetric(vertical: 2),
|
||||||
height: 700,
|
|
||||||
padding: const EdgeInsets.all(6),
|
|
||||||
child: ListView.separated(
|
child: ListView.separated(
|
||||||
padding: const EdgeInsets.all(8.0),
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
shrinkWrap: true,
|
||||||
controller: controller.scrollControllerAllocationsMade,
|
controller: controller.scrollControllerAllocationsMade,
|
||||||
itemCount: data.value?.results?.length ?? 0,
|
itemCount: data.value?.length ?? 0,
|
||||||
itemBuilder: (BuildContext context, int index) {
|
itemBuilder: (BuildContext context, int index) {
|
||||||
if (index == data.value!.results!.length) {
|
if (index == data.value!.length) {
|
||||||
return Obx(
|
return Obx(
|
||||||
() => controller.isLoadingMoreAllocationsMade.value
|
() => controller.isLoadingMoreAllocationsMade.value
|
||||||
? const Padding(
|
? const Padding(
|
||||||
padding: EdgeInsets.symmetric(vertical: 16),
|
padding: EdgeInsets.symmetric(vertical: 8),
|
||||||
child: Center(
|
child: Center(child: CircularProgressIndicator()),
|
||||||
child: CircularProgressIndicator(),
|
|
||||||
),
|
|
||||||
)
|
)
|
||||||
: const SizedBox(),
|
: const SizedBox(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
final result = data.value!.results![index];
|
final result = data.value![index];
|
||||||
return Card(
|
return ObxValue((data) {
|
||||||
color: Colors.white,
|
return allocationsMadeListItem(
|
||||||
margin: const EdgeInsets.symmetric(vertical: 4.0),
|
expandList: controller.isExpandedList,
|
||||||
shape: RoundedRectangleBorder(
|
index: index,
|
||||||
borderRadius: BorderRadius.circular(8),
|
item: result,
|
||||||
side: const BorderSide(
|
|
||||||
color: AppColor.blueNormal,
|
|
||||||
width: 1,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.all(8.0),
|
|
||||||
child: Column(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
buildRow('ردیف', '${index + 1}'),
|
|
||||||
buildRow(
|
|
||||||
'تاریخ ثبت',
|
|
||||||
result.date!.formattedJalaliDate ?? 'N/A',
|
|
||||||
),
|
|
||||||
buildRow(
|
|
||||||
'نوع تخصیص',
|
|
||||||
result.allocation_type?.faAllocationType ?? 'N/A',
|
|
||||||
),
|
|
||||||
buildRow(
|
|
||||||
'مشخصات خریدار',
|
|
||||||
'${result.to_guilds?.user?.fullname} - ${result.to_guilds?.guilds_name}' ??
|
|
||||||
'N/A',
|
|
||||||
),
|
|
||||||
buildRow(
|
|
||||||
'مشخصات فروشنده',
|
|
||||||
result.steward?.user?.fullname ?? 'N/A',
|
|
||||||
),
|
|
||||||
buildRow(
|
|
||||||
'نوع فروش',
|
|
||||||
result.sell_type?.faItem ?? 'N/A',
|
|
||||||
),
|
|
||||||
buildRow(
|
|
||||||
'قیمت هر کیلو',
|
|
||||||
'${result.amount ?? 0} ریال ',
|
|
||||||
),
|
|
||||||
buildRow(
|
|
||||||
'قیمت کل',
|
|
||||||
'${result.total_amount ?? 0} ریال',
|
|
||||||
),
|
|
||||||
buildRow(
|
|
||||||
'وزن تخصیصی',
|
|
||||||
'${result.weight_of_carcasses?.toInt() ?? 0} کیلوگرم',
|
|
||||||
),
|
|
||||||
buildRow(
|
|
||||||
'کداحراز',
|
|
||||||
result.registration_code?.toString() ?? 'N/A',
|
|
||||||
),
|
|
||||||
buildRow(
|
|
||||||
'وضعیت کد احراز',
|
|
||||||
result.system_registration_code == true
|
|
||||||
? "ارسال شده"
|
|
||||||
: "ارسال نشده" ?? 'N/A',
|
|
||||||
),
|
|
||||||
buildRow(
|
|
||||||
'افت وزن(کیلوگرم)',
|
|
||||||
result.weight_loss_of_carcasses
|
|
||||||
?.toInt()
|
|
||||||
.toString() ??
|
|
||||||
'N/A',
|
|
||||||
),
|
|
||||||
buildRow(
|
|
||||||
'وضعیت',
|
|
||||||
result.receiver_state?.faItem ?? 'N/A',
|
|
||||||
),
|
|
||||||
|
|
||||||
Row(
|
|
||||||
spacing: 10,
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
child: RElevated(
|
|
||||||
height: 40,
|
|
||||||
text: 'تایید',
|
|
||||||
onPressed: () {
|
|
||||||
ConformAllocation confromation =
|
|
||||||
ConformAllocation(
|
|
||||||
allocation_key: result.key,
|
|
||||||
number_of_carcasses:
|
|
||||||
result.number_of_carcasses,
|
|
||||||
weight_of_carcasses: result
|
|
||||||
.weight_of_carcasses
|
|
||||||
?.toInt(),
|
|
||||||
amount: result.amount,
|
|
||||||
total_amount: result.total_amount,
|
|
||||||
);
|
|
||||||
|
|
||||||
controller.confirmAllocation(
|
|
||||||
confromation,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
child: RElevated(
|
|
||||||
height: 40,
|
|
||||||
backgroundColor: AppColor.error,
|
|
||||||
text: 'رد',
|
|
||||||
onPressed: () {
|
|
||||||
controller.denyAllocation(
|
|
||||||
result.key ?? '',
|
|
||||||
);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
);
|
||||||
|
}, controller.isExpandedList);
|
||||||
},
|
},
|
||||||
separatorBuilder: (BuildContext context, int index) =>
|
separatorBuilder: (BuildContext context, int index) =>
|
||||||
SizedBox(height: 8),
|
SizedBox(height: 8),
|
||||||
@@ -383,15 +335,12 @@ class SalesInProvincePage extends GetView<SalesInProvinceLogic> {
|
|||||||
}
|
}
|
||||||
}, controller.allocatedMadeModel),
|
}, controller.allocatedMadeModel),
|
||||||
],
|
],
|
||||||
),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void showAddBottomSheet() {
|
Widget showAddBottomSheet() {
|
||||||
Get.bottomSheet(
|
return BaseBottomSheet(
|
||||||
SafeArea(
|
height: Get.height * 0.75,
|
||||||
child: BaseBottomSheet(
|
|
||||||
height: 700,
|
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: EdgeInsets.only(
|
padding: EdgeInsets.only(
|
||||||
left: 16,
|
left: 16,
|
||||||
@@ -404,9 +353,7 @@ class SalesInProvincePage extends GetView<SalesInProvinceLogic> {
|
|||||||
children: [
|
children: [
|
||||||
Text(
|
Text(
|
||||||
'ثبت توزیع/ فروش',
|
'ثبت توزیع/ فروش',
|
||||||
style: AppFonts.yekan16Bold.copyWith(
|
style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal),
|
||||||
color: AppColor.blueNormal,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
const SizedBox(height: 12),
|
const SizedBox(height: 12),
|
||||||
RTextField(
|
RTextField(
|
||||||
@@ -416,10 +363,7 @@ class SalesInProvincePage extends GetView<SalesInProvinceLogic> {
|
|||||||
initText: Jalali.now().formatCompactDate(),
|
initText: Jalali.now().formatCompactDate(),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 12),
|
const SizedBox(height: 12),
|
||||||
Material(
|
Material(type: MaterialType.transparency, child: productDropDown()),
|
||||||
type: MaterialType.transparency,
|
|
||||||
child: productDropDown(),
|
|
||||||
),
|
|
||||||
const SizedBox(height: 12),
|
const SizedBox(height: 12),
|
||||||
SizedBox(
|
SizedBox(
|
||||||
height: 40,
|
height: 40,
|
||||||
@@ -431,6 +375,9 @@ class SalesInProvincePage extends GetView<SalesInProvinceLogic> {
|
|||||||
groupValue: controller.saleType.value,
|
groupValue: controller.saleType.value,
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
controller.saleType.value = value!;
|
controller.saleType.value = value!;
|
||||||
|
|
||||||
|
controller.selectedGuildModel.value = null;
|
||||||
|
controller.selectedGuildModel.refresh();
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
Text('فروش اختصاصی', style: AppFonts.yekan14),
|
Text('فروش اختصاصی', style: AppFonts.yekan14),
|
||||||
@@ -449,25 +396,34 @@ class SalesInProvincePage extends GetView<SalesInProvinceLogic> {
|
|||||||
),
|
),
|
||||||
const SizedBox(height: 12),
|
const SizedBox(height: 12),
|
||||||
|
|
||||||
Material(
|
guildsDropDown(),
|
||||||
type: MaterialType.transparency,
|
|
||||||
child: guildsDropDown(),
|
|
||||||
),
|
|
||||||
|
|
||||||
const SizedBox(height: 12),
|
const SizedBox(height: 12),
|
||||||
RTextField(
|
RTextField(
|
||||||
controller: controller.weightController,
|
controller: controller.weightController,
|
||||||
keyboardType: TextInputType.number,
|
keyboardType: TextInputType.number,
|
||||||
|
borderColor: AppColor.darkGreyLight,
|
||||||
|
inputFormatters: [
|
||||||
|
FilteringTextInputFormatter.digitsOnly,
|
||||||
|
SeparatorInputFormatter(),
|
||||||
|
],
|
||||||
|
|
||||||
onChanged: (p0) {
|
onChanged: (p0) {
|
||||||
controller.weight.value = int.tryParse(p0) ?? 0;
|
controller.weight.value = int.tryParse(p0.clearComma) ?? 0;
|
||||||
},
|
},
|
||||||
label: 'وزن لاشه',
|
label: 'وزن لاشه',
|
||||||
),
|
),
|
||||||
const SizedBox(height: 12),
|
const SizedBox(height: 12),
|
||||||
RTextField(
|
RTextField(
|
||||||
controller: controller.pricePerKiloController,
|
controller: controller.pricePerKiloController,
|
||||||
|
borderColor: AppColor.darkGreyLight,
|
||||||
|
inputFormatters: [
|
||||||
|
FilteringTextInputFormatter.digitsOnly,
|
||||||
|
SeparatorInputFormatter(),
|
||||||
|
],
|
||||||
|
|
||||||
onChanged: (p0) {
|
onChanged: (p0) {
|
||||||
controller.pricePerKilo.value = int.tryParse(p0) ?? 0;
|
controller.pricePerKilo.value = int.tryParse(p0.clearComma) ?? 0;
|
||||||
},
|
},
|
||||||
keyboardType: TextInputType.number,
|
keyboardType: TextInputType.number,
|
||||||
label: 'قیمت هر کیلو',
|
label: 'قیمت هر کیلو',
|
||||||
@@ -477,7 +433,12 @@ class SalesInProvincePage extends GetView<SalesInProvinceLogic> {
|
|||||||
(p0) => RTextField(
|
(p0) => RTextField(
|
||||||
enabled: false,
|
enabled: false,
|
||||||
keyboardType: TextInputType.number,
|
keyboardType: TextInputType.number,
|
||||||
initText: controller.totalCost.value.toString(),
|
inputFormatters: [
|
||||||
|
FilteringTextInputFormatter.digitsOnly,
|
||||||
|
SeparatorInputFormatter(),
|
||||||
|
],
|
||||||
|
borderColor: AppColor.darkGreyLight,
|
||||||
|
initText: controller.totalCost.value.toString().separatedByComma,
|
||||||
controller: controller.totalCostController,
|
controller: controller.totalCostController,
|
||||||
label: 'هزینه کل',
|
label: 'هزینه کل',
|
||||||
),
|
),
|
||||||
@@ -488,8 +449,10 @@ class SalesInProvincePage extends GetView<SalesInProvinceLogic> {
|
|||||||
return RElevated(
|
return RElevated(
|
||||||
text: 'ثبت',
|
text: 'ثبت',
|
||||||
onPressed: data.value
|
onPressed: data.value
|
||||||
? () {
|
? () async{
|
||||||
controller.submitAllocation();
|
await controller.submitAllocation();
|
||||||
|
controller.getAllocatedMade();
|
||||||
|
Get.back();
|
||||||
}
|
}
|
||||||
: null,
|
: null,
|
||||||
);
|
);
|
||||||
@@ -498,90 +461,426 @@ class SalesInProvincePage extends GetView<SalesInProvinceLogic> {
|
|||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
),
|
|
||||||
isScrollControlled: true,
|
|
||||||
backgroundColor: Colors.transparent,
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget guildsDropDown() {
|
Widget guildsDropDown() {
|
||||||
return ObxValue((p0) {
|
return Obx(() {
|
||||||
return DropdownButtonFormField<GuildModel>(
|
final item = controller.selectedGuildModel.value;
|
||||||
value: controller.selectedGuildModel.value,
|
return OverlayDropdownWidget<GuildModel>(
|
||||||
decoration: const InputDecoration(
|
key: ValueKey(item?.user?.fullname ?? ''),
|
||||||
labelText: 'انتخاب مباشر/صنف',
|
items: controller.guildsModel,
|
||||||
border: OutlineInputBorder(),
|
|
||||||
),
|
|
||||||
isExpanded: true,
|
|
||||||
items: controller.guildsModel.map((guild) {
|
|
||||||
return DropdownMenuItem<GuildModel>(
|
|
||||||
value: guild,
|
|
||||||
child: Text(
|
|
||||||
'${guild.steward == true ? 'مباشر' : 'صنف'} ${guild.user?.fullname} (${guild.user?.mobile})',
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}).toList(),
|
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
if (value != null) {
|
controller.selectedGuildModel.value = value;
|
||||||
controller.setSelectedGuild(value);
|
|
||||||
controller.checkVerfication();
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
);
|
selectedItem: item,
|
||||||
}, controller.guildsModel);
|
itemBuilder: (item) => Text(
|
||||||
/* return GetBuilder<SalesWithinProvinceLogic>(
|
item.user != null
|
||||||
builder: (controller) {
|
? '${item.steward == true ? 'مباشر' : 'صنف'} ${item.user!.fullname} (${item.user!.mobile})'
|
||||||
return DropdownButtonFormField<GuildModel>(
|
: 'بدون نام',
|
||||||
value: controller.selectedGuildModel.value,
|
|
||||||
decoration: const InputDecoration(
|
|
||||||
labelText: 'انتخاب مباشر/صنف',
|
|
||||||
border: OutlineInputBorder(),
|
|
||||||
),
|
),
|
||||||
isExpanded: true,
|
labelBuilder: (item) => Text(
|
||||||
items: controller.guildsModel.map((guild) {
|
item?.user != null
|
||||||
return DropdownMenuItem<GuildModel>(
|
? '${item?.steward == true ? 'مباشر' : 'صنف'} ${item?.user!.fullname} (${item?.user!.mobile})'
|
||||||
value: guild,
|
: 'انتخاب مباشر/صنف',
|
||||||
child: Text(
|
|
||||||
'${guild.steward == true ? 'مباشر' : 'صنف'} ${guild.user
|
|
||||||
?.fullname} (${guild.user?.mobile})',
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}).toList(),
|
});
|
||||||
onChanged: (value) {
|
|
||||||
if (value != null) {
|
|
||||||
controller.setSelectedGuild(value);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget productDropDown() {
|
Widget productDropDown() {
|
||||||
return GetBuilder<SalesInProvinceLogic>(
|
return Obx(() {
|
||||||
builder: (controller) {
|
return OverlayDropdownWidget<ProductModel>(
|
||||||
return DropdownButtonFormField<ProductModel>(
|
items: controller.rolesProductsModel,
|
||||||
value: controller.selectedProductModel.value,
|
|
||||||
decoration: const InputDecoration(
|
|
||||||
labelText: 'انتخاب محصول',
|
|
||||||
border: OutlineInputBorder(),
|
|
||||||
),
|
|
||||||
isExpanded: true,
|
|
||||||
items: controller.rolesProductsModel.map((guild) {
|
|
||||||
return DropdownMenuItem<ProductModel>(
|
|
||||||
value: guild,
|
|
||||||
child: Text('${guild.name}'),
|
|
||||||
);
|
|
||||||
}).toList(),
|
|
||||||
onChanged: (value) {
|
onChanged: (value) {
|
||||||
if (value != null) {
|
controller.selectedProductModel.value = value;
|
||||||
controller.setSelectedProduct(value);
|
},
|
||||||
controller.checkVerfication();
|
selectedItem: controller.selectedProductModel.value,
|
||||||
|
itemBuilder: (item) => Text(item.name ?? 'بدون نام'),
|
||||||
|
labelBuilder: (item) => Text(item?.name ?? 'انتخاب محصول'),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Padding routePageWidget() {
|
||||||
|
return Padding(
|
||||||
|
padding: const EdgeInsets.symmetric(vertical: 4.0),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
SizedBox(width: 8),
|
||||||
|
RichText(
|
||||||
|
text: TextSpan(
|
||||||
|
style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal),
|
||||||
|
children: [
|
||||||
|
WidgetSpan(
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Assets.vec.cubeSearchSvg.svg(
|
||||||
|
width: 24,
|
||||||
|
height: 24,
|
||||||
|
colorFilter: const ColorFilter.mode(
|
||||||
|
AppColor.blueNormal,
|
||||||
|
BlendMode.srcIn,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: 6),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
TextSpan(text: 'داخل استان'),
|
||||||
|
TextSpan(text: '/'),
|
||||||
|
TextSpan(text: 'فروش'),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget allocationsMadeListItem({
|
||||||
|
required RxList<int> expandList,
|
||||||
|
required int index,
|
||||||
|
required AllocatedMadeModel item,
|
||||||
|
}) {
|
||||||
|
return GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
if (expandList.contains(index)) {
|
||||||
|
controller.isExpandedList.remove(index);
|
||||||
|
} else {
|
||||||
|
controller.isExpandedList.add(index);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
child: Container(
|
||||||
|
width: Get.width,
|
||||||
|
margin: const EdgeInsets.fromLTRB(0, 0, 10, 0),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: getTintColor(item),
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
),
|
||||||
|
child: AnimatedSize(
|
||||||
|
duration: Duration(milliseconds: 400),
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: Stack(
|
||||||
|
clipBehavior: Clip.none,
|
||||||
|
alignment: Alignment.centerRight,
|
||||||
|
children: [
|
||||||
|
AnimatedSize(
|
||||||
|
duration: Duration(milliseconds: 300),
|
||||||
|
child: Container(
|
||||||
|
width: Get.width - 30,
|
||||||
|
alignment: Alignment.center,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.transparent,
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
border: Border.all(width: 2, color: getTintColor(item)),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: AnimatedCrossFade(
|
||||||
|
alignment: Alignment.center,
|
||||||
|
firstChild: Container(
|
||||||
|
height: 75,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
borderRadius: BorderRadius.only(
|
||||||
|
bottomLeft: Radius.zero,
|
||||||
|
bottomRight: Radius.circular(8),
|
||||||
|
topLeft: Radius.zero,
|
||||||
|
topRight: Radius.circular(8),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
|
|
||||||
|
children: [
|
||||||
|
SizedBox(width: 12),
|
||||||
|
|
||||||
|
Expanded(
|
||||||
|
flex: 2,
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
spacing: 4,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
item.steward?.user?.fullname ?? 'N/A',
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: AppFonts.yekan14.copyWith(
|
||||||
|
color: AppColor.blueNormal,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
SizedBox(height: 2),
|
||||||
|
Text(
|
||||||
|
item.createDate?.formattedJalaliDate,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: AppFonts.yekan14.copyWith(
|
||||||
|
color: AppColor.bgDark,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
SizedBox(width: 8),
|
||||||
|
Expanded(
|
||||||
|
flex: 2,
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
spacing: 4,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'${item.weightOfCarcasses.separatedByComma} Kg',
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: AppFonts.yekan12.copyWith(
|
||||||
|
color: AppColor.bgDark,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'${item.amount.separatedByComma} ریال',
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: AppFonts.yekan12.copyWith(
|
||||||
|
color: AppColor.darkGreyDark,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
flex: 1,
|
||||||
|
child: Text(
|
||||||
|
'${item.allocationType?.faAllocationType}',
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: AppFonts.yekan10.copyWith(
|
||||||
|
color: AppColor.darkGreyDark,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
SizedBox(width: 8),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
secondChild: Container(
|
||||||
|
padding: EdgeInsets.fromLTRB(8, 12, 14, 12),
|
||||||
|
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
borderRadius: BorderRadius.circular(8),
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
spacing: 8,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
controller.setEditData(item);
|
||||||
|
//TODO
|
||||||
|
/* Get.bottomSheet(
|
||||||
|
addOrEditBuyerBottomSheet(true),
|
||||||
|
isScrollControlled: true,
|
||||||
|
).whenComplete(() {
|
||||||
|
controller.resetSubmitForm();
|
||||||
|
});*/
|
||||||
|
},
|
||||||
|
child: Assets.vec.editSvg.svg(
|
||||||
|
width: 20,
|
||||||
|
height: 20,
|
||||||
|
colorFilter: ColorFilter.mode(
|
||||||
|
AppColor.blueNormal,
|
||||||
|
BlendMode.srcIn,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
Text(
|
||||||
|
item.allocationType?.faAllocationType,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: AppFonts.yekan16.copyWith(
|
||||||
|
color: AppColor.greenDark,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
SizedBox(),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
|
||||||
|
buildRow(
|
||||||
|
'تاریخ ثبت',
|
||||||
|
item.date!.formattedJalaliDate ?? 'N/A',
|
||||||
|
),
|
||||||
|
buildRow(
|
||||||
|
'نام و نام خانوادگی خریدار',
|
||||||
|
getBuyerInformation(item)?.user?.fullname ??
|
||||||
|
'N/A',
|
||||||
|
),
|
||||||
|
buildRow(
|
||||||
|
'شماره خریدار',
|
||||||
|
getBuyerInformation(item)?.user?.mobile ??
|
||||||
|
'N/A',
|
||||||
|
),
|
||||||
|
buildRow(
|
||||||
|
'نوع فروش',
|
||||||
|
item.sellType?.faItem ?? 'N/A',
|
||||||
|
),
|
||||||
|
buildRow(
|
||||||
|
'قیمت هر کیلو',
|
||||||
|
'${item.amount.separatedByComma ?? 0} ریال ',
|
||||||
|
),
|
||||||
|
buildRow(
|
||||||
|
'قیمت کل',
|
||||||
|
'${item.totalAmount.separatedByComma ?? 0} ریال',
|
||||||
|
),
|
||||||
|
buildRow(
|
||||||
|
'وزن تخصیصی',
|
||||||
|
'${item.weightOfCarcasses?.toInt().separatedByComma ?? 0} کیلوگرم',
|
||||||
|
),
|
||||||
|
buildRow(
|
||||||
|
'کداحراز',
|
||||||
|
item.registrationCode?.toString() ?? 'N/A',
|
||||||
|
),
|
||||||
|
buildRow(
|
||||||
|
'وضعیت کد احراز',
|
||||||
|
item.systemRegistrationCode == true
|
||||||
|
? "ارسال شده"
|
||||||
|
: "ارسال نشده" ?? 'N/A',
|
||||||
|
),
|
||||||
|
buildRow(
|
||||||
|
'افت وزن(کیلوگرم)',
|
||||||
|
item.weightLossOfCarcasses
|
||||||
|
?.toInt()
|
||||||
|
.toString() ??
|
||||||
|
'N/A',
|
||||||
|
),
|
||||||
|
|
||||||
|
Row(
|
||||||
|
spacing: 10,
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: RElevated(
|
||||||
|
backgroundColor: AppColor.greenNormal,
|
||||||
|
height: 40,
|
||||||
|
text: 'تایید',
|
||||||
|
textStyle: AppFonts.yekan18.copyWith(
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
ConformAllocation confromation =
|
||||||
|
ConformAllocation(
|
||||||
|
allocation_key: item.key,
|
||||||
|
number_of_carcasses:
|
||||||
|
item.numberOfCarcasses,
|
||||||
|
weight_of_carcasses: item
|
||||||
|
.weightOfCarcasses
|
||||||
|
?.toInt(),
|
||||||
|
amount: item.amount,
|
||||||
|
total_amount: item.totalAmount,
|
||||||
|
);
|
||||||
|
|
||||||
|
controller.confirmAllocation(
|
||||||
|
confromation,
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: ROutlinedElevated(
|
||||||
|
height: 40,
|
||||||
|
borderColor: AppColor.error,
|
||||||
|
text: 'رد',
|
||||||
|
textStyle: AppFonts.yekan18.copyWith(
|
||||||
|
color: AppColor.error,
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
controller.denyAllocation(
|
||||||
|
item.key ?? '',
|
||||||
);
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
crossFadeState: expandList.contains(index)
|
||||||
|
? CrossFadeState.showSecond
|
||||||
|
: CrossFadeState.showFirst,
|
||||||
|
duration: Duration(milliseconds: 300),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
width: 20,
|
||||||
|
child: Center(
|
||||||
|
child: RotatedBox(
|
||||||
|
quarterTurns: 3,
|
||||||
|
child: Text(
|
||||||
|
item.state?.faItem,
|
||||||
|
style: AppFonts.yekan8,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
Positioned(
|
||||||
|
right: -12,
|
||||||
|
child: Container(
|
||||||
|
width: index < 999 ? 24 : null,
|
||||||
|
height: index < 999 ? 24 : null,
|
||||||
|
padding: EdgeInsets.all(2),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: AppColor.greenLightHover,
|
||||||
|
borderRadius: BorderRadius.circular(4),
|
||||||
|
border: Border.all(
|
||||||
|
width: 0.50,
|
||||||
|
color: AppColor.greenDarkActive,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: Text(
|
||||||
|
(index + 1).toString(),
|
||||||
|
style: AppFonts.yekan12.copyWith(color: Colors.black),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Color getTintColor(AllocatedMadeModel model) {
|
||||||
|
Color res;
|
||||||
|
|
||||||
|
if (model.receiverState == 'pending') {
|
||||||
|
res = AppColor.yellowNormal;
|
||||||
|
} else if (model.receiverState == 'approved') {
|
||||||
|
res = AppColor.greenLightActive;
|
||||||
|
} else if (model.receiverState == 'rejected') {
|
||||||
|
res = AppColor.redLight;
|
||||||
|
} else {
|
||||||
|
res = AppColor.blueLight;
|
||||||
|
}
|
||||||
|
|
||||||
|
return res;
|
||||||
|
}
|
||||||
|
|
||||||
|
Steward? getBuyerInformation(AllocatedMadeModel model) {
|
||||||
|
if (model.allocationType?.buyerIsGuild) {
|
||||||
|
return model.toGuilds;
|
||||||
|
} else {
|
||||||
|
return model.steward;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -106,272 +106,11 @@ class SalesOutOfProvincePage extends GetView<SalesOutOfProvinceLogic> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}, controller.currentIndex);
|
}, controller.currentIndex);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Widget salePage(){
|
|
||||||
return SizedBox();
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
|
|
||||||
Widget saleListWidget() {
|
|
||||||
return ObxValue((data) {
|
|
||||||
switch (data.value.status) {
|
|
||||||
case Status.initial:
|
|
||||||
case Status.loading:
|
|
||||||
return Center(child: CupertinoActivityIndicator());
|
|
||||||
case Status.success:
|
|
||||||
return ListView.separated(
|
|
||||||
shrinkWrap: true,
|
|
||||||
physics: BouncingScrollPhysics(),
|
|
||||||
padding: EdgeInsets.fromLTRB(8, 8, 18, 80),
|
|
||||||
itemBuilder: (context, index) {
|
|
||||||
return ObxValue(
|
|
||||||
(expandList) => saleListItem(expandList: expandList, index: index, item: data.value.data![index]),
|
|
||||||
controller.isExpandedList,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
separatorBuilder: (context, index) => SizedBox(height: 8),
|
|
||||||
itemCount: data.value.data?.length ?? 0,
|
|
||||||
);
|
|
||||||
case Status.error:
|
|
||||||
return Center(
|
|
||||||
child: Text(
|
|
||||||
data.value.message ?? 'خطا در دریافت اطلاعات',
|
|
||||||
style: AppFonts.yekan16.copyWith(color: AppColor.error),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
case Status.empty:
|
|
||||||
return emptyWidget();
|
|
||||||
}
|
|
||||||
}, controller.purchaseOutOfProvinceList);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/* GestureDetector saleListItem({required RxList<int> expandList, required int index, required StewardFreeBar item}) {
|
|
||||||
return GestureDetector(
|
|
||||||
onTap: () {
|
|
||||||
if (expandList.contains(index)) {
|
|
||||||
controller.isExpandedList.remove(index);
|
|
||||||
} else {
|
|
||||||
controller.isExpandedList.add(index);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
child: AnimatedSize(
|
|
||||||
duration: Duration(milliseconds: 400),
|
|
||||||
alignment: Alignment.center,
|
|
||||||
child: Stack(
|
|
||||||
clipBehavior: Clip.none,
|
|
||||||
alignment: Alignment.centerRight,
|
|
||||||
children: [
|
|
||||||
AnimatedSize(
|
|
||||||
duration: Duration(milliseconds: 300),
|
|
||||||
child: Container(
|
|
||||||
width: Get.width - 30,
|
|
||||||
alignment: Alignment.center,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: Colors.transparent,
|
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
border: Border.all(width: 0.5, color: AppColor.darkGreyNormal),
|
|
||||||
),
|
|
||||||
child: AnimatedCrossFade(
|
|
||||||
alignment: Alignment.center,
|
|
||||||
firstChild: Padding(
|
|
||||||
padding: const EdgeInsets.symmetric(vertical: 10),
|
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
|
||||||
children: [
|
|
||||||
SizedBox(width: 12),
|
|
||||||
Expanded(
|
|
||||||
flex: 2,
|
|
||||||
child: Text(
|
|
||||||
item.date?.formattedJalaliDate ?? 'N/A',
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: AppFonts.yekan14.copyWith(color: AppColor.bgDark),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
flex: 3,
|
|
||||||
child: Text(
|
|
||||||
item.killHouseName ?? 'N/A',
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(width: 8,),
|
|
||||||
Expanded(
|
|
||||||
flex: 2,
|
|
||||||
child: Column(
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
'${item.weightOfCarcasses?.separatedByComma}kg',
|
|
||||||
textAlign: TextAlign.left,
|
|
||||||
style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal),
|
|
||||||
),
|
|
||||||
|
|
||||||
SizedBox(height: 2,),
|
|
||||||
Visibility(
|
|
||||||
visible: item.product?.name?.contains('مرغ گرم') ?? false,
|
|
||||||
child: Assets.vec.hotChickenSvg.svg(width: 24,
|
|
||||||
height: 24,
|
|
||||||
colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn))),
|
|
||||||
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
flex: 2,
|
|
||||||
child: Text(
|
|
||||||
'${item.province}\n${item.city}',
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: AppFonts.yekan12.copyWith(color: AppColor.bgDark),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Icon(CupertinoIcons.chevron_down, size: 12),
|
|
||||||
SizedBox(width: 8),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
secondChild: Container(
|
|
||||||
padding: EdgeInsets.fromLTRB(8, 12, 14, 12),
|
|
||||||
|
|
||||||
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(8)),
|
|
||||||
child: Column(
|
|
||||||
spacing: 8,
|
|
||||||
children: [
|
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
|
||||||
GestureDetector(
|
|
||||||
onTap: () {
|
|
||||||
controller.setEditData(item);
|
|
||||||
Get.bottomSheet(
|
|
||||||
addPurchasedInformationBottomSheet(true),
|
|
||||||
isScrollControlled: true,
|
|
||||||
).whenComplete(() {
|
|
||||||
controller.resetSubmitForm();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
child: Assets.vec.editSvg.svg(
|
|
||||||
width: 20,
|
|
||||||
height: 20,
|
|
||||||
colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
|
|
||||||
Text(
|
|
||||||
'${item.province}-${item.city}',
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
style: AppFonts.yekan16.copyWith(color: AppColor.greenDark),
|
|
||||||
),
|
|
||||||
|
|
||||||
GestureDetector(
|
|
||||||
onTap: () {
|
|
||||||
// buildDeleteDialog(
|
|
||||||
// onConfirm: () => controller.deleteStewardPurchaseOutOfProvince(item.key!),
|
|
||||||
// );
|
|
||||||
},
|
|
||||||
child: Assets.vec.trashSvg.svg(
|
|
||||||
width: 20,
|
|
||||||
height: 20,
|
|
||||||
colorFilter: ColorFilter.mode(AppColor.error, BlendMode.srcIn),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
Container(
|
|
||||||
height: 32,
|
|
||||||
padding: EdgeInsets.symmetric(horizontal: 4),
|
|
||||||
decoration: ShapeDecoration(
|
|
||||||
color: AppColor.blueLight,
|
|
||||||
shape: RoundedRectangleBorder(
|
|
||||||
side: BorderSide(width: 1, color: AppColor.blueLightHover),
|
|
||||||
borderRadius: BorderRadius.circular(8),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
child: buildRow('تاریخ', item.date?.formattedJalaliDateYHMS ?? 'N/A'),
|
|
||||||
),
|
|
||||||
|
|
||||||
buildRow('مشخصات فروشنده', '${item.killHouseName} - ${item.killHouseMobile ?? 'N/A'}'),
|
|
||||||
buildRow('محصول', item.product?.name ?? 'N/A'),
|
|
||||||
buildRow('وزن خریداری شده', '${item.weightOfCarcasses?.separatedByComma} کیلوگرم'),
|
|
||||||
Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
children: [
|
|
||||||
GestureDetector(
|
|
||||||
onTap: () {
|
|
||||||
Get.bottomSheet(
|
|
||||||
BaseBottomSheet(
|
|
||||||
height: 400,
|
|
||||||
child: Column(
|
|
||||||
spacing: 16,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
'بارنامه',
|
|
||||||
style: AppFonts.yekan16Bold.copyWith(color: AppColor.darkGreyDarkHover),
|
|
||||||
),
|
|
||||||
|
|
||||||
Image.network(
|
|
||||||
item.barImage ?? '',
|
|
||||||
fit: BoxFit.cover,
|
|
||||||
height: 300,
|
|
||||||
errorBuilder: (context, error, stackTrace) {
|
|
||||||
eLog(error.toString());
|
|
||||||
return Center(child: Text('خطایی پیش آمده!'));
|
|
||||||
},
|
|
||||||
loadingBuilder: (context, child, loadingProgress) {
|
|
||||||
if (loadingProgress == null) return child;
|
|
||||||
print('Loading progress: $loadingProgress');
|
|
||||||
return CupertinoActivityIndicator();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
child: Text(
|
|
||||||
'مشاهده بارنامه', style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal)),
|
|
||||||
),
|
|
||||||
Icon(CupertinoIcons.chevron_up, size: 12),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
crossFadeState: expandList.contains(index) ? CrossFadeState.showSecond : CrossFadeState.showFirst,
|
|
||||||
duration: Duration(milliseconds: 300),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Positioned(
|
|
||||||
right: -12,
|
|
||||||
child: Container(
|
|
||||||
width: index < 999 ? 24 : null,
|
|
||||||
height: index < 999 ? 24 : null,
|
|
||||||
padding: EdgeInsets.all(2),
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: AppColor.greenLightHover,
|
|
||||||
borderRadius: BorderRadius.circular(4),
|
|
||||||
border: Border.all(width: 0.50, color: AppColor.greenDarkActive),
|
|
||||||
),
|
|
||||||
alignment: Alignment.center,
|
|
||||||
child: Text((index + 1).toString(), style: AppFonts.yekan12.copyWith(color: Colors.black)),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
Row routePageWidget() {
|
Row routePageWidget() {
|
||||||
return Row(
|
return Row(
|
||||||
children: [
|
children: [
|
||||||
@@ -431,246 +170,6 @@ class SalesOutOfProvincePage extends GetView<SalesOutOfProvinceLogic> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Widget addPurchasedInformationBottomSheet([bool isOnEdit = false]) {
|
|
||||||
return BaseBottomSheet(
|
|
||||||
child: SingleChildScrollView(
|
|
||||||
child: Form(
|
|
||||||
key: controller.formKey,
|
|
||||||
child: Column(
|
|
||||||
spacing: 16,
|
|
||||||
children: [
|
|
||||||
Text(
|
|
||||||
isOnEdit ? 'ویرایش اطلاعات خرید' : 'ثبت اطلاعات خرید',
|
|
||||||
style: AppFonts.yekan16Bold.copyWith(color: AppColor.darkGreyDarkHover),
|
|
||||||
),
|
|
||||||
_productTypeWidget(),
|
|
||||||
RTextField(
|
|
||||||
controller: controller.sellerNameController,
|
|
||||||
label: 'نام فروشنده',
|
|
||||||
borderColor: AppColor.darkGreyLight,
|
|
||||||
),
|
|
||||||
RTextField(
|
|
||||||
controller: controller.sellerPhoneController,
|
|
||||||
label: 'تلفن فروشنده',
|
|
||||||
keyboardType: TextInputType.phone,
|
|
||||||
borderColor: AppColor.darkGreyLight,
|
|
||||||
maxLength: 11,
|
|
||||||
validator: (value) {
|
|
||||||
if (value == null || value.isEmpty) {
|
|
||||||
return 'لطفاً شماره موبایل را وارد کنید';
|
|
||||||
}
|
|
||||||
// حذف کاماها برای اعتبارسنجی
|
|
||||||
String cleaned = value.replaceAll(',', '');
|
|
||||||
if (cleaned.length != 11) {
|
|
||||||
return 'شماره موبایل باید ۱۱ رقم باشد';
|
|
||||||
}
|
|
||||||
if (!cleaned.startsWith('09')) {
|
|
||||||
return 'شماره موبایل باید با 09 شروع شود';
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
},
|
|
||||||
),
|
|
||||||
_provinceWidget(),
|
|
||||||
_cityWidget(),
|
|
||||||
RTextField(
|
|
||||||
controller: controller.carcassWeightController,
|
|
||||||
label: 'وزن لاشه',
|
|
||||||
keyboardType: TextInputType.number,
|
|
||||||
borderColor: AppColor.darkGreyLight,
|
|
||||||
inputFormatters: [FilteringTextInputFormatter.digitsOnly, SeparatorInputFormatter()],
|
|
||||||
),
|
|
||||||
_imageCarcasesWidget(isOnEdit),
|
|
||||||
submitButtonWidget(isOnEdit),
|
|
||||||
SizedBox(),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
/* Widget submitButtonWidget(bool isOnEdit) {
|
|
||||||
return ObxValue((data) {
|
|
||||||
return RElevated(
|
|
||||||
text: isOnEdit ? 'ویرایش' : 'ثبت خرید',
|
|
||||||
onPressed: data.value
|
|
||||||
? () async {
|
|
||||||
var res = await controller.createStewardPurchaseOutOfProvince();
|
|
||||||
if (res) {
|
|
||||||
Get.back();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
: null,
|
|
||||||
height: 40,
|
|
||||||
);
|
|
||||||
}, controller.isSubmitButtonEnabled);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
Widget _productTypeWidget() {
|
|
||||||
tLog(controller.outOfTheProvinceLogic.rolesProductsModel);
|
|
||||||
iLog(controller.selectedProduct.value);
|
|
||||||
return Obx(() {
|
|
||||||
return OverlayDropdownWidget<ProductModel>(
|
|
||||||
items: controller.outOfTheProvinceLogic.rolesProductsModel,
|
|
||||||
onChanged: (value) {
|
|
||||||
controller.selectedProduct.value = value;
|
|
||||||
},
|
|
||||||
selectedItem: controller.selectedProduct.value,
|
|
||||||
initialValue: controller.selectedProduct.value,
|
|
||||||
itemBuilder: (item) => Text(item.name ?? 'بدون نام'),
|
|
||||||
labelBuilder: (item) => Text(item?.name ?? 'انتخاب محصول'),
|
|
||||||
);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget _provinceWidget() {
|
|
||||||
return Obx(() {
|
|
||||||
return OverlayDropdownWidget<IranProvinceCityModel>(
|
|
||||||
items: controller.rootLogic.provinces,
|
|
||||||
onChanged: (value) {
|
|
||||||
controller.selectedProvince.value = value;
|
|
||||||
print('Selected Product: ${value.name}');
|
|
||||||
},
|
|
||||||
selectedItem: controller.selectedProvince.value,
|
|
||||||
itemBuilder: (item) => Text(item.name ?? 'بدون نام'),
|
|
||||||
labelBuilder: (item) => Text(item?.name ?? 'انتخاب استان'),
|
|
||||||
);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
Widget _cityWidget() {
|
|
||||||
return ObxValue((data) {
|
|
||||||
return OverlayDropdownWidget<IranProvinceCityModel>(
|
|
||||||
items: data,
|
|
||||||
onChanged: (value) {
|
|
||||||
controller.selectedCity.value = value;
|
|
||||||
print('Selected Product: ${value.name}');
|
|
||||||
},
|
|
||||||
selectedItem: controller.selectedCity.value,
|
|
||||||
itemBuilder: (item) => Text(item.name ?? 'بدون نام'),
|
|
||||||
labelBuilder: (item) => Text(item?.name ?? 'انتخاب شهر'),
|
|
||||||
);
|
|
||||||
}, controller.cites);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* SizedBox _imageCarcasesWidget(bool isOnEdit) {
|
|
||||||
return SizedBox(
|
|
||||||
width: Get.width,
|
|
||||||
height: 250,
|
|
||||||
child: Card(
|
|
||||||
color: Colors.white,
|
|
||||||
child: Padding(
|
|
||||||
padding: const EdgeInsets.all(16.0),
|
|
||||||
child: Column(
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
child: ObxValue((data) {
|
|
||||||
return Container(
|
|
||||||
width: Get.width,
|
|
||||||
decoration: BoxDecoration(color: AppColor.lightGreyNormal, borderRadius: BorderRadius.circular(8)),
|
|
||||||
child: Center(
|
|
||||||
child: isOnEdit
|
|
||||||
? Image.network(controller.editImageUrl.value ?? '')
|
|
||||||
: data.value == null
|
|
||||||
? Assets.images.placeHolder.image(height: 150, width: 200)
|
|
||||||
: Image.file(File(data.value!.path), fit: BoxFit.cover),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}, controller.selectedImage),
|
|
||||||
),
|
|
||||||
SizedBox(height: 15),
|
|
||||||
Container(
|
|
||||||
width: Get.width,
|
|
||||||
height: 40,
|
|
||||||
child: Row(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
Text('تصویر بار', style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal)),
|
|
||||||
Spacer(),
|
|
||||||
GestureDetector(
|
|
||||||
onTap: () async {
|
|
||||||
controller.selectedImage.value = await controller.imagePicker.pickImage(
|
|
||||||
source: ImageSource.camera,
|
|
||||||
imageQuality: 60,
|
|
||||||
maxWidth: 1080,
|
|
||||||
maxHeight: 720,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
child: Container(
|
|
||||||
decoration: ShapeDecoration(
|
|
||||||
color: AppColor.blueNormal,
|
|
||||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
|
|
||||||
),
|
|
||||||
padding: EdgeInsetsGeometry.symmetric(horizontal: 6, vertical: 4),
|
|
||||||
child: Row(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
Text('دوربین', style: AppFonts.yekan14.copyWith(color: Colors.white)),
|
|
||||||
SizedBox(width: 8),
|
|
||||||
Icon(CupertinoIcons.camera, color: Colors.white),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(width: 16),
|
|
||||||
GestureDetector(
|
|
||||||
onTap: () async {
|
|
||||||
controller.selectedImage.value = await controller.imagePicker.pickImage(
|
|
||||||
source: ImageSource.gallery,
|
|
||||||
imageQuality: 60,
|
|
||||||
maxWidth: 1080,
|
|
||||||
maxHeight: 720,
|
|
||||||
);
|
|
||||||
},
|
|
||||||
child: Container(
|
|
||||||
decoration: ShapeDecoration(
|
|
||||||
color: AppColor.blueNormal,
|
|
||||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
|
|
||||||
),
|
|
||||||
padding: EdgeInsetsGeometry.symmetric(horizontal: 6, vertical: 4),
|
|
||||||
child: Row(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
Text('گالری', style: AppFonts.yekan14.copyWith(color: Colors.white)),
|
|
||||||
SizedBox(width: 8),
|
|
||||||
Icon(CupertinoIcons.photo, color: Colors.white),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}*/
|
|
||||||
|
|
||||||
/* Future<void> buildDeleteDialog({required Future<void> Function() onConfirm}) async {
|
|
||||||
await Get.defaultDialog(
|
|
||||||
title: 'حذف خرید',
|
|
||||||
middleText: 'آیا از حذف این خرید مطمئن هستید؟',
|
|
||||||
confirm: ElevatedButton(
|
|
||||||
style: ElevatedButton.styleFrom(backgroundColor: AppColor.error, foregroundColor: Colors.white),
|
|
||||||
onPressed: () async {
|
|
||||||
await onConfirm();
|
|
||||||
Get.back();
|
|
||||||
},
|
|
||||||
child: Text('بله'),
|
|
||||||
),
|
|
||||||
cancel: ElevatedButton(
|
|
||||||
onPressed: () {
|
|
||||||
Get.back();
|
|
||||||
},
|
|
||||||
child: Text('خیر'),
|
|
||||||
),
|
|
||||||
).whenComplete(() => controller.getStewardPurchaseOutOfProvince());
|
|
||||||
}
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
Widget filterBottomSheet() {
|
Widget filterBottomSheet() {
|
||||||
return BaseBottomSheet(
|
return BaseBottomSheet(
|
||||||
height: 250,
|
height: 250,
|
||||||
@@ -806,5 +305,4 @@ class SalesOutOfProvincePage extends GetView<SalesOutOfProvinceLogic> {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,9 +28,8 @@ Map<String, dynamic> buildQueryParams({
|
|||||||
params['search'] = search;
|
params['search'] = search;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (value != null) {
|
params['value'] = value ?? '';
|
||||||
params['value'] = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (page != null) {
|
if (page != null) {
|
||||||
params['page'] = page;
|
params['page'] = page;
|
||||||
|
|||||||
@@ -3,9 +3,11 @@ import 'package:intl/intl.dart';
|
|||||||
extension XString on String {
|
extension XString on String {
|
||||||
String get separatedByComma {
|
String get separatedByComma {
|
||||||
final formatter = NumberFormat('#,###');
|
final formatter = NumberFormat('#,###');
|
||||||
return formatter.format(this);
|
final number = num.tryParse(this);
|
||||||
|
return number != null ? formatter.format(number) : this;
|
||||||
}
|
}
|
||||||
get clearComma{
|
|
||||||
|
get clearComma {
|
||||||
return replaceAll(RegExp(r'\D'), '');
|
return replaceAll(RegExp(r'\D'), '');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user