feat : sale in the province
This commit is contained in:
@@ -6,84 +6,71 @@ part 'allocated_made.g.dart';
|
||||
@freezed
|
||||
abstract class AllocatedMadeModel with _$AllocatedMadeModel {
|
||||
factory AllocatedMadeModel({
|
||||
int? count,
|
||||
String? next,
|
||||
String? previous,
|
||||
List<AllocatedMadeResult>? results,
|
||||
int? id,
|
||||
Product? product,
|
||||
dynamic killHouse,
|
||||
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;
|
||||
|
||||
factory AllocatedMadeModel.fromJson(Map<String, dynamic> 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
|
||||
abstract class Product with _$Product {
|
||||
factory Product({
|
||||
int? weight_average,
|
||||
int? weightAverage,
|
||||
}) = _Product;
|
||||
|
||||
factory Product.fromJson(Map<String, dynamic> json) =>
|
||||
@@ -96,68 +83,68 @@ abstract class Steward with _$Steward {
|
||||
int? id,
|
||||
User? user,
|
||||
Address? address,
|
||||
Activity? guild_area_activity,
|
||||
Activity? guild_type_activity,
|
||||
List<dynamic>? kill_house,
|
||||
List<dynamic>? steward_kill_house,
|
||||
Activity? guildAreaActivity,
|
||||
Activity? guildTypeActivity,
|
||||
List<dynamic>? killHouse,
|
||||
List<dynamic>? stewardKillHouse,
|
||||
List<dynamic>? stewards,
|
||||
PosStatus? get_pos_status,
|
||||
PosStatus? getPosStatus,
|
||||
String? key,
|
||||
String? create_date,
|
||||
String? modify_date,
|
||||
String? createDate,
|
||||
String? modifyDate,
|
||||
bool? trash,
|
||||
dynamic user_id_foreign_key,
|
||||
dynamic address_id_foreign_key,
|
||||
dynamic user_bank_id_foreign_key,
|
||||
dynamic wallet_id_foreign_key,
|
||||
dynamic provincial_government_id_key,
|
||||
dynamic identity_documents,
|
||||
dynamic userIdForeignKey,
|
||||
dynamic addressIdForeignKey,
|
||||
dynamic userBankIdForeignKey,
|
||||
dynamic walletIdForeignKey,
|
||||
dynamic provincialGovernmentIdKey,
|
||||
dynamic identityDocuments,
|
||||
bool? active,
|
||||
int? city_number,
|
||||
String? city_name,
|
||||
String? guilds_id,
|
||||
String? license_number,
|
||||
String? guilds_name,
|
||||
int? cityNumber,
|
||||
String? cityName,
|
||||
String? guildsId,
|
||||
String? licenseNumber,
|
||||
String? guildsName,
|
||||
String? phone,
|
||||
String? type_activity,
|
||||
String? area_activity,
|
||||
int? province_number,
|
||||
String? province_name,
|
||||
String? typeActivity,
|
||||
String? areaActivity,
|
||||
int? provinceNumber,
|
||||
String? provinceName,
|
||||
bool? steward,
|
||||
bool? has_pos,
|
||||
dynamic centers_allocation,
|
||||
dynamic kill_house_centers_allocation,
|
||||
dynamic allocation_limit,
|
||||
bool? limitation_allocation,
|
||||
String? registerar_role,
|
||||
String? registerar_fullname,
|
||||
String? registerar_mobile,
|
||||
bool? kill_house_register,
|
||||
bool? steward_register,
|
||||
bool? guilds_room_register,
|
||||
bool? pos_company_register,
|
||||
String? province_accept_state,
|
||||
String? province_message,
|
||||
bool? hasPos,
|
||||
dynamic centersAllocation,
|
||||
dynamic killHouseCentersAllocation,
|
||||
dynamic allocationLimit,
|
||||
bool? limitationAllocation,
|
||||
String? registerarRole,
|
||||
String? registerarFullname,
|
||||
String? registerarMobile,
|
||||
bool? killHouseRegister,
|
||||
bool? stewardRegister,
|
||||
bool? guildsRoomRegister,
|
||||
bool? posCompanyRegister,
|
||||
String? provinceAcceptState,
|
||||
String? provinceMessage,
|
||||
String? condition,
|
||||
String? description_condition,
|
||||
bool? steward_active,
|
||||
dynamic steward_allocation_limit,
|
||||
bool? steward_limitation_allocation,
|
||||
String? descriptionCondition,
|
||||
bool? stewardActive,
|
||||
dynamic stewardAllocationLimit,
|
||||
bool? stewardLimitationAllocation,
|
||||
bool? license,
|
||||
dynamic license_form,
|
||||
dynamic license_file,
|
||||
String? reviewer_role,
|
||||
String? reviewer_fullname,
|
||||
String? reviewer_mobile,
|
||||
String? checker_message,
|
||||
bool? final_accept,
|
||||
bool? temporary_registration,
|
||||
String? created_by,
|
||||
String? modified_by,
|
||||
dynamic user_bank_info,
|
||||
dynamic licenseForm,
|
||||
dynamic licenseFile,
|
||||
String? reviewerRole,
|
||||
String? reviewerFullname,
|
||||
String? reviewerMobile,
|
||||
String? checkerMessage,
|
||||
bool? finalAccept,
|
||||
bool? temporaryRegistration,
|
||||
String? createdBy,
|
||||
String? modifiedBy,
|
||||
dynamic userBankInfo,
|
||||
int? wallet,
|
||||
List<dynamic>? cars,
|
||||
List<dynamic>? user_level,
|
||||
List<dynamic>? userLevel,
|
||||
}) = _Steward;
|
||||
|
||||
factory Steward.fromJson(Map<String, dynamic> json) =>
|
||||
@@ -168,10 +155,10 @@ abstract class Steward with _$Steward {
|
||||
abstract class User with _$User {
|
||||
factory User({
|
||||
String? fullname,
|
||||
String? first_name,
|
||||
String? last_name,
|
||||
String? firstName,
|
||||
String? lastName,
|
||||
String? mobile,
|
||||
String? national_id,
|
||||
String? nationalId,
|
||||
String? city,
|
||||
}) = _User;
|
||||
|
||||
@@ -185,7 +172,7 @@ abstract class Address with _$Address {
|
||||
Province? province,
|
||||
Province? city,
|
||||
String? address,
|
||||
String? postal_code,
|
||||
String? postalCode,
|
||||
}) = _Address;
|
||||
|
||||
factory Address.fromJson(Map<String, dynamic> json) =>
|
||||
@@ -217,11 +204,11 @@ abstract class Activity with _$Activity {
|
||||
@freezed
|
||||
abstract class PosStatus with _$PosStatus {
|
||||
factory PosStatus({
|
||||
int? len_active_sessions,
|
||||
bool? has_pons,
|
||||
bool? has_active_pons,
|
||||
int? lenActiveSessions,
|
||||
bool? hasPons,
|
||||
bool? hasActivePons,
|
||||
}) = _PosStatus;
|
||||
|
||||
factory PosStatus.fromJson(Map<String, dynamic> json) =>
|
||||
_$PosStatusFromJson(json);
|
||||
}
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -6,159 +6,139 @@ part of 'allocated_made.dart';
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_AllocatedMadeModel _$AllocatedMadeModelFromJson(Map<String, dynamic> json) =>
|
||||
_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(
|
||||
_AllocatedMadeModel _$AllocatedMadeModelFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _AllocatedMadeResult(
|
||||
) => _AllocatedMadeModel(
|
||||
id: (json['id'] as num?)?.toInt(),
|
||||
product: json['product'] == null
|
||||
? null
|
||||
: Product.fromJson(json['product'] as Map<String, dynamic>),
|
||||
kill_house: json['kill_house'],
|
||||
to_kill_house: json['to_kill_house'],
|
||||
killHouse: json['kill_house'],
|
||||
toKillHouse: json['to_kill_house'],
|
||||
steward: json['steward'] == null
|
||||
? null
|
||||
: Steward.fromJson(json['steward'] as Map<String, dynamic>),
|
||||
to_steward: json['to_steward'],
|
||||
toSteward: json['to_steward'],
|
||||
guilds: json['guilds'],
|
||||
to_guilds: json['to_guilds'] == null
|
||||
toGuilds: json['to_guilds'] == null
|
||||
? null
|
||||
: Steward.fromJson(json['to_guilds'] as Map<String, dynamic>),
|
||||
to_cold_house: json['to_cold_house'],
|
||||
index_weight: (json['index_weight'] as num?)?.toInt(),
|
||||
date_timestamp: (json['date_timestamp'] as num?)?.toInt(),
|
||||
new_state: (json['new_state'] as num?)?.toInt(),
|
||||
new_receiver_state: (json['new_receiver_state'] as num?)?.toInt(),
|
||||
new_allocation_state: (json['new_allocation_state'] as num?)?.toInt(),
|
||||
toColdHouse: json['to_cold_house'],
|
||||
indexWeight: (json['index_weight'] as num?)?.toInt(),
|
||||
dateTimestamp: (json['date_timestamp'] as num?)?.toInt(),
|
||||
newState: (json['new_state'] as num?)?.toInt(),
|
||||
newReceiverState: (json['new_receiver_state'] as num?)?.toInt(),
|
||||
newAllocationState: (json['new_allocation_state'] as num?)?.toInt(),
|
||||
key: json['key'] as String?,
|
||||
create_date: json['create_date'] as String?,
|
||||
modify_date: json['modify_date'] as String?,
|
||||
createDate: json['create_date'] as String?,
|
||||
modifyDate: json['modify_date'] as String?,
|
||||
trash: json['trash'] as bool?,
|
||||
number_of_carcasses: (json['number_of_carcasses'] as num?)?.toInt(),
|
||||
real_number_of_carcasses: (json['real_number_of_carcasses'] as num?)?.toInt(),
|
||||
receiver_real_number_of_carcasses:
|
||||
numberOfCarcasses: (json['number_of_carcasses'] as num?)?.toInt(),
|
||||
realNumberOfCarcasses: (json['real_number_of_carcasses'] as num?)?.toInt(),
|
||||
receiverRealNumberOfCarcasses:
|
||||
(json['receiver_real_number_of_carcasses'] as num?)?.toInt(),
|
||||
weight_of_carcasses: (json['weight_of_carcasses'] as num?)?.toInt(),
|
||||
real_weight_of_carcasses: (json['real_weight_of_carcasses'] as num?)?.toInt(),
|
||||
receiver_real_weight_of_carcasses:
|
||||
weightOfCarcasses: (json['weight_of_carcasses'] as num?)?.toInt(),
|
||||
realWeightOfCarcasses: (json['real_weight_of_carcasses'] as num?)?.toInt(),
|
||||
receiverRealWeightOfCarcasses:
|
||||
(json['receiver_real_weight_of_carcasses'] as num?)?.toInt(),
|
||||
weight_loss_of_carcasses: (json['weight_loss_of_carcasses'] as num?)?.toInt(),
|
||||
final_registration: json['final_registration'] as bool?,
|
||||
sell_type: json['sell_type'] as String?,
|
||||
product_name: json['product_name'] as String?,
|
||||
seller_type: json['seller_type'] as String?,
|
||||
weightLossOfCarcasses: (json['weight_loss_of_carcasses'] as num?)?.toInt(),
|
||||
finalRegistration: json['final_registration'] as bool?,
|
||||
sellType: json['sell_type'] as String?,
|
||||
productName: json['product_name'] as String?,
|
||||
sellerType: json['seller_type'] as String?,
|
||||
type: json['type'] as String?,
|
||||
sale_type: json['sale_type'] as String?,
|
||||
allocation_type: json['allocation_type'] as String?,
|
||||
system_registration_code: json['system_registration_code'] as bool?,
|
||||
registration_code: (json['registration_code'] as num?)?.toInt(),
|
||||
saleType: json['sale_type'] as String?,
|
||||
allocationType: json['allocation_type'] as String?,
|
||||
systemRegistrationCode: json['system_registration_code'] as bool?,
|
||||
registrationCode: (json['registration_code'] as num?)?.toInt(),
|
||||
amount: (json['amount'] as num?)?.toInt(),
|
||||
total_amount: (json['total_amount'] as num?)?.toInt(),
|
||||
total_amount_paid: (json['total_amount_paid'] as num?)?.toInt(),
|
||||
total_amount_remain: (json['total_amount_remain'] as num?)?.toInt(),
|
||||
logged_registration_code: json['logged_registration_code'] as String?,
|
||||
totalAmount: (json['total_amount'] as num?)?.toInt(),
|
||||
totalAmountPaid: (json['total_amount_paid'] as num?)?.toInt(),
|
||||
totalAmountRemain: (json['total_amount_remain'] as num?)?.toInt(),
|
||||
loggedRegistrationCode: json['logged_registration_code'] as String?,
|
||||
state: json['state'] as String?,
|
||||
receiver_state: json['receiver_state'] as String?,
|
||||
allocation_state: json['allocation_state'] as String?,
|
||||
receiverState: json['receiver_state'] as String?,
|
||||
allocationState: json['allocation_state'] as String?,
|
||||
date: json['date'] as String?,
|
||||
role: json['role'] as String?,
|
||||
steward_temp_key: json['steward_temp_key'] as String?,
|
||||
approved_price_status: json['approved_price_status'] as bool?,
|
||||
calculate_status: json['calculate_status'] as bool?,
|
||||
temporary_trash: json['temporary_trash'] as bool?,
|
||||
temporary_deleted: json['temporary_deleted'] as bool?,
|
||||
created_by: json['created_by'] as String?,
|
||||
modified_by: json['modified_by'] as String?,
|
||||
ware_house: json['ware_house'],
|
||||
steward_ware_house: json['steward_ware_house'],
|
||||
stewardTempKey: json['steward_temp_key'] as String?,
|
||||
approvedPriceStatus: json['approved_price_status'] as bool?,
|
||||
calculateStatus: json['calculate_status'] as bool?,
|
||||
temporaryTrash: json['temporary_trash'] as bool?,
|
||||
temporaryDeleted: json['temporary_deleted'] as bool?,
|
||||
createdBy: json['created_by'] as String?,
|
||||
modifiedBy: json['modified_by'] as String?,
|
||||
wareHouse: json['ware_house'],
|
||||
stewardWareHouse: json['steward_ware_house'],
|
||||
car: json['car'],
|
||||
dispenser: json['dispenser'],
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$AllocatedMadeResultToJson(
|
||||
_AllocatedMadeResult instance,
|
||||
Map<String, dynamic> _$AllocatedMadeModelToJson(
|
||||
_AllocatedMadeModel instance,
|
||||
) => <String, dynamic>{
|
||||
'id': instance.id,
|
||||
'product': instance.product,
|
||||
'kill_house': instance.kill_house,
|
||||
'to_kill_house': instance.to_kill_house,
|
||||
'kill_house': instance.killHouse,
|
||||
'to_kill_house': instance.toKillHouse,
|
||||
'steward': instance.steward,
|
||||
'to_steward': instance.to_steward,
|
||||
'to_steward': instance.toSteward,
|
||||
'guilds': instance.guilds,
|
||||
'to_guilds': instance.to_guilds,
|
||||
'to_cold_house': instance.to_cold_house,
|
||||
'index_weight': instance.index_weight,
|
||||
'date_timestamp': instance.date_timestamp,
|
||||
'new_state': instance.new_state,
|
||||
'new_receiver_state': instance.new_receiver_state,
|
||||
'new_allocation_state': instance.new_allocation_state,
|
||||
'to_guilds': instance.toGuilds,
|
||||
'to_cold_house': instance.toColdHouse,
|
||||
'index_weight': instance.indexWeight,
|
||||
'date_timestamp': instance.dateTimestamp,
|
||||
'new_state': instance.newState,
|
||||
'new_receiver_state': instance.newReceiverState,
|
||||
'new_allocation_state': instance.newAllocationState,
|
||||
'key': instance.key,
|
||||
'create_date': instance.create_date,
|
||||
'modify_date': instance.modify_date,
|
||||
'create_date': instance.createDate,
|
||||
'modify_date': instance.modifyDate,
|
||||
'trash': instance.trash,
|
||||
'number_of_carcasses': instance.number_of_carcasses,
|
||||
'real_number_of_carcasses': instance.real_number_of_carcasses,
|
||||
'receiver_real_number_of_carcasses':
|
||||
instance.receiver_real_number_of_carcasses,
|
||||
'weight_of_carcasses': instance.weight_of_carcasses,
|
||||
'real_weight_of_carcasses': instance.real_weight_of_carcasses,
|
||||
'receiver_real_weight_of_carcasses':
|
||||
instance.receiver_real_weight_of_carcasses,
|
||||
'weight_loss_of_carcasses': instance.weight_loss_of_carcasses,
|
||||
'final_registration': instance.final_registration,
|
||||
'sell_type': instance.sell_type,
|
||||
'product_name': instance.product_name,
|
||||
'seller_type': instance.seller_type,
|
||||
'number_of_carcasses': instance.numberOfCarcasses,
|
||||
'real_number_of_carcasses': instance.realNumberOfCarcasses,
|
||||
'receiver_real_number_of_carcasses': instance.receiverRealNumberOfCarcasses,
|
||||
'weight_of_carcasses': instance.weightOfCarcasses,
|
||||
'real_weight_of_carcasses': instance.realWeightOfCarcasses,
|
||||
'receiver_real_weight_of_carcasses': instance.receiverRealWeightOfCarcasses,
|
||||
'weight_loss_of_carcasses': instance.weightLossOfCarcasses,
|
||||
'final_registration': instance.finalRegistration,
|
||||
'sell_type': instance.sellType,
|
||||
'product_name': instance.productName,
|
||||
'seller_type': instance.sellerType,
|
||||
'type': instance.type,
|
||||
'sale_type': instance.sale_type,
|
||||
'allocation_type': instance.allocation_type,
|
||||
'system_registration_code': instance.system_registration_code,
|
||||
'registration_code': instance.registration_code,
|
||||
'sale_type': instance.saleType,
|
||||
'allocation_type': instance.allocationType,
|
||||
'system_registration_code': instance.systemRegistrationCode,
|
||||
'registration_code': instance.registrationCode,
|
||||
'amount': instance.amount,
|
||||
'total_amount': instance.total_amount,
|
||||
'total_amount_paid': instance.total_amount_paid,
|
||||
'total_amount_remain': instance.total_amount_remain,
|
||||
'logged_registration_code': instance.logged_registration_code,
|
||||
'total_amount': instance.totalAmount,
|
||||
'total_amount_paid': instance.totalAmountPaid,
|
||||
'total_amount_remain': instance.totalAmountRemain,
|
||||
'logged_registration_code': instance.loggedRegistrationCode,
|
||||
'state': instance.state,
|
||||
'receiver_state': instance.receiver_state,
|
||||
'allocation_state': instance.allocation_state,
|
||||
'receiver_state': instance.receiverState,
|
||||
'allocation_state': instance.allocationState,
|
||||
'date': instance.date,
|
||||
'role': instance.role,
|
||||
'steward_temp_key': instance.steward_temp_key,
|
||||
'approved_price_status': instance.approved_price_status,
|
||||
'calculate_status': instance.calculate_status,
|
||||
'temporary_trash': instance.temporary_trash,
|
||||
'temporary_deleted': instance.temporary_deleted,
|
||||
'created_by': instance.created_by,
|
||||
'modified_by': instance.modified_by,
|
||||
'ware_house': instance.ware_house,
|
||||
'steward_ware_house': instance.steward_ware_house,
|
||||
'steward_temp_key': instance.stewardTempKey,
|
||||
'approved_price_status': instance.approvedPriceStatus,
|
||||
'calculate_status': instance.calculateStatus,
|
||||
'temporary_trash': instance.temporaryTrash,
|
||||
'temporary_deleted': instance.temporaryDeleted,
|
||||
'created_by': instance.createdBy,
|
||||
'modified_by': instance.modifiedBy,
|
||||
'ware_house': instance.wareHouse,
|
||||
'steward_ware_house': instance.stewardWareHouse,
|
||||
'car': instance.car,
|
||||
'dispenser': instance.dispenser,
|
||||
};
|
||||
|
||||
_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>{
|
||||
'weight_average': instance.weight_average,
|
||||
'weight_average': instance.weightAverage,
|
||||
};
|
||||
|
||||
_Steward _$StewardFromJson(Map<String, dynamic> json) => _Steward(
|
||||
@@ -169,159 +149,159 @@ _Steward _$StewardFromJson(Map<String, dynamic> json) => _Steward(
|
||||
address: json['address'] == null
|
||||
? null
|
||||
: Address.fromJson(json['address'] as Map<String, dynamic>),
|
||||
guild_area_activity: json['guild_area_activity'] == null
|
||||
guildAreaActivity: json['guild_area_activity'] == null
|
||||
? null
|
||||
: 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
|
||||
: Activity.fromJson(json['guild_type_activity'] as Map<String, dynamic>),
|
||||
kill_house: json['kill_house'] as List<dynamic>?,
|
||||
steward_kill_house: json['steward_kill_house'] as List<dynamic>?,
|
||||
killHouse: json['kill_house'] as List<dynamic>?,
|
||||
stewardKillHouse: json['steward_kill_house'] as List<dynamic>?,
|
||||
stewards: json['stewards'] as List<dynamic>?,
|
||||
get_pos_status: json['get_pos_status'] == null
|
||||
getPosStatus: json['get_pos_status'] == null
|
||||
? null
|
||||
: PosStatus.fromJson(json['get_pos_status'] as Map<String, dynamic>),
|
||||
key: json['key'] as String?,
|
||||
create_date: json['create_date'] as String?,
|
||||
modify_date: json['modify_date'] as String?,
|
||||
createDate: json['create_date'] as String?,
|
||||
modifyDate: json['modify_date'] as String?,
|
||||
trash: json['trash'] as bool?,
|
||||
user_id_foreign_key: json['user_id_foreign_key'],
|
||||
address_id_foreign_key: json['address_id_foreign_key'],
|
||||
user_bank_id_foreign_key: json['user_bank_id_foreign_key'],
|
||||
wallet_id_foreign_key: json['wallet_id_foreign_key'],
|
||||
provincial_government_id_key: json['provincial_government_id_key'],
|
||||
identity_documents: json['identity_documents'],
|
||||
userIdForeignKey: json['user_id_foreign_key'],
|
||||
addressIdForeignKey: json['address_id_foreign_key'],
|
||||
userBankIdForeignKey: json['user_bank_id_foreign_key'],
|
||||
walletIdForeignKey: json['wallet_id_foreign_key'],
|
||||
provincialGovernmentIdKey: json['provincial_government_id_key'],
|
||||
identityDocuments: json['identity_documents'],
|
||||
active: json['active'] as bool?,
|
||||
city_number: (json['city_number'] as num?)?.toInt(),
|
||||
city_name: json['city_name'] as String?,
|
||||
guilds_id: json['guilds_id'] as String?,
|
||||
license_number: json['license_number'] as String?,
|
||||
guilds_name: json['guilds_name'] as String?,
|
||||
cityNumber: (json['city_number'] as num?)?.toInt(),
|
||||
cityName: json['city_name'] as String?,
|
||||
guildsId: json['guilds_id'] as String?,
|
||||
licenseNumber: json['license_number'] as String?,
|
||||
guildsName: json['guilds_name'] as String?,
|
||||
phone: json['phone'] as String?,
|
||||
type_activity: json['type_activity'] as String?,
|
||||
area_activity: json['area_activity'] as String?,
|
||||
province_number: (json['province_number'] as num?)?.toInt(),
|
||||
province_name: json['province_name'] as String?,
|
||||
typeActivity: json['type_activity'] as String?,
|
||||
areaActivity: json['area_activity'] as String?,
|
||||
provinceNumber: (json['province_number'] as num?)?.toInt(),
|
||||
provinceName: json['province_name'] as String?,
|
||||
steward: json['steward'] as bool?,
|
||||
has_pos: json['has_pos'] as bool?,
|
||||
centers_allocation: json['centers_allocation'],
|
||||
kill_house_centers_allocation: json['kill_house_centers_allocation'],
|
||||
allocation_limit: json['allocation_limit'],
|
||||
limitation_allocation: json['limitation_allocation'] as bool?,
|
||||
registerar_role: json['registerar_role'] as String?,
|
||||
registerar_fullname: json['registerar_fullname'] as String?,
|
||||
registerar_mobile: json['registerar_mobile'] as String?,
|
||||
kill_house_register: json['kill_house_register'] as bool?,
|
||||
steward_register: json['steward_register'] as bool?,
|
||||
guilds_room_register: json['guilds_room_register'] as bool?,
|
||||
pos_company_register: json['pos_company_register'] as bool?,
|
||||
province_accept_state: json['province_accept_state'] as String?,
|
||||
province_message: json['province_message'] as String?,
|
||||
hasPos: json['has_pos'] as bool?,
|
||||
centersAllocation: json['centers_allocation'],
|
||||
killHouseCentersAllocation: json['kill_house_centers_allocation'],
|
||||
allocationLimit: json['allocation_limit'],
|
||||
limitationAllocation: json['limitation_allocation'] as bool?,
|
||||
registerarRole: json['registerar_role'] as String?,
|
||||
registerarFullname: json['registerar_fullname'] as String?,
|
||||
registerarMobile: json['registerar_mobile'] as String?,
|
||||
killHouseRegister: json['kill_house_register'] as bool?,
|
||||
stewardRegister: json['steward_register'] as bool?,
|
||||
guildsRoomRegister: json['guilds_room_register'] as bool?,
|
||||
posCompanyRegister: json['pos_company_register'] as bool?,
|
||||
provinceAcceptState: json['province_accept_state'] as String?,
|
||||
provinceMessage: json['province_message'] as String?,
|
||||
condition: json['condition'] as String?,
|
||||
description_condition: json['description_condition'] as String?,
|
||||
steward_active: json['steward_active'] as bool?,
|
||||
steward_allocation_limit: json['steward_allocation_limit'],
|
||||
steward_limitation_allocation: json['steward_limitation_allocation'] as bool?,
|
||||
descriptionCondition: json['description_condition'] as String?,
|
||||
stewardActive: json['steward_active'] as bool?,
|
||||
stewardAllocationLimit: json['steward_allocation_limit'],
|
||||
stewardLimitationAllocation: json['steward_limitation_allocation'] as bool?,
|
||||
license: json['license'] as bool?,
|
||||
license_form: json['license_form'],
|
||||
license_file: json['license_file'],
|
||||
reviewer_role: json['reviewer_role'] as String?,
|
||||
reviewer_fullname: json['reviewer_fullname'] as String?,
|
||||
reviewer_mobile: json['reviewer_mobile'] as String?,
|
||||
checker_message: json['checker_message'] as String?,
|
||||
final_accept: json['final_accept'] as bool?,
|
||||
temporary_registration: json['temporary_registration'] as bool?,
|
||||
created_by: json['created_by'] as String?,
|
||||
modified_by: json['modified_by'] as String?,
|
||||
user_bank_info: json['user_bank_info'],
|
||||
licenseForm: json['license_form'],
|
||||
licenseFile: json['license_file'],
|
||||
reviewerRole: json['reviewer_role'] as String?,
|
||||
reviewerFullname: json['reviewer_fullname'] as String?,
|
||||
reviewerMobile: json['reviewer_mobile'] as String?,
|
||||
checkerMessage: json['checker_message'] as String?,
|
||||
finalAccept: json['final_accept'] as bool?,
|
||||
temporaryRegistration: json['temporary_registration'] as bool?,
|
||||
createdBy: json['created_by'] as String?,
|
||||
modifiedBy: json['modified_by'] as String?,
|
||||
userBankInfo: json['user_bank_info'],
|
||||
wallet: (json['wallet'] as num?)?.toInt(),
|
||||
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>{
|
||||
'id': instance.id,
|
||||
'user': instance.user,
|
||||
'address': instance.address,
|
||||
'guild_area_activity': instance.guild_area_activity,
|
||||
'guild_type_activity': instance.guild_type_activity,
|
||||
'kill_house': instance.kill_house,
|
||||
'steward_kill_house': instance.steward_kill_house,
|
||||
'guild_area_activity': instance.guildAreaActivity,
|
||||
'guild_type_activity': instance.guildTypeActivity,
|
||||
'kill_house': instance.killHouse,
|
||||
'steward_kill_house': instance.stewardKillHouse,
|
||||
'stewards': instance.stewards,
|
||||
'get_pos_status': instance.get_pos_status,
|
||||
'get_pos_status': instance.getPosStatus,
|
||||
'key': instance.key,
|
||||
'create_date': instance.create_date,
|
||||
'modify_date': instance.modify_date,
|
||||
'create_date': instance.createDate,
|
||||
'modify_date': instance.modifyDate,
|
||||
'trash': instance.trash,
|
||||
'user_id_foreign_key': instance.user_id_foreign_key,
|
||||
'address_id_foreign_key': instance.address_id_foreign_key,
|
||||
'user_bank_id_foreign_key': instance.user_bank_id_foreign_key,
|
||||
'wallet_id_foreign_key': instance.wallet_id_foreign_key,
|
||||
'provincial_government_id_key': instance.provincial_government_id_key,
|
||||
'identity_documents': instance.identity_documents,
|
||||
'user_id_foreign_key': instance.userIdForeignKey,
|
||||
'address_id_foreign_key': instance.addressIdForeignKey,
|
||||
'user_bank_id_foreign_key': instance.userBankIdForeignKey,
|
||||
'wallet_id_foreign_key': instance.walletIdForeignKey,
|
||||
'provincial_government_id_key': instance.provincialGovernmentIdKey,
|
||||
'identity_documents': instance.identityDocuments,
|
||||
'active': instance.active,
|
||||
'city_number': instance.city_number,
|
||||
'city_name': instance.city_name,
|
||||
'guilds_id': instance.guilds_id,
|
||||
'license_number': instance.license_number,
|
||||
'guilds_name': instance.guilds_name,
|
||||
'city_number': instance.cityNumber,
|
||||
'city_name': instance.cityName,
|
||||
'guilds_id': instance.guildsId,
|
||||
'license_number': instance.licenseNumber,
|
||||
'guilds_name': instance.guildsName,
|
||||
'phone': instance.phone,
|
||||
'type_activity': instance.type_activity,
|
||||
'area_activity': instance.area_activity,
|
||||
'province_number': instance.province_number,
|
||||
'province_name': instance.province_name,
|
||||
'type_activity': instance.typeActivity,
|
||||
'area_activity': instance.areaActivity,
|
||||
'province_number': instance.provinceNumber,
|
||||
'province_name': instance.provinceName,
|
||||
'steward': instance.steward,
|
||||
'has_pos': instance.has_pos,
|
||||
'centers_allocation': instance.centers_allocation,
|
||||
'kill_house_centers_allocation': instance.kill_house_centers_allocation,
|
||||
'allocation_limit': instance.allocation_limit,
|
||||
'limitation_allocation': instance.limitation_allocation,
|
||||
'registerar_role': instance.registerar_role,
|
||||
'registerar_fullname': instance.registerar_fullname,
|
||||
'registerar_mobile': instance.registerar_mobile,
|
||||
'kill_house_register': instance.kill_house_register,
|
||||
'steward_register': instance.steward_register,
|
||||
'guilds_room_register': instance.guilds_room_register,
|
||||
'pos_company_register': instance.pos_company_register,
|
||||
'province_accept_state': instance.province_accept_state,
|
||||
'province_message': instance.province_message,
|
||||
'has_pos': instance.hasPos,
|
||||
'centers_allocation': instance.centersAllocation,
|
||||
'kill_house_centers_allocation': instance.killHouseCentersAllocation,
|
||||
'allocation_limit': instance.allocationLimit,
|
||||
'limitation_allocation': instance.limitationAllocation,
|
||||
'registerar_role': instance.registerarRole,
|
||||
'registerar_fullname': instance.registerarFullname,
|
||||
'registerar_mobile': instance.registerarMobile,
|
||||
'kill_house_register': instance.killHouseRegister,
|
||||
'steward_register': instance.stewardRegister,
|
||||
'guilds_room_register': instance.guildsRoomRegister,
|
||||
'pos_company_register': instance.posCompanyRegister,
|
||||
'province_accept_state': instance.provinceAcceptState,
|
||||
'province_message': instance.provinceMessage,
|
||||
'condition': instance.condition,
|
||||
'description_condition': instance.description_condition,
|
||||
'steward_active': instance.steward_active,
|
||||
'steward_allocation_limit': instance.steward_allocation_limit,
|
||||
'steward_limitation_allocation': instance.steward_limitation_allocation,
|
||||
'description_condition': instance.descriptionCondition,
|
||||
'steward_active': instance.stewardActive,
|
||||
'steward_allocation_limit': instance.stewardAllocationLimit,
|
||||
'steward_limitation_allocation': instance.stewardLimitationAllocation,
|
||||
'license': instance.license,
|
||||
'license_form': instance.license_form,
|
||||
'license_file': instance.license_file,
|
||||
'reviewer_role': instance.reviewer_role,
|
||||
'reviewer_fullname': instance.reviewer_fullname,
|
||||
'reviewer_mobile': instance.reviewer_mobile,
|
||||
'checker_message': instance.checker_message,
|
||||
'final_accept': instance.final_accept,
|
||||
'temporary_registration': instance.temporary_registration,
|
||||
'created_by': instance.created_by,
|
||||
'modified_by': instance.modified_by,
|
||||
'user_bank_info': instance.user_bank_info,
|
||||
'license_form': instance.licenseForm,
|
||||
'license_file': instance.licenseFile,
|
||||
'reviewer_role': instance.reviewerRole,
|
||||
'reviewer_fullname': instance.reviewerFullname,
|
||||
'reviewer_mobile': instance.reviewerMobile,
|
||||
'checker_message': instance.checkerMessage,
|
||||
'final_accept': instance.finalAccept,
|
||||
'temporary_registration': instance.temporaryRegistration,
|
||||
'created_by': instance.createdBy,
|
||||
'modified_by': instance.modifiedBy,
|
||||
'user_bank_info': instance.userBankInfo,
|
||||
'wallet': instance.wallet,
|
||||
'cars': instance.cars,
|
||||
'user_level': instance.user_level,
|
||||
'user_level': instance.userLevel,
|
||||
};
|
||||
|
||||
_User _$UserFromJson(Map<String, dynamic> json) => _User(
|
||||
fullname: json['fullname'] as String?,
|
||||
first_name: json['first_name'] as String?,
|
||||
last_name: json['last_name'] as String?,
|
||||
firstName: json['first_name'] as String?,
|
||||
lastName: json['last_name'] 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?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$UserToJson(_User instance) => <String, dynamic>{
|
||||
'fullname': instance.fullname,
|
||||
'first_name': instance.first_name,
|
||||
'last_name': instance.last_name,
|
||||
'first_name': instance.firstName,
|
||||
'last_name': instance.lastName,
|
||||
'mobile': instance.mobile,
|
||||
'national_id': instance.national_id,
|
||||
'national_id': instance.nationalId,
|
||||
'city': instance.city,
|
||||
};
|
||||
|
||||
@@ -333,14 +313,14 @@ _Address _$AddressFromJson(Map<String, dynamic> json) => _Address(
|
||||
? null
|
||||
: Province.fromJson(json['city'] as Map<String, dynamic>),
|
||||
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>{
|
||||
'province': instance.province,
|
||||
'city': instance.city,
|
||||
'address': instance.address,
|
||||
'postal_code': instance.postal_code,
|
||||
'postal_code': instance.postalCode,
|
||||
};
|
||||
|
||||
_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(
|
||||
len_active_sessions: (json['len_active_sessions'] as num?)?.toInt(),
|
||||
has_pons: json['has_pons'] as bool?,
|
||||
has_active_pons: json['has_active_pons'] as bool?,
|
||||
lenActiveSessions: (json['len_active_sessions'] as num?)?.toInt(),
|
||||
hasPons: json['has_pons'] as bool?,
|
||||
hasActivePons: json['has_active_pons'] as bool?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$PosStatusToJson(_PosStatus instance) =>
|
||||
<String, dynamic>{
|
||||
'len_active_sessions': instance.len_active_sessions,
|
||||
'has_pons': instance.has_pons,
|
||||
'has_active_pons': instance.has_active_pons,
|
||||
'len_active_sessions': instance.lenActiveSessions,
|
||||
'has_pons': instance.hasPons,
|
||||
'has_active_pons': instance.hasActivePons,
|
||||
};
|
||||
|
||||
@@ -47,9 +47,9 @@ abstract class ChickenRepository {
|
||||
required int page,
|
||||
});
|
||||
|
||||
Future<AllocatedMadeModel?> getAllocatedMade({
|
||||
Future<PaginationModel<AllocatedMadeModel>?> getAllocatedMade({
|
||||
required String token,
|
||||
required int page,
|
||||
Map<String, dynamic>? queryParameters,
|
||||
});
|
||||
|
||||
Future<void> confirmAllocation({
|
||||
@@ -71,7 +71,7 @@ abstract class ChickenRepository {
|
||||
|
||||
Future<List<GuildModel>?> getGuilds({
|
||||
required String token,
|
||||
required bool isFree,
|
||||
Map<String, dynamic>? queryParameters,
|
||||
});
|
||||
|
||||
Future<GuildProfile?> getProfile({required String token});
|
||||
|
||||
@@ -106,14 +106,18 @@ class ChickenRepositoryImpl implements ChickenRepository {
|
||||
}
|
||||
|
||||
@override
|
||||
Future<AllocatedMadeModel?> getAllocatedMade({
|
||||
Future<PaginationModel<AllocatedMadeModel>?> getAllocatedMade({
|
||||
required String token,
|
||||
required int page,
|
||||
Map<String, dynamic>? queryParameters,
|
||||
}) async {
|
||||
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'},
|
||||
fromJson: AllocatedMadeModel.fromJson,
|
||||
fromJson: (json) => PaginationModel<AllocatedMadeModel>.fromJson(
|
||||
json,
|
||||
(json) => AllocatedMadeModel.fromJson(json as Map<String, dynamic>),
|
||||
),
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
@@ -168,12 +172,12 @@ class ChickenRepositoryImpl implements ChickenRepository {
|
||||
@override
|
||||
Future<List<GuildModel>?> getGuilds({
|
||||
required String token,
|
||||
required bool isFree,
|
||||
Map<String, dynamic>? queryParameters,
|
||||
}) async {
|
||||
var res = await _httpClient.get(
|
||||
'/guilds/?role=Steward&free=$isFree',
|
||||
'/guilds/?',
|
||||
queryParameters: queryParameters,
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
|
||||
fromJsonList: (json) => json
|
||||
.map((item) => GuildModel.fromJson(item as Map<String, dynamic>))
|
||||
.toList(),
|
||||
|
||||
@@ -11,6 +11,14 @@ extension xStringUtils on String {
|
||||
|
||||
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 = {
|
||||
@@ -21,5 +29,5 @@ Map<String, String> utilsMap = {
|
||||
'free': 'آزاد',
|
||||
'pending': 'در انتظار',
|
||||
'accepted': 'تایید شده',
|
||||
'guild':'صنف'
|
||||
'guild': 'صنف',
|
||||
};
|
||||
|
||||
@@ -10,7 +10,8 @@ import 'package:rasadyar_core/core.dart';
|
||||
|
||||
class OutOfProvinceLogic extends GetxController {
|
||||
var rootLogic = Get.find<RootLogic>();
|
||||
Rxn<AllocatedMadeModel> allocatedMadeModel = Rxn<AllocatedMadeModel>();
|
||||
Rxn<List<AllocatedMadeModel>?> allocatedMadeModel =
|
||||
Rxn<List<AllocatedMadeModel>?>();
|
||||
RxList<ProductModel> rolesProductsModel = RxList<ProductModel>();
|
||||
|
||||
RxList<GuildModel> guildsModel = <GuildModel>[].obs;
|
||||
@@ -29,11 +30,16 @@ class OutOfProvinceLogic extends GetxController {
|
||||
safeCall(
|
||||
call: () async => await rootLogic.chickenRepository.getAllocatedMade(
|
||||
token: rootLogic.tokenService.accessToken.value!,
|
||||
page: 1,
|
||||
queryParameters: buildQueryParams(
|
||||
page: 1,
|
||||
pageSize: 20,
|
||||
search: 'filter',
|
||||
role: 'Steward',
|
||||
),
|
||||
),
|
||||
onSuccess: (result) {
|
||||
if (result != null) {
|
||||
allocatedMadeModel.value = result;
|
||||
allocatedMadeModel.value = result.results;
|
||||
}
|
||||
},
|
||||
onError: (error, stacktrace) {},
|
||||
@@ -73,8 +79,7 @@ class OutOfProvinceLogic extends GetxController {
|
||||
call: () async => await rootLogic.chickenRepository.confirmAllAllocation(
|
||||
token: rootLogic.tokenService.accessToken.value!,
|
||||
allocationTokens:
|
||||
allocatedMadeModel.value?.results?.map((e) => e.key!).toList() ??
|
||||
[],
|
||||
allocatedMadeModel.value?.map((e) => e.key!).toList() ?? [],
|
||||
),
|
||||
onSuccess: (result) {
|
||||
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/presentation/pages/home/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_core/core.dart';
|
||||
|
||||
@@ -14,7 +15,7 @@ enum ErrorLocationType { serviceDisabled, permissionDenied, none }
|
||||
class RootLogic extends GetxController {
|
||||
RxInt currentPage = 2.obs;
|
||||
List<Widget> pages = [
|
||||
Container(color: Colors.red),
|
||||
SalesInProvincePage(),
|
||||
OutOfProvincePage(),
|
||||
HomePage(),
|
||||
Container(color: Colors.blue),
|
||||
|
||||
@@ -11,7 +11,10 @@ import 'package:rasadyar_core/core.dart';
|
||||
|
||||
class SalesInProvinceLogic extends GetxController {
|
||||
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<GuildModel> guildsModel = <GuildModel>[].obs;
|
||||
@@ -86,15 +89,21 @@ class SalesInProvinceLogic extends GetxController {
|
||||
safeCall(
|
||||
call: () async => await rootLogic.chickenRepository.getAllocatedMade(
|
||||
token: rootLogic.tokenService.accessToken.value!,
|
||||
page: currentPageAllocationsMade.value,
|
||||
queryParameters: buildQueryParams(
|
||||
page: currentPageAllocationsMade.value,
|
||||
pageSize: 20,
|
||||
search: 'filter',
|
||||
role: 'Steward',
|
||||
),
|
||||
),
|
||||
onSuccess: (result) {
|
||||
if (result != null) {
|
||||
if (isLoadingMoreAllocationsMade.value &&
|
||||
allocatedMadeModel.value?.results != null) {
|
||||
allocatedMadeModel.value?.results?.addAll(result.results!);
|
||||
allocatedMadeModel.value != null &&
|
||||
(allocatedMadeModel.value?.isNotEmpty ?? false)) {
|
||||
allocatedMadeModel.value?.addAll(result.results!);
|
||||
} else {
|
||||
allocatedMadeModel.value = result;
|
||||
allocatedMadeModel.value = result.results;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -146,8 +155,7 @@ class SalesInProvinceLogic extends GetxController {
|
||||
call: () async => await rootLogic.chickenRepository.confirmAllAllocation(
|
||||
token: rootLogic.tokenService.accessToken.value!,
|
||||
allocationTokens:
|
||||
allocatedMadeModel.value?.results?.map((e) => e.key!).toList() ??
|
||||
[],
|
||||
allocatedMadeModel.value?.map((e) => e.key!).toList() ?? [],
|
||||
),
|
||||
onSuccess: (result) {
|
||||
getAllocatedMade();
|
||||
@@ -164,6 +172,7 @@ class SalesInProvinceLogic extends GetxController {
|
||||
onSuccess: (result) {
|
||||
if (result != null) {
|
||||
rolesProductsModel.value = result;
|
||||
selectedProductModel.value = result.first;
|
||||
}
|
||||
},
|
||||
onError: (error, stacktrace) {},
|
||||
@@ -174,7 +183,10 @@ class SalesInProvinceLogic extends GetxController {
|
||||
safeCall(
|
||||
call: () async => await rootLogic.chickenRepository.getGuilds(
|
||||
token: rootLogic.tokenService.accessToken.value!,
|
||||
isFree: saleType.value == 2 ? true : false,
|
||||
queryParameters: buildQueryParams(
|
||||
queryParams: {'free': saleType.value == 2 ? true : false},
|
||||
role: 'Steward',
|
||||
),
|
||||
),
|
||||
onSuccess: (result) {
|
||||
if (result != null) {
|
||||
@@ -242,11 +254,12 @@ class SalesInProvinceLogic extends GetxController {
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
rootLogic.inventoryExpandedList.clear();
|
||||
super.dispose();
|
||||
}
|
||||
|
||||
//TODO
|
||||
void setEditData(AllocatedMadeModel item) {}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -106,272 +106,11 @@ class SalesOutOfProvincePage extends GetView<SalesOutOfProvinceLogic> {
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
),
|
||||
);
|
||||
}, 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() {
|
||||
return Row(
|
||||
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() {
|
||||
return BaseBottomSheet(
|
||||
height: 250,
|
||||
@@ -806,5 +305,4 @@ class SalesOutOfProvincePage extends GetView<SalesOutOfProvinceLogic> {
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -28,9 +28,8 @@ Map<String, dynamic> buildQueryParams({
|
||||
params['search'] = search;
|
||||
}
|
||||
|
||||
if (value != null) {
|
||||
params['value'] = value;
|
||||
}
|
||||
params['value'] = value ?? '';
|
||||
|
||||
|
||||
if (page != null) {
|
||||
params['page'] = page;
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
import 'package:intl/intl.dart';
|
||||
|
||||
extension XString on String {
|
||||
String get separatedByComma {
|
||||
String get separatedByComma {
|
||||
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'), '');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user