fix : some bug
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
sdk.dir=C:/Users/Housh11/AppData/Local/Android/Sdk
|
sdk.dir=C:/Users/Housh11/AppData/Local/Android/Sdk
|
||||||
flutter.sdk=C:\\src\\flutter
|
flutter.sdk=C:\\src\\flutter
|
||||||
flutter.buildMode=release
|
flutter.buildMode=debug
|
||||||
flutter.versionName=1.3.20
|
flutter.versionName=1.3.21
|
||||||
flutter.versionCode=17
|
flutter.versionCode=18
|
||||||
@@ -104,9 +104,9 @@ abstract class ChickenRemoteDatasource {
|
|||||||
required CreateStewardFreeBar body,
|
required CreateStewardFreeBar body,
|
||||||
});
|
});
|
||||||
|
|
||||||
Future<void> deleteStewardPurchasesOutSideOfTheProvince({
|
Future<void> editStewardPurchasesOutSideOfTheProvince({
|
||||||
required String token,
|
required String token,
|
||||||
required String stewardFreeBarKey,
|
Map<String, dynamic>? queryParameters,
|
||||||
});
|
});
|
||||||
|
|
||||||
Future<PaginationModel<OutProvinceCarcassesBuyer>?> getOutProvinceCarcassesBuyer({
|
Future<PaginationModel<OutProvinceCarcassesBuyer>?> getOutProvinceCarcassesBuyer({
|
||||||
|
|||||||
@@ -318,15 +318,16 @@ class ChickenRemoteDatasourceImp implements ChickenRemoteDatasource {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//todo fix this
|
||||||
@override
|
@override
|
||||||
Future<void> deleteStewardPurchasesOutSideOfTheProvince({
|
Future<void> editStewardPurchasesOutSideOfTheProvince({
|
||||||
required String token,
|
required String token,
|
||||||
required String stewardFreeBarKey,
|
Map<String, dynamic>? queryParameters,
|
||||||
}) async {
|
}) async {
|
||||||
await _httpClient.delete(
|
await _httpClient.delete(
|
||||||
'/steward_free_bar/0/',
|
'/steward_free_bar/0/',
|
||||||
headers: {'Authorization': 'Bearer $token'},
|
headers: {'Authorization': 'Bearer $token'},
|
||||||
queryParameters: {'key': stewardFreeBarKey},
|
queryParameters: queryParameters
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ abstract class WaitingArrivalModel with _$WaitingArrivalModel {
|
|||||||
factory WaitingArrivalModel({
|
factory WaitingArrivalModel({
|
||||||
int? id,
|
int? id,
|
||||||
ProductModel? product,
|
ProductModel? product,
|
||||||
dynamic killHouse,
|
KillHouseModel? killHouse,
|
||||||
dynamic toKillHouse,
|
dynamic toKillHouse,
|
||||||
StewardModel? steward,
|
StewardModel? steward,
|
||||||
StewardModel? toSteward,
|
StewardModel? toSteward,
|
||||||
@@ -56,12 +56,10 @@ abstract class WaitingArrivalModel with _$WaitingArrivalModel {
|
|||||||
bool? temporaryTrash,
|
bool? temporaryTrash,
|
||||||
bool? temporaryDeleted,
|
bool? temporaryDeleted,
|
||||||
bool? overhead,
|
bool? overhead,
|
||||||
dynamic createdBy,
|
bool? warehouse,
|
||||||
dynamic modifiedBy,
|
bool? stewardWarehouse,
|
||||||
dynamic wareHouse,
|
String? quota,
|
||||||
dynamic stewardWareHouse,
|
|
||||||
dynamic car,
|
|
||||||
dynamic dispenser,
|
|
||||||
}) = _WaitingArrivalModel;
|
}) = _WaitingArrivalModel;
|
||||||
|
|
||||||
factory WaitingArrivalModel.fromJson(Map<String, dynamic> json) =>
|
factory WaitingArrivalModel.fromJson(Map<String, dynamic> json) =>
|
||||||
@@ -70,22 +68,99 @@ abstract class WaitingArrivalModel with _$WaitingArrivalModel {
|
|||||||
|
|
||||||
@freezed
|
@freezed
|
||||||
abstract class ProductModel with _$ProductModel {
|
abstract class ProductModel with _$ProductModel {
|
||||||
factory ProductModel({String? name, double? weightAverage}) = _ProductModel;
|
factory ProductModel({
|
||||||
|
String? name,
|
||||||
|
double? weightAverage,
|
||||||
|
}) = _ProductModel;
|
||||||
|
|
||||||
factory ProductModel.fromJson(Map<String, dynamic> json) => _$ProductModelFromJson(json);
|
factory ProductModel.fromJson(Map<String, dynamic> json) =>
|
||||||
|
_$ProductModelFromJson(json);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// =======================
|
||||||
|
/// KILL HOUSE SECTION
|
||||||
|
/// =======================
|
||||||
|
@freezed
|
||||||
|
abstract class KillHouseModel with _$KillHouseModel {
|
||||||
|
factory KillHouseModel({
|
||||||
|
String? key,
|
||||||
|
String? name,
|
||||||
|
bool? killer,
|
||||||
|
KillHouseOperatorModel? killHouseOperator,
|
||||||
|
}) = _KillHouseModel;
|
||||||
|
|
||||||
|
factory KillHouseModel.fromJson(Map<String, dynamic> json) =>
|
||||||
|
_$KillHouseModelFromJson(json);
|
||||||
|
}
|
||||||
|
|
||||||
|
@freezed
|
||||||
|
abstract class KillHouseOperatorModel with _$KillHouseOperatorModel {
|
||||||
|
factory KillHouseOperatorModel({
|
||||||
|
KillHouseUserModel? user,
|
||||||
|
}) = _KillHouseOperatorModel;
|
||||||
|
|
||||||
|
factory KillHouseOperatorModel.fromJson(Map<String, dynamic> json) =>
|
||||||
|
_$KillHouseOperatorModelFromJson(json);
|
||||||
|
}
|
||||||
|
|
||||||
|
@freezed
|
||||||
|
abstract class KillHouseUserModel with _$KillHouseUserModel {
|
||||||
|
factory KillHouseUserModel({
|
||||||
|
String? fullname,
|
||||||
|
String? firstName,
|
||||||
|
String? lastName,
|
||||||
|
int? baseOrder,
|
||||||
|
String? mobile,
|
||||||
|
String? nationalId,
|
||||||
|
String? nationalCode,
|
||||||
|
String? key,
|
||||||
|
CityDetailModel? city,
|
||||||
|
String? unitName,
|
||||||
|
String? unitNationalId,
|
||||||
|
String? unitRegistrationNumber,
|
||||||
|
String? unitEconomicalNumber,
|
||||||
|
String? unitProvince,
|
||||||
|
String? unitCity,
|
||||||
|
String? unitPostalCode,
|
||||||
|
String? unitAddress,
|
||||||
|
}) = _KillHouseUserModel;
|
||||||
|
|
||||||
|
factory KillHouseUserModel.fromJson(Map<String, dynamic> json) =>
|
||||||
|
_$KillHouseUserModelFromJson(json);
|
||||||
|
}
|
||||||
|
|
||||||
|
@freezed
|
||||||
|
abstract class CityDetailModel with _$CityDetailModel {
|
||||||
|
factory CityDetailModel({
|
||||||
|
int? id,
|
||||||
|
String? key,
|
||||||
|
String? createDate,
|
||||||
|
String? modifyDate,
|
||||||
|
bool? trash,
|
||||||
|
int? provinceIdForeignKey,
|
||||||
|
int? cityIdKey,
|
||||||
|
String? name,
|
||||||
|
double? productPrice,
|
||||||
|
bool? provinceCenter,
|
||||||
|
int? cityNumber,
|
||||||
|
String? cityName,
|
||||||
|
int? provinceNumber,
|
||||||
|
String? provinceName,
|
||||||
|
}) = _CityDetailModel;
|
||||||
|
|
||||||
|
factory CityDetailModel.fromJson(Map<String, dynamic> json) =>
|
||||||
|
_$CityDetailModelFromJson(json);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// =======================
|
||||||
|
/// TO STEWARD SECTION
|
||||||
|
/// =======================
|
||||||
@freezed
|
@freezed
|
||||||
abstract class StewardModel with _$StewardModel {
|
abstract class StewardModel with _$StewardModel {
|
||||||
factory StewardModel({
|
factory StewardModel({
|
||||||
int? id,
|
int? id,
|
||||||
StewardUserModel? user,
|
StewardUserModel? user,
|
||||||
AddressModel? address,
|
AddressModel? address,
|
||||||
dynamic guildAreaActivity,
|
|
||||||
dynamic guildTypeActivity,
|
|
||||||
List<dynamic>? killHouse,
|
|
||||||
List<dynamic>? stewardKillHouse,
|
|
||||||
List<dynamic>? stewards,
|
|
||||||
GetPosStatusModel? getPosStatus,
|
GetPosStatusModel? getPosStatus,
|
||||||
String? key,
|
String? key,
|
||||||
String? createDate,
|
String? createDate,
|
||||||
@@ -111,11 +186,10 @@ abstract class StewardModel with _$StewardModel {
|
|||||||
bool? stewardLimitationAllocation,
|
bool? stewardLimitationAllocation,
|
||||||
bool? license,
|
bool? license,
|
||||||
int? wallet,
|
int? wallet,
|
||||||
List<dynamic>? cars,
|
|
||||||
List<dynamic>? userLevel,
|
|
||||||
}) = _StewardModel;
|
}) = _StewardModel;
|
||||||
|
|
||||||
factory StewardModel.fromJson(Map<String, dynamic> json) => _$StewardModelFromJson(json);
|
factory StewardModel.fromJson(Map<String, dynamic> json) =>
|
||||||
|
_$StewardModelFromJson(json);
|
||||||
}
|
}
|
||||||
|
|
||||||
@freezed
|
@freezed
|
||||||
@@ -129,7 +203,8 @@ abstract class StewardUserModel with _$StewardUserModel {
|
|||||||
String? city,
|
String? city,
|
||||||
}) = _StewardUserModel;
|
}) = _StewardUserModel;
|
||||||
|
|
||||||
factory StewardUserModel.fromJson(Map<String, dynamic> json) => _$StewardUserModelFromJson(json);
|
factory StewardUserModel.fromJson(Map<String, dynamic> json) =>
|
||||||
|
_$StewardUserModelFromJson(json);
|
||||||
}
|
}
|
||||||
|
|
||||||
@freezed
|
@freezed
|
||||||
@@ -141,27 +216,39 @@ abstract class AddressModel with _$AddressModel {
|
|||||||
String? postalCode,
|
String? postalCode,
|
||||||
}) = _AddressModel;
|
}) = _AddressModel;
|
||||||
|
|
||||||
factory AddressModel.fromJson(Map<String, dynamic> json) => _$AddressModelFromJson(json);
|
factory AddressModel.fromJson(Map<String, dynamic> json) =>
|
||||||
|
_$AddressModelFromJson(json);
|
||||||
}
|
}
|
||||||
|
|
||||||
@freezed
|
@freezed
|
||||||
abstract class ProvinceModel with _$ProvinceModel {
|
abstract class ProvinceModel with _$ProvinceModel {
|
||||||
factory ProvinceModel({String? key, String? name}) = _ProvinceModel;
|
factory ProvinceModel({
|
||||||
|
String? key,
|
||||||
|
String? name,
|
||||||
|
}) = _ProvinceModel;
|
||||||
|
|
||||||
factory ProvinceModel.fromJson(Map<String, dynamic> json) => _$ProvinceModelFromJson(json);
|
factory ProvinceModel.fromJson(Map<String, dynamic> json) =>
|
||||||
|
_$ProvinceModelFromJson(json);
|
||||||
}
|
}
|
||||||
|
|
||||||
@freezed
|
@freezed
|
||||||
abstract class CityModel with _$CityModel {
|
abstract class CityModel with _$CityModel {
|
||||||
factory CityModel({String? key, String? name}) = _CityModel;
|
factory CityModel({
|
||||||
|
String? key,
|
||||||
|
String? name,
|
||||||
|
}) = _CityModel;
|
||||||
|
|
||||||
factory CityModel.fromJson(Map<String, dynamic> json) => _$CityModelFromJson(json);
|
factory CityModel.fromJson(Map<String, dynamic> json) =>
|
||||||
|
_$CityModelFromJson(json);
|
||||||
}
|
}
|
||||||
|
|
||||||
@freezed
|
@freezed
|
||||||
abstract class GetPosStatusModel with _$GetPosStatusModel {
|
abstract class GetPosStatusModel with _$GetPosStatusModel {
|
||||||
factory GetPosStatusModel({int? lenActiveSessions, bool? hasPons, bool? hasActivePons}) =
|
factory GetPosStatusModel({
|
||||||
_GetPosStatusModel;
|
int? lenActiveSessions,
|
||||||
|
bool? hasPons,
|
||||||
|
bool? hasActivePons,
|
||||||
|
}) = _GetPosStatusModel;
|
||||||
|
|
||||||
factory GetPosStatusModel.fromJson(Map<String, dynamic> json) =>
|
factory GetPosStatusModel.fromJson(Map<String, dynamic> json) =>
|
||||||
_$GetPosStatusModelFromJson(json);
|
_$GetPosStatusModelFromJson(json);
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -13,7 +13,9 @@ _WaitingArrivalModel _$WaitingArrivalModelFromJson(
|
|||||||
product: json['product'] == null
|
product: json['product'] == null
|
||||||
? null
|
? null
|
||||||
: ProductModel.fromJson(json['product'] as Map<String, dynamic>),
|
: ProductModel.fromJson(json['product'] as Map<String, dynamic>),
|
||||||
killHouse: json['kill_house'],
|
killHouse: json['kill_house'] == null
|
||||||
|
? null
|
||||||
|
: KillHouseModel.fromJson(json['kill_house'] as Map<String, dynamic>),
|
||||||
toKillHouse: json['to_kill_house'],
|
toKillHouse: json['to_kill_house'],
|
||||||
steward: json['steward'] == null
|
steward: json['steward'] == null
|
||||||
? null
|
? null
|
||||||
@@ -67,12 +69,9 @@ _WaitingArrivalModel _$WaitingArrivalModelFromJson(
|
|||||||
temporaryTrash: json['temporary_trash'] as bool?,
|
temporaryTrash: json['temporary_trash'] as bool?,
|
||||||
temporaryDeleted: json['temporary_deleted'] as bool?,
|
temporaryDeleted: json['temporary_deleted'] as bool?,
|
||||||
overhead: json['overhead'] as bool?,
|
overhead: json['overhead'] as bool?,
|
||||||
createdBy: json['created_by'],
|
warehouse: json['warehouse'] as bool?,
|
||||||
modifiedBy: json['modified_by'],
|
stewardWarehouse: json['steward_warehouse'] as bool?,
|
||||||
wareHouse: json['ware_house'],
|
quota: json['quota'] as String?,
|
||||||
stewardWareHouse: json['steward_ware_house'],
|
|
||||||
car: json['car'],
|
|
||||||
dispenser: json['dispenser'],
|
|
||||||
);
|
);
|
||||||
|
|
||||||
Map<String, dynamic> _$WaitingArrivalModelToJson(
|
Map<String, dynamic> _$WaitingArrivalModelToJson(
|
||||||
@@ -128,12 +127,9 @@ Map<String, dynamic> _$WaitingArrivalModelToJson(
|
|||||||
'temporary_trash': instance.temporaryTrash,
|
'temporary_trash': instance.temporaryTrash,
|
||||||
'temporary_deleted': instance.temporaryDeleted,
|
'temporary_deleted': instance.temporaryDeleted,
|
||||||
'overhead': instance.overhead,
|
'overhead': instance.overhead,
|
||||||
'created_by': instance.createdBy,
|
'warehouse': instance.warehouse,
|
||||||
'modified_by': instance.modifiedBy,
|
'steward_warehouse': instance.stewardWarehouse,
|
||||||
'ware_house': instance.wareHouse,
|
'quota': instance.quota,
|
||||||
'steward_ware_house': instance.stewardWareHouse,
|
|
||||||
'car': instance.car,
|
|
||||||
'dispenser': instance.dispenser,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
_ProductModel _$ProductModelFromJson(Map<String, dynamic> json) =>
|
_ProductModel _$ProductModelFromJson(Map<String, dynamic> json) =>
|
||||||
@@ -148,6 +144,118 @@ Map<String, dynamic> _$ProductModelToJson(_ProductModel instance) =>
|
|||||||
'weight_average': instance.weightAverage,
|
'weight_average': instance.weightAverage,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
_KillHouseModel _$KillHouseModelFromJson(Map<String, dynamic> json) =>
|
||||||
|
_KillHouseModel(
|
||||||
|
key: json['key'] as String?,
|
||||||
|
name: json['name'] as String?,
|
||||||
|
killer: json['killer'] as bool?,
|
||||||
|
killHouseOperator: json['kill_house_operator'] == null
|
||||||
|
? null
|
||||||
|
: KillHouseOperatorModel.fromJson(
|
||||||
|
json['kill_house_operator'] as Map<String, dynamic>,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> _$KillHouseModelToJson(_KillHouseModel instance) =>
|
||||||
|
<String, dynamic>{
|
||||||
|
'key': instance.key,
|
||||||
|
'name': instance.name,
|
||||||
|
'killer': instance.killer,
|
||||||
|
'kill_house_operator': instance.killHouseOperator,
|
||||||
|
};
|
||||||
|
|
||||||
|
_KillHouseOperatorModel _$KillHouseOperatorModelFromJson(
|
||||||
|
Map<String, dynamic> json,
|
||||||
|
) => _KillHouseOperatorModel(
|
||||||
|
user: json['user'] == null
|
||||||
|
? null
|
||||||
|
: KillHouseUserModel.fromJson(json['user'] as Map<String, dynamic>),
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> _$KillHouseOperatorModelToJson(
|
||||||
|
_KillHouseOperatorModel instance,
|
||||||
|
) => <String, dynamic>{'user': instance.user};
|
||||||
|
|
||||||
|
_KillHouseUserModel _$KillHouseUserModelFromJson(Map<String, dynamic> json) =>
|
||||||
|
_KillHouseUserModel(
|
||||||
|
fullname: json['fullname'] as String?,
|
||||||
|
firstName: json['first_name'] as String?,
|
||||||
|
lastName: json['last_name'] as String?,
|
||||||
|
baseOrder: (json['base_order'] as num?)?.toInt(),
|
||||||
|
mobile: json['mobile'] as String?,
|
||||||
|
nationalId: json['national_id'] as String?,
|
||||||
|
nationalCode: json['national_code'] as String?,
|
||||||
|
key: json['key'] as String?,
|
||||||
|
city: json['city'] == null
|
||||||
|
? null
|
||||||
|
: CityDetailModel.fromJson(json['city'] as Map<String, dynamic>),
|
||||||
|
unitName: json['unit_name'] as String?,
|
||||||
|
unitNationalId: json['unit_national_id'] as String?,
|
||||||
|
unitRegistrationNumber: json['unit_registration_number'] as String?,
|
||||||
|
unitEconomicalNumber: json['unit_economical_number'] as String?,
|
||||||
|
unitProvince: json['unit_province'] as String?,
|
||||||
|
unitCity: json['unit_city'] as String?,
|
||||||
|
unitPostalCode: json['unit_postal_code'] as String?,
|
||||||
|
unitAddress: json['unit_address'] as String?,
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> _$KillHouseUserModelToJson(_KillHouseUserModel instance) =>
|
||||||
|
<String, dynamic>{
|
||||||
|
'fullname': instance.fullname,
|
||||||
|
'first_name': instance.firstName,
|
||||||
|
'last_name': instance.lastName,
|
||||||
|
'base_order': instance.baseOrder,
|
||||||
|
'mobile': instance.mobile,
|
||||||
|
'national_id': instance.nationalId,
|
||||||
|
'national_code': instance.nationalCode,
|
||||||
|
'key': instance.key,
|
||||||
|
'city': instance.city,
|
||||||
|
'unit_name': instance.unitName,
|
||||||
|
'unit_national_id': instance.unitNationalId,
|
||||||
|
'unit_registration_number': instance.unitRegistrationNumber,
|
||||||
|
'unit_economical_number': instance.unitEconomicalNumber,
|
||||||
|
'unit_province': instance.unitProvince,
|
||||||
|
'unit_city': instance.unitCity,
|
||||||
|
'unit_postal_code': instance.unitPostalCode,
|
||||||
|
'unit_address': instance.unitAddress,
|
||||||
|
};
|
||||||
|
|
||||||
|
_CityDetailModel _$CityDetailModelFromJson(Map<String, dynamic> json) =>
|
||||||
|
_CityDetailModel(
|
||||||
|
id: (json['id'] as num?)?.toInt(),
|
||||||
|
key: json['key'] as String?,
|
||||||
|
createDate: json['create_date'] as String?,
|
||||||
|
modifyDate: json['modify_date'] as String?,
|
||||||
|
trash: json['trash'] as bool?,
|
||||||
|
provinceIdForeignKey: (json['province_id_foreign_key'] as num?)?.toInt(),
|
||||||
|
cityIdKey: (json['city_id_key'] as num?)?.toInt(),
|
||||||
|
name: json['name'] as String?,
|
||||||
|
productPrice: (json['product_price'] as num?)?.toDouble(),
|
||||||
|
provinceCenter: json['province_center'] as bool?,
|
||||||
|
cityNumber: (json['city_number'] as num?)?.toInt(),
|
||||||
|
cityName: json['city_name'] as String?,
|
||||||
|
provinceNumber: (json['province_number'] as num?)?.toInt(),
|
||||||
|
provinceName: json['province_name'] as String?,
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> _$CityDetailModelToJson(_CityDetailModel instance) =>
|
||||||
|
<String, dynamic>{
|
||||||
|
'id': instance.id,
|
||||||
|
'key': instance.key,
|
||||||
|
'create_date': instance.createDate,
|
||||||
|
'modify_date': instance.modifyDate,
|
||||||
|
'trash': instance.trash,
|
||||||
|
'province_id_foreign_key': instance.provinceIdForeignKey,
|
||||||
|
'city_id_key': instance.cityIdKey,
|
||||||
|
'name': instance.name,
|
||||||
|
'product_price': instance.productPrice,
|
||||||
|
'province_center': instance.provinceCenter,
|
||||||
|
'city_number': instance.cityNumber,
|
||||||
|
'city_name': instance.cityName,
|
||||||
|
'province_number': instance.provinceNumber,
|
||||||
|
'province_name': instance.provinceName,
|
||||||
|
};
|
||||||
|
|
||||||
_StewardModel _$StewardModelFromJson(Map<String, dynamic> json) =>
|
_StewardModel _$StewardModelFromJson(Map<String, dynamic> json) =>
|
||||||
_StewardModel(
|
_StewardModel(
|
||||||
id: (json['id'] as num?)?.toInt(),
|
id: (json['id'] as num?)?.toInt(),
|
||||||
@@ -157,11 +265,6 @@ _StewardModel _$StewardModelFromJson(Map<String, dynamic> json) =>
|
|||||||
address: json['address'] == null
|
address: json['address'] == null
|
||||||
? null
|
? null
|
||||||
: AddressModel.fromJson(json['address'] as Map<String, dynamic>),
|
: AddressModel.fromJson(json['address'] as Map<String, dynamic>),
|
||||||
guildAreaActivity: json['guild_area_activity'],
|
|
||||||
guildTypeActivity: json['guild_type_activity'],
|
|
||||||
killHouse: json['kill_house'] as List<dynamic>?,
|
|
||||||
stewardKillHouse: json['steward_kill_house'] as List<dynamic>?,
|
|
||||||
stewards: json['stewards'] as List<dynamic>?,
|
|
||||||
getPosStatus: json['get_pos_status'] == null
|
getPosStatus: json['get_pos_status'] == null
|
||||||
? null
|
? null
|
||||||
: GetPosStatusModel.fromJson(
|
: GetPosStatusModel.fromJson(
|
||||||
@@ -192,8 +295,6 @@ _StewardModel _$StewardModelFromJson(Map<String, dynamic> json) =>
|
|||||||
json['steward_limitation_allocation'] as bool?,
|
json['steward_limitation_allocation'] as bool?,
|
||||||
license: json['license'] as bool?,
|
license: json['license'] as bool?,
|
||||||
wallet: (json['wallet'] as num?)?.toInt(),
|
wallet: (json['wallet'] as num?)?.toInt(),
|
||||||
cars: json['cars'] as List<dynamic>?,
|
|
||||||
userLevel: json['user_level'] as List<dynamic>?,
|
|
||||||
);
|
);
|
||||||
|
|
||||||
Map<String, dynamic> _$StewardModelToJson(_StewardModel instance) =>
|
Map<String, dynamic> _$StewardModelToJson(_StewardModel instance) =>
|
||||||
@@ -201,11 +302,6 @@ Map<String, dynamic> _$StewardModelToJson(_StewardModel instance) =>
|
|||||||
'id': instance.id,
|
'id': instance.id,
|
||||||
'user': instance.user,
|
'user': instance.user,
|
||||||
'address': instance.address,
|
'address': instance.address,
|
||||||
'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.getPosStatus,
|
'get_pos_status': instance.getPosStatus,
|
||||||
'key': instance.key,
|
'key': instance.key,
|
||||||
'create_date': instance.createDate,
|
'create_date': instance.createDate,
|
||||||
@@ -231,8 +327,6 @@ Map<String, dynamic> _$StewardModelToJson(_StewardModel instance) =>
|
|||||||
'steward_limitation_allocation': instance.stewardLimitationAllocation,
|
'steward_limitation_allocation': instance.stewardLimitationAllocation,
|
||||||
'license': instance.license,
|
'license': instance.license,
|
||||||
'wallet': instance.wallet,
|
'wallet': instance.wallet,
|
||||||
'cars': instance.cars,
|
|
||||||
'user_level': instance.userLevel,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
_StewardUserModel _$StewardUserModelFromJson(Map<String, dynamic> json) =>
|
_StewardUserModel _$StewardUserModelFromJson(Map<String, dynamic> json) =>
|
||||||
|
|||||||
@@ -109,9 +109,9 @@ abstract class ChickenRepository {
|
|||||||
required CreateStewardFreeBar body,
|
required CreateStewardFreeBar body,
|
||||||
});
|
});
|
||||||
|
|
||||||
Future<void> deleteStewardPurchasesOutSideOfTheProvince({
|
Future<void> editStewardPurchasesOutSideOfTheProvince({
|
||||||
required String token,
|
required String token,
|
||||||
required String stewardFreeBarKey,
|
Map<String, dynamic>? queryParameters,
|
||||||
});
|
});
|
||||||
|
|
||||||
Future<PaginationModel<OutProvinceCarcassesBuyer>?> getOutProvinceCarcassesBuyer({
|
Future<PaginationModel<OutProvinceCarcassesBuyer>?> getOutProvinceCarcassesBuyer({
|
||||||
|
|||||||
@@ -223,13 +223,13 @@ class ChickenRepositoryImp implements ChickenRepository {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<void> deleteStewardPurchasesOutSideOfTheProvince({
|
Future<void> editStewardPurchasesOutSideOfTheProvince({
|
||||||
required String token,
|
required String token,
|
||||||
required String stewardFreeBarKey,
|
Map<String, dynamic>? queryParameters,
|
||||||
}) async {
|
}) async {
|
||||||
await remote.deleteStewardPurchasesOutSideOfTheProvince(
|
await remote.editStewardPurchasesOutSideOfTheProvince(
|
||||||
token: token,
|
token: token,
|
||||||
stewardFreeBarKey: stewardFreeBarKey,
|
queryParameters: queryParameters
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
import 'package:rasadyar_chicken/data/models/request/steward_allocation/steward_allocation_request.dart';
|
import 'package:rasadyar_chicken/data/models/request/steward_allocation/steward_allocation_request.dart';
|
||||||
import 'package:rasadyar_chicken/data/models/response/waiting_arrival/waiting_arrival.dart';
|
import 'package:rasadyar_chicken/data/models/response/waiting_arrival/waiting_arrival.dart';
|
||||||
import 'package:rasadyar_chicken/presentation/pages/steward/root/logic.dart';
|
import 'package:rasadyar_chicken/presentation/pages/steward/root/logic.dart';
|
||||||
import 'package:rasadyar_core/core.dart';
|
import 'package:rasadyar_core/core.dart';
|
||||||
|
|
||||||
class BuyInProvinceAllLogic extends GetxController {
|
class BuyInProvinceAllLogic extends GetxController {
|
||||||
RxList<int> isExpandedList = <int>[].obs;
|
RxInt isExpandedListIndex = (-1).obs;
|
||||||
Rx<Jalali> fromDateFilter = Jalali.now().obs;
|
Rx<Jalali> fromDateFilter = Jalali.now().obs;
|
||||||
Rx<Jalali> toDateFilter = Jalali.now().obs;
|
Rx<Jalali> toDateFilter = Jalali.now().obs;
|
||||||
RxnString searchedValue = RxnString();
|
RxnString searchedValue = RxnString();
|
||||||
@@ -17,6 +18,13 @@ class BuyInProvinceAllLogic extends GetxController {
|
|||||||
Rx<Resource<PaginationModel<WaitingArrivalModel>>> allProduct =
|
Rx<Resource<PaginationModel<WaitingArrivalModel>>> allProduct =
|
||||||
Resource<PaginationModel<WaitingArrivalModel>>.loading().obs;
|
Resource<PaginationModel<WaitingArrivalModel>>.loading().obs;
|
||||||
|
|
||||||
|
TextEditingController weightController = TextEditingController();
|
||||||
|
TextEditingController countController = TextEditingController();
|
||||||
|
TextEditingController lossController = TextEditingController();
|
||||||
|
TextEditingController approvedWithOtpController = TextEditingController();
|
||||||
|
|
||||||
|
RxBool approvedWithOtpCode = false.obs;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onInit() {
|
void onInit() {
|
||||||
super.onInit();
|
super.onInit();
|
||||||
@@ -87,22 +95,23 @@ class BuyInProvinceAllLogic extends GetxController {
|
|||||||
state: 'accepted',
|
state: 'accepted',
|
||||||
receiverRealNumberOfCarcasses: model.realNumberOfCarcasses ?? 0,
|
receiverRealNumberOfCarcasses: model.realNumberOfCarcasses ?? 0,
|
||||||
receiverRealWeightOfCarcasses: model.realWeightOfCarcasses?.toInt() ?? 0,
|
receiverRealWeightOfCarcasses: model.realWeightOfCarcasses?.toInt() ?? 0,
|
||||||
registrationCode: model.registrationCode ?? 0,
|
registrationCode: model.registrationCode,
|
||||||
weightLossOfCarcasses: model.weightLossOfCarcasses?.toInt() ?? 0,
|
weightLossOfCarcasses: model.weightLossOfCarcasses?.toInt() ?? 0,
|
||||||
).toJson();
|
).toJson();
|
||||||
request.removeWhere((key, value) => value == null);
|
request.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
safeCall(
|
safeCall(
|
||||||
|
showError: true,
|
||||||
call: () async => await rootLogic.chickenRepository.setSateForArrivals(
|
call: () async => await rootLogic.chickenRepository.setSateForArrivals(
|
||||||
token: rootLogic.tokenService.accessToken.value!,
|
token: rootLogic.tokenService.accessToken.value!,
|
||||||
request: request,
|
request: request,
|
||||||
),
|
),
|
||||||
onError: (error, stackTrace) {
|
|
||||||
eLog(error);
|
|
||||||
},
|
|
||||||
onSuccess: (result) {
|
onSuccess: (result) {
|
||||||
getAllArrivals();
|
getAllArrivals();
|
||||||
rootLogic.getInventory();
|
rootLogic.onRefresh();
|
||||||
|
clearApprovedController();
|
||||||
|
toggleExpansion();
|
||||||
|
Get.back();
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -125,7 +134,7 @@ class BuyInProvinceAllLogic extends GetxController {
|
|||||||
},
|
},
|
||||||
onSuccess: (result) {
|
onSuccess: (result) {
|
||||||
getAllArrivals();
|
getAllArrivals();
|
||||||
rootLogic.getInventory();
|
rootLogic.onRefresh();
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -142,4 +151,20 @@ class BuyInProvinceAllLogic extends GetxController {
|
|||||||
return Assets.vec.timerSvg.path;
|
return Assets.vec.timerSvg.path;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void clearApprovedController() {
|
||||||
|
weightController.clear();
|
||||||
|
countController.clear();
|
||||||
|
lossController.clear();
|
||||||
|
approvedWithOtpController.clear();
|
||||||
|
approvedWithOtpCode.value = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void toggleExpansion({int? index}) {
|
||||||
|
if (isExpandedListIndex.value == index || index == null) {
|
||||||
|
isExpandedListIndex.value = -1;
|
||||||
|
} else {
|
||||||
|
isExpandedListIndex.value = index;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
import 'package:rasadyar_chicken/data/models/response/waiting_arrival/waiting_arrival.dart';
|
import 'package:rasadyar_chicken/data/models/response/waiting_arrival/waiting_arrival.dart';
|
||||||
import 'package:rasadyar_chicken/presentation/utils/string_utils.dart';
|
import 'package:rasadyar_chicken/presentation/utils/string_utils.dart';
|
||||||
import 'package:rasadyar_chicken/presentation/widget/list_item/list_item.dart' hide ListItem2;
|
|
||||||
|
|
||||||
import 'package:rasadyar_core/core.dart';
|
import 'package:rasadyar_core/core.dart';
|
||||||
|
|
||||||
import 'logic.dart';
|
import 'logic.dart';
|
||||||
@@ -24,20 +23,19 @@ class BuyInProvinceAllPage extends GetView<BuyInProvinceAllLogic> {
|
|||||||
var item = data.value.data!.results![index];
|
var item = data.value.data!.results![index];
|
||||||
return ObxValue((val) {
|
return ObxValue((val) {
|
||||||
return ExpandableListItem2(
|
return ExpandableListItem2(
|
||||||
selected: val.contains(index),
|
selected: val.value == index,
|
||||||
onTap: () => controller.isExpandedList.toggle(index),
|
onTap: () => controller.toggleExpansion(index: index),
|
||||||
index: index,
|
index: index,
|
||||||
child: itemListWidget(item),
|
child: itemListWidget(item),
|
||||||
secondChild: itemListExpandedWidget(item),
|
secondChild: itemListExpandedWidget(item),
|
||||||
labelColor: getLabelColor(item.receiverState),
|
labelColor: getLabelColor(item.receiverState),
|
||||||
labelIcon: controller.getVecPathItem(item.receiverState),
|
labelIcon: controller.getVecPathItem(item.receiverState),
|
||||||
);
|
);
|
||||||
}, controller.isExpandedList);
|
}, controller.isExpandedListIndex);
|
||||||
},
|
},
|
||||||
itemCount: data.value.data?.results?.length ?? 0,
|
itemCount: data.value.data?.results?.length ?? 0,
|
||||||
separatorBuilder: (context, index) => SizedBox(height: 8.h),
|
separatorBuilder: (context, index) => SizedBox(height: 8.h),
|
||||||
onLoadMore: () async => controller.getAllArrivals(true),
|
onLoadMore: () async => controller.getAllArrivals(true),
|
||||||
|
|
||||||
);
|
);
|
||||||
}, controller.allProduct),
|
}, controller.allProduct),
|
||||||
);
|
);
|
||||||
@@ -138,12 +136,11 @@ class BuyInProvinceAllPage extends GetView<BuyInProvinceAllLogic> {
|
|||||||
style: AppFonts.yekan10.copyWith(color: AppColor.darkGreyDark),
|
style: AppFonts.yekan10.copyWith(color: AppColor.darkGreyDark),
|
||||||
),
|
),
|
||||||
SizedBox(width: 7),
|
SizedBox(width: 7),
|
||||||
SvgGenImage.vec(
|
SvgGenImage.vec(controller.getVecPathItem(item.receiverState)).svg(
|
||||||
controller.getVecPathItem(item.receiverState),
|
width: 16.w,
|
||||||
).svg(width: 16.w, height: 16.h,
|
height: 16.h,
|
||||||
colorFilter: ColorFilter.mode(AppColor.darkGreyDark, BlendMode.srcIn)
|
colorFilter: ColorFilter.mode(AppColor.darkGreyDark, BlendMode.srcIn),
|
||||||
),
|
),
|
||||||
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
Container(
|
Container(
|
||||||
@@ -187,19 +184,13 @@ class BuyInProvinceAllPage extends GetView<BuyInProvinceAllLogic> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
buildRow(
|
buildRow(title: 'مشخصات فروشنده', value: item.steward?.user?.fullname ?? 'N/A'),
|
||||||
title: 'مشخصات فروشنده',
|
|
||||||
value: item.steward?.user?.fullname ?? 'N/A',
|
|
||||||
),
|
|
||||||
buildRow(
|
buildRow(
|
||||||
title: 'تلفن فروشنده',
|
title: 'تلفن فروشنده',
|
||||||
value: item.steward?.user?.mobile ?? 'N/A',
|
value: item.steward?.user?.mobile ?? 'N/A',
|
||||||
valueStyle: AppFonts.yekan14.copyWith(color: AppColor.blueNormal),
|
valueStyle: AppFonts.yekan14.copyWith(color: AppColor.blueNormal),
|
||||||
),
|
),
|
||||||
buildRow(
|
buildRow(title: 'نوع تخصیص', value: item.allocationType?.faAllocationType ?? 'N/A'),
|
||||||
title: 'نوع تخصیص',
|
|
||||||
value: item.allocationType?.faAllocationType ?? 'N/A',
|
|
||||||
),
|
|
||||||
buildRow(title: 'محصول', value: item.product?.name ?? 'N/A'),
|
buildRow(title: 'محصول', value: item.product?.name ?? 'N/A'),
|
||||||
buildRow(
|
buildRow(
|
||||||
title: 'وزن خریداری شده',
|
title: 'وزن خریداری شده',
|
||||||
@@ -219,9 +210,12 @@ class BuyInProvinceAllPage extends GetView<BuyInProvinceAllLogic> {
|
|||||||
height: 40.h,
|
height: 40.h,
|
||||||
isLoading: data[item.key!] ?? false,
|
isLoading: data[item.key!] ?? false,
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
data[item.key!] = !(data[item.key!] ?? false);
|
Get.bottomSheet(conformationBottomSheet(item), isScrollControlled: true).then(
|
||||||
await controller.acceptEntries(item);
|
(value) {
|
||||||
data.remove(item.key!);
|
Get.back();
|
||||||
|
controller.clearApprovedController();
|
||||||
|
},
|
||||||
|
);
|
||||||
},
|
},
|
||||||
textStyle: AppFonts.yekan20.copyWith(color: Colors.white),
|
textStyle: AppFonts.yekan20.copyWith(color: Colors.white),
|
||||||
backgroundColor: AppColor.greenNormal,
|
backgroundColor: AppColor.greenNormal,
|
||||||
@@ -255,7 +249,6 @@ class BuyInProvinceAllPage extends GetView<BuyInProvinceAllLogic> {
|
|||||||
case 'pending':
|
case 'pending':
|
||||||
return AppColor.blueLight;
|
return AppColor.blueLight;
|
||||||
case 'accepted':
|
case 'accepted':
|
||||||
|
|
||||||
return AppColor.greenLightHover;
|
return AppColor.greenLightHover;
|
||||||
case 'rejected':
|
case 'rejected':
|
||||||
return AppColor.redLightHover;
|
return AppColor.redLightHover;
|
||||||
@@ -263,4 +256,109 @@ class BuyInProvinceAllPage extends GetView<BuyInProvinceAllLogic> {
|
|||||||
return AppColor.blueLight;
|
return AppColor.blueLight;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Widget conformationBottomSheet(WaitingArrivalModel item) {
|
||||||
|
controller.weightController.text = item.weightOfCarcasses.separatedByComma;
|
||||||
|
return BaseBottomSheet(
|
||||||
|
height: 430.h,
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
RTextField(
|
||||||
|
label: 'وزن(کیلوگرم)',
|
||||||
|
controller: controller.weightController,
|
||||||
|
keyboardType: TextInputType.number,
|
||||||
|
inputFormatters: [FilteringTextInputFormatter.digitsOnly, SeparatorInputFormatter()],
|
||||||
|
),
|
||||||
|
SizedBox(height: 16.h),
|
||||||
|
RTextField(
|
||||||
|
label: 'حجم(قطعه)',
|
||||||
|
controller: controller.countController,
|
||||||
|
keyboardType: TextInputType.number,
|
||||||
|
inputFormatters: [FilteringTextInputFormatter.digitsOnly, SeparatorInputFormatter()],
|
||||||
|
),
|
||||||
|
SizedBox(height: 16.h),
|
||||||
|
RTextField(
|
||||||
|
label: 'افت وزن(کیلوگرم)',
|
||||||
|
controller: controller.lossController,
|
||||||
|
keyboardType: TextInputType.number,
|
||||||
|
inputFormatters: [FilteringTextInputFormatter.digitsOnly, SeparatorInputFormatter()],
|
||||||
|
),
|
||||||
|
SizedBox(height: 16.h),
|
||||||
|
|
||||||
|
Text('تایید ', style: AppFonts.yekan16Bold.copyWith(color: AppColor.textColor)),
|
||||||
|
ObxValue((data) {
|
||||||
|
return Column(
|
||||||
|
children: [
|
||||||
|
RadioGroup(
|
||||||
|
groupValue: data.value,
|
||||||
|
onChanged: (value) {
|
||||||
|
controller.approvedWithOtpCode.value = value ?? false;
|
||||||
|
},
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
|
children: [
|
||||||
|
radioRow(
|
||||||
|
value: true,
|
||||||
|
label: ' با کد احراز',
|
||||||
|
onTap: () {
|
||||||
|
controller.approvedWithOtpCode.value = true;
|
||||||
|
},
|
||||||
|
),
|
||||||
|
radioRow(
|
||||||
|
value: false,
|
||||||
|
label: 'بدون کد احراز',
|
||||||
|
onTap: () {
|
||||||
|
controller.approvedWithOtpCode.value = false;
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Visibility(
|
||||||
|
child: RTextField(
|
||||||
|
controller: controller.approvedWithOtpController,
|
||||||
|
label: 'کد احراز',
|
||||||
|
keyboardType: TextInputType.number,
|
||||||
|
),
|
||||||
|
visible: data.value,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}, controller.approvedWithOtpCode),
|
||||||
|
SizedBox(height: 30.h),
|
||||||
|
ObxValue((data) {
|
||||||
|
return RElevated(
|
||||||
|
enabled: controller.approvedWithOtpCode.value
|
||||||
|
? controller.approvedWithOtpController.text.isNotEmpty
|
||||||
|
: true,
|
||||||
|
text: 'تایید',
|
||||||
|
onPressed: () async {
|
||||||
|
await controller.acceptEntries(item);
|
||||||
|
},
|
||||||
|
isFullWidth: true,
|
||||||
|
);
|
||||||
|
}, controller.approvedWithOtpCode),
|
||||||
|
SizedBox(height: 20.h),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget radioRow({
|
||||||
|
required bool value,
|
||||||
|
required String label,
|
||||||
|
TextStyle? textStyle,
|
||||||
|
GestureTapCallback? onTap,
|
||||||
|
}) {
|
||||||
|
return GestureDetector(
|
||||||
|
onTap: onTap,
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Radio(value: value),
|
||||||
|
Text(label, style: textStyle ?? AppFonts.yekan16.copyWith(color: AppColor.textColor)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ import 'package:rasadyar_chicken/presentation/utils/utils.dart';
|
|||||||
import 'package:rasadyar_core/core.dart';
|
import 'package:rasadyar_core/core.dart';
|
||||||
|
|
||||||
class BuyInProvinceWaitingLogic extends GetxController {
|
class BuyInProvinceWaitingLogic extends GetxController {
|
||||||
RxList<int> isExpandedList = <int>[].obs;
|
RxInt isExpandedListIndex = (-1).obs;
|
||||||
Rx<Jalali> fromDateFilter = Jalali.now().obs;
|
Rx<Jalali> fromDateFilter = Jalali.now().obs;
|
||||||
Rx<Jalali> toDateFilter = Jalali.now().obs;
|
Rx<Jalali> toDateFilter = Jalali.now().obs;
|
||||||
RxnString searchedValue = RxnString();
|
RxnString searchedValue = RxnString();
|
||||||
@@ -21,6 +21,13 @@ class BuyInProvinceWaitingLogic extends GetxController {
|
|||||||
Rx<Resource<PaginationModel<WaitingArrivalModel>>> waitingProduct =
|
Rx<Resource<PaginationModel<WaitingArrivalModel>>> waitingProduct =
|
||||||
Resource<PaginationModel<WaitingArrivalModel>>.loading().obs;
|
Resource<PaginationModel<WaitingArrivalModel>>.loading().obs;
|
||||||
|
|
||||||
|
TextEditingController weightController = TextEditingController();
|
||||||
|
TextEditingController countController = TextEditingController();
|
||||||
|
TextEditingController lossController = TextEditingController();
|
||||||
|
TextEditingController approvedWithOtpController = TextEditingController();
|
||||||
|
|
||||||
|
RxBool approvedWithOtpCode = false.obs;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onInit() {
|
void onInit() {
|
||||||
super.onInit();
|
super.onInit();
|
||||||
@@ -99,12 +106,13 @@ class BuyInProvinceWaitingLogic extends GetxController {
|
|||||||
state: 'accepted',
|
state: 'accepted',
|
||||||
receiverRealNumberOfCarcasses: model.realNumberOfCarcasses ?? 0,
|
receiverRealNumberOfCarcasses: model.realNumberOfCarcasses ?? 0,
|
||||||
receiverRealWeightOfCarcasses: model.realWeightOfCarcasses?.toInt() ?? 0,
|
receiverRealWeightOfCarcasses: model.realWeightOfCarcasses?.toInt() ?? 0,
|
||||||
registrationCode: model.registrationCode ?? 0,
|
registrationCode: model.registrationCode,
|
||||||
weightLossOfCarcasses: model.weightLossOfCarcasses?.toInt() ?? 0,
|
weightLossOfCarcasses: model.weightLossOfCarcasses?.toInt() ?? 0,
|
||||||
).toJson();
|
).toJson();
|
||||||
request.removeWhere((key, value) => value == null);
|
request.removeWhere((key, value) => value == null);
|
||||||
|
|
||||||
safeCall(
|
safeCall(
|
||||||
|
showError: true,
|
||||||
call: () async => await rootLogic.chickenRepository.setSateForArrivals(
|
call: () async => await rootLogic.chickenRepository.setSateForArrivals(
|
||||||
token: rootLogic.tokenService.accessToken.value!,
|
token: rootLogic.tokenService.accessToken.value!,
|
||||||
request: request,
|
request: request,
|
||||||
@@ -114,7 +122,10 @@ class BuyInProvinceWaitingLogic extends GetxController {
|
|||||||
},
|
},
|
||||||
onSuccess: (result) {
|
onSuccess: (result) {
|
||||||
getWaitingArrivals();
|
getWaitingArrivals();
|
||||||
// getBarGeneralInformation();
|
rootLogic.onRefresh();
|
||||||
|
clearApprovedController();
|
||||||
|
toggleExpansion();
|
||||||
|
Get.back();
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -137,8 +148,7 @@ class BuyInProvinceWaitingLogic extends GetxController {
|
|||||||
},
|
},
|
||||||
onSuccess: (result) {
|
onSuccess: (result) {
|
||||||
getWaitingArrivals();
|
getWaitingArrivals();
|
||||||
//TODO
|
rootLogic.onRefresh();
|
||||||
// getBarGeneralInformation();
|
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -152,4 +162,20 @@ class BuyInProvinceWaitingLogic extends GetxController {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void clearApprovedController() {
|
||||||
|
weightController.clear();
|
||||||
|
countController.clear();
|
||||||
|
lossController.clear();
|
||||||
|
approvedWithOtpController.clear();
|
||||||
|
approvedWithOtpCode.value = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void toggleExpansion({int? index}) {
|
||||||
|
if (isExpandedListIndex.value == index || index == null) {
|
||||||
|
isExpandedListIndex.value = -1;
|
||||||
|
} else {
|
||||||
|
isExpandedListIndex.value = index;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/services.dart';
|
||||||
import 'package:rasadyar_chicken/data/models/response/waiting_arrival/waiting_arrival.dart';
|
import 'package:rasadyar_chicken/data/models/response/waiting_arrival/waiting_arrival.dart';
|
||||||
import 'package:rasadyar_chicken/presentation/utils/string_utils.dart';
|
import 'package:rasadyar_chicken/presentation/utils/string_utils.dart';
|
||||||
import 'package:rasadyar_chicken/presentation/widget/list_item/list_item.dart' hide ListItem2;
|
|
||||||
|
|
||||||
import 'package:rasadyar_core/core.dart';
|
import 'package:rasadyar_core/core.dart';
|
||||||
|
|
||||||
import 'logic.dart';
|
import 'logic.dart';
|
||||||
@@ -26,15 +25,15 @@ class BuyInProvinceWaitingPage extends GetView<BuyInProvinceWaitingLogic> {
|
|||||||
var item = data.value.data!.results![index];
|
var item = data.value.data!.results![index];
|
||||||
return ObxValue((val) {
|
return ObxValue((val) {
|
||||||
return ExpandableListItem2(
|
return ExpandableListItem2(
|
||||||
selected: val.contains(index),
|
selected: controller.isExpandedListIndex.value == index,
|
||||||
onTap: () => controller.isExpandedList.toggle(index),
|
onTap: () => controller.toggleExpansion(index: index),
|
||||||
index: index,
|
index: index,
|
||||||
child: itemListWidget(item),
|
child: itemListWidget(item),
|
||||||
secondChild: itemListExpandedWidget(item),
|
secondChild: itemListExpandedWidget(item),
|
||||||
labelColor: AppColor.blueLight,
|
labelColor: AppColor.blueLight,
|
||||||
labelIcon: Assets.vec.timerSvg.path,
|
labelIcon: Assets.vec.timerSvg.path,
|
||||||
);
|
);
|
||||||
}, controller.isExpandedList);
|
}, controller.isExpandedListIndex);
|
||||||
},
|
},
|
||||||
itemCount: data.value.data?.results?.length ?? 0,
|
itemCount: data.value.data?.results?.length ?? 0,
|
||||||
separatorBuilder: (context, index) => SizedBox(height: 8.h),
|
separatorBuilder: (context, index) => SizedBox(height: 8.h),
|
||||||
@@ -184,25 +183,22 @@ class BuyInProvinceWaitingPage extends GetView<BuyInProvinceWaitingLogic> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
||||||
buildRow(
|
buildRow(title: 'مشخصات فروشنده', value: item.toSteward?.user?.fullname ?? 'N/A'),
|
||||||
title: 'مشخصات فروشنده',
|
|
||||||
value: item.steward?.user?.fullname ?? 'N/A',
|
|
||||||
),
|
|
||||||
buildRow(
|
buildRow(
|
||||||
title: 'تلفن فروشنده',
|
title: 'تلفن فروشنده',
|
||||||
value: item.steward?.user?.mobile ?? 'N/A',
|
value: item.toSteward?.user?.mobile ?? 'N/A',
|
||||||
valueStyle: AppFonts.yekan14.copyWith(color: AppColor.blueNormal),
|
valueStyle: AppFonts.yekan14.copyWith(color: AppColor.blueNormal),
|
||||||
),
|
),
|
||||||
buildRow(
|
buildRow(title: 'نوع تخصیص', value: item.quota?.faTitle ?? 'N/A'),
|
||||||
title: 'نوع تخصیص',
|
buildRow(title: 'سهمیه', value: item.allocationType?.faAllocationType ?? 'N/A'),
|
||||||
value: item.allocationType?.faAllocationType ?? 'N/A',
|
|
||||||
),
|
|
||||||
buildRow(title: 'محصول', value: item.product?.name ?? 'N/A'),
|
buildRow(title: 'محصول', value: item.product?.name ?? 'N/A'),
|
||||||
buildRow(
|
buildRow(
|
||||||
title: 'وزن خریداری شده',
|
title: 'وزن خریداری شده',
|
||||||
value: '${item.weightOfCarcasses?.separatedByCommaFa} کیلوگرم',
|
value: '${item.weightOfCarcasses?.separatedByCommaFa} کیلوگرم',
|
||||||
),
|
),
|
||||||
|
buildRow(title: 'قیمت هر کیلو', value: '${item.amount?.separatedByCommaFa} ریال'),
|
||||||
buildRow(title: 'قیمت کل', value: '${item.totalAmount?.separatedByCommaFa} ریال'),
|
buildRow(title: 'قیمت کل', value: '${item.totalAmount?.separatedByCommaFa} ریال'),
|
||||||
|
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
spacing: 16.w,
|
spacing: 16.w,
|
||||||
@@ -214,9 +210,7 @@ class BuyInProvinceWaitingPage extends GetView<BuyInProvinceWaitingLogic> {
|
|||||||
height: 40.h,
|
height: 40.h,
|
||||||
isLoading: data[item.key!] ?? false,
|
isLoading: data[item.key!] ?? false,
|
||||||
onPressed: () async {
|
onPressed: () async {
|
||||||
data[item.key!] = !(data[item.key!] ?? false);
|
await Get.bottomSheet(conformationBottomSheet(item), isScrollControlled: true);
|
||||||
await controller.acceptEntries(item);
|
|
||||||
data.remove(item.key!);
|
|
||||||
},
|
},
|
||||||
textStyle: AppFonts.yekan20.copyWith(color: Colors.white),
|
textStyle: AppFonts.yekan20.copyWith(color: Colors.white),
|
||||||
backgroundColor: AppColor.greenNormal,
|
backgroundColor: AppColor.greenNormal,
|
||||||
@@ -243,4 +237,109 @@ class BuyInProvinceWaitingPage extends GetView<BuyInProvinceWaitingLogic> {
|
|||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Widget conformationBottomSheet(WaitingArrivalModel item) {
|
||||||
|
controller.weightController.text = item.weightOfCarcasses.separatedByComma;
|
||||||
|
return BaseBottomSheet(
|
||||||
|
height: 430.h,
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
RTextField(
|
||||||
|
label: 'وزن(کیلوگرم)',
|
||||||
|
controller: controller.weightController,
|
||||||
|
keyboardType: TextInputType.number,
|
||||||
|
inputFormatters: [FilteringTextInputFormatter.digitsOnly, SeparatorInputFormatter()],
|
||||||
|
),
|
||||||
|
SizedBox(height: 16.h),
|
||||||
|
RTextField(
|
||||||
|
label: 'حجم(قطعه)',
|
||||||
|
controller: controller.countController,
|
||||||
|
keyboardType: TextInputType.number,
|
||||||
|
inputFormatters: [FilteringTextInputFormatter.digitsOnly, SeparatorInputFormatter()],
|
||||||
|
),
|
||||||
|
SizedBox(height: 16.h),
|
||||||
|
RTextField(
|
||||||
|
label: 'افت وزن(کیلوگرم)',
|
||||||
|
controller: controller.lossController,
|
||||||
|
keyboardType: TextInputType.number,
|
||||||
|
inputFormatters: [FilteringTextInputFormatter.digitsOnly, SeparatorInputFormatter()],
|
||||||
|
),
|
||||||
|
SizedBox(height: 16.h),
|
||||||
|
|
||||||
|
Text('تایید ', style: AppFonts.yekan16Bold.copyWith(color: AppColor.textColor)),
|
||||||
|
ObxValue((data) {
|
||||||
|
return Column(
|
||||||
|
children: [
|
||||||
|
RadioGroup(
|
||||||
|
groupValue: data.value,
|
||||||
|
onChanged: (value) {
|
||||||
|
controller.approvedWithOtpCode.value = value ?? false;
|
||||||
|
},
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
|
children: [
|
||||||
|
radioRow(
|
||||||
|
value: true,
|
||||||
|
label: ' با کد احراز',
|
||||||
|
onTap: () {
|
||||||
|
controller.approvedWithOtpCode.value = true;
|
||||||
|
},
|
||||||
|
),
|
||||||
|
radioRow(
|
||||||
|
value: false,
|
||||||
|
label: 'بدون کد احراز',
|
||||||
|
onTap: () {
|
||||||
|
controller.approvedWithOtpCode.value = false;
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Visibility(
|
||||||
|
child: RTextField(
|
||||||
|
controller: controller.approvedWithOtpController,
|
||||||
|
label: 'کد احراز',
|
||||||
|
keyboardType: TextInputType.number,
|
||||||
|
),
|
||||||
|
visible: data.value,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}, controller.approvedWithOtpCode),
|
||||||
|
SizedBox(height: 30.h),
|
||||||
|
ObxValue((data) {
|
||||||
|
return RElevated(
|
||||||
|
enabled: controller.approvedWithOtpCode.value
|
||||||
|
? controller.approvedWithOtpController.text.isNotEmpty
|
||||||
|
: true,
|
||||||
|
text: 'تایید',
|
||||||
|
onPressed: () async {
|
||||||
|
await controller.acceptEntries(item);
|
||||||
|
},
|
||||||
|
isFullWidth: true,
|
||||||
|
);
|
||||||
|
}, controller.approvedWithOtpCode),
|
||||||
|
SizedBox(height: 20.h),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget radioRow({
|
||||||
|
required bool value,
|
||||||
|
required String label,
|
||||||
|
TextStyle? textStyle,
|
||||||
|
GestureTapCallback? onTap,
|
||||||
|
}) {
|
||||||
|
return GestureDetector(
|
||||||
|
onTap: onTap,
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Radio(value: value),
|
||||||
|
Text(label, style: textStyle ?? AppFonts.yekan16.copyWith(color: AppColor.textColor)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11,9 +11,9 @@ import 'package:rasadyar_core/core.dart';
|
|||||||
|
|
||||||
class BuyOutOfProvinceLogic extends GetxController {
|
class BuyOutOfProvinceLogic extends GetxController {
|
||||||
late List<String> routesName;
|
late List<String> routesName;
|
||||||
RxBool isExpanded = false.obs;
|
|
||||||
RxBool isSubmitButtonEnabled = false.obs;
|
RxBool isSubmitButtonEnabled = false.obs;
|
||||||
RxList<int> isExpandedList = <int>[].obs;
|
RxInt expandedListIndex = (-1).obs;
|
||||||
|
|
||||||
final RxInt currentPage = 1.obs;
|
final RxInt currentPage = 1.obs;
|
||||||
final RxBool isLoadingMoreAllocationsMade = false.obs;
|
final RxBool isLoadingMoreAllocationsMade = false.obs;
|
||||||
final RxBool isOnLoadingSubmitOrEdit = false.obs;
|
final RxBool isOnLoadingSubmitOrEdit = false.obs;
|
||||||
@@ -34,14 +34,15 @@ class BuyOutOfProvinceLogic extends GetxController {
|
|||||||
|
|
||||||
StewardRootLogic rootLogic = Get.find<StewardRootLogic>();
|
StewardRootLogic rootLogic = Get.find<StewardRootLogic>();
|
||||||
|
|
||||||
BuyLogic get buyLogic => Get.find<BuyLogic>();
|
BuyLogic buyLogic = Get.find<BuyLogic>();
|
||||||
|
|
||||||
SaleLogic get outOfTheProvinceLogic => Get.find<SaleLogic>();
|
SaleLogic outOfTheProvinceLogic = Get.find<SaleLogic>();
|
||||||
|
|
||||||
GlobalKey<FormState> formKey = GlobalKey<FormState>();
|
GlobalKey<FormState> formKey = GlobalKey<FormState>();
|
||||||
TextEditingController sellerNameController = TextEditingController();
|
TextEditingController sellerNameController = TextEditingController();
|
||||||
TextEditingController sellerPhoneController = TextEditingController();
|
TextEditingController sellerPhoneController = TextEditingController();
|
||||||
TextEditingController carcassWeightController = TextEditingController();
|
TextEditingController carcassWeightController = TextEditingController();
|
||||||
|
TextEditingController carcassCountController = TextEditingController();
|
||||||
|
|
||||||
Rx<Jalali> fromDateFilter = Jalali.now().obs;
|
Rx<Jalali> fromDateFilter = Jalali.now().obs;
|
||||||
Rx<Jalali> toDateFilter = Jalali.now().obs;
|
Rx<Jalali> toDateFilter = Jalali.now().obs;
|
||||||
@@ -51,8 +52,6 @@ class BuyOutOfProvinceLogic extends GetxController {
|
|||||||
void onInit() {
|
void onInit() {
|
||||||
super.onInit();
|
super.onInit();
|
||||||
routesName = [...buyLogic.routesName, 'خارج استان'].toList();
|
routesName = [...buyLogic.routesName, 'خارج استان'].toList();
|
||||||
|
|
||||||
fLog('BuyOutOfProvinceLogic ${rootLogic.stewardSalesInfoDashboard}');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -76,7 +75,6 @@ class BuyOutOfProvinceLogic extends GetxController {
|
|||||||
sellerNameController.dispose();
|
sellerNameController.dispose();
|
||||||
sellerPhoneController.dispose();
|
sellerPhoneController.dispose();
|
||||||
carcassWeightController.dispose();
|
carcassWeightController.dispose();
|
||||||
isExpandedList.clear();
|
|
||||||
|
|
||||||
super.onClose();
|
super.onClose();
|
||||||
}
|
}
|
||||||
@@ -144,9 +142,15 @@ class BuyOutOfProvinceLogic extends GetxController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void setupListeners() {
|
void setupListeners() {
|
||||||
sellerNameController.addListener(checkFormValid);
|
sellerNameController.addListener(() {
|
||||||
|
checkFormValid();
|
||||||
|
if (!isSubmitButtonEnabled.value) {
|
||||||
|
isSubmitButtonEnabled.value = !isSubmitButtonEnabled.value;
|
||||||
|
}
|
||||||
|
});
|
||||||
sellerPhoneController.addListener(checkFormValid);
|
sellerPhoneController.addListener(checkFormValid);
|
||||||
carcassWeightController.addListener(checkFormValid);
|
carcassWeightController.addListener(checkFormValid);
|
||||||
|
carcassCountController.addListener(checkFormValid);
|
||||||
|
|
||||||
ever(selectedProvince, (_) => checkFormValid());
|
ever(selectedProvince, (_) => checkFormValid());
|
||||||
ever(selectedCity, (_) => checkFormValid());
|
ever(selectedCity, (_) => checkFormValid());
|
||||||
@@ -164,19 +168,26 @@ class BuyOutOfProvinceLogic extends GetxController {
|
|||||||
sellerNameController.text.isNotEmpty &&
|
sellerNameController.text.isNotEmpty &&
|
||||||
sellerPhoneController.text.isNotEmpty &&
|
sellerPhoneController.text.isNotEmpty &&
|
||||||
carcassWeightController.text.isNotEmpty &&
|
carcassWeightController.text.isNotEmpty &&
|
||||||
|
carcassCountController.text.isNotEmpty &&
|
||||||
selectedProvince.value != null &&
|
selectedProvince.value != null &&
|
||||||
selectedCity.value != null &&
|
selectedCity.value != null &&
|
||||||
selectedProduct.value != null &&
|
selectedProduct.value != null &&
|
||||||
selectedImage.value != null;
|
selectedImage.value != null;
|
||||||
|
|
||||||
|
if (isSubmitButtonEnabled.value) {
|
||||||
|
isOnLoadingSubmitOrEdit.value = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<bool> createStewardPurchaseOutOfProvince() async {
|
Future<bool> createStewardPurchaseOutOfProvince() async {
|
||||||
bool res = false;
|
bool res = false;
|
||||||
isOnLoadingSubmitOrEdit.value = true;
|
isOnLoadingSubmitOrEdit.value = true;
|
||||||
if (!(formKey.currentState?.validate() ?? false)) {
|
if (!(formKey.currentState?.validate() ?? false)) {
|
||||||
|
isOnLoadingSubmitOrEdit.value = false;
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
await safeCall(
|
await safeCall(
|
||||||
|
showError: true,
|
||||||
call: () async {
|
call: () async {
|
||||||
CreateStewardFreeBar createStewardFreeBar = CreateStewardFreeBar(
|
CreateStewardFreeBar createStewardFreeBar = CreateStewardFreeBar(
|
||||||
productKey: selectedProduct.value!.key,
|
productKey: selectedProduct.value!.key,
|
||||||
@@ -188,7 +199,7 @@ class BuyOutOfProvinceLogic extends GetxController {
|
|||||||
barImage: _base64Image.value,
|
barImage: _base64Image.value,
|
||||||
date: DateTime.now().formattedYHMS,
|
date: DateTime.now().formattedYHMS,
|
||||||
);
|
);
|
||||||
final res = await rootLogic.chickenRepository.createStewardPurchasesOutSideOfTheProvince(
|
await rootLogic.chickenRepository.createStewardPurchasesOutSideOfTheProvince(
|
||||||
token: rootLogic.tokenService.accessToken.value!,
|
token: rootLogic.tokenService.accessToken.value!,
|
||||||
body: createStewardFreeBar,
|
body: createStewardFreeBar,
|
||||||
);
|
);
|
||||||
@@ -196,6 +207,7 @@ class BuyOutOfProvinceLogic extends GetxController {
|
|||||||
onSuccess: (result) {
|
onSuccess: (result) {
|
||||||
getStewardPurchaseOutOfProvince();
|
getStewardPurchaseOutOfProvince();
|
||||||
resetSubmitForm();
|
resetSubmitForm();
|
||||||
|
toggleExpansion();
|
||||||
res = true;
|
res = true;
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@@ -229,11 +241,31 @@ class BuyOutOfProvinceLogic extends GetxController {
|
|||||||
isSubmitButtonEnabled.value = true;
|
isSubmitButtonEnabled.value = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Future<void> editStewardPurchaseOutOfProvince(StewardFreeBar item) async {
|
||||||
|
CreateStewardFreeBar edit = CreateStewardFreeBar(
|
||||||
|
productKey: selectedProduct.value!.key,
|
||||||
|
killHouseName: sellerNameController.text,
|
||||||
|
killHouseMobile: sellerPhoneController.text,
|
||||||
|
province: selectedProvince.value!.name,
|
||||||
|
city: selectedCity.value!.name,
|
||||||
|
weightOfCarcasses: int.parse(carcassWeightController.text.clearComma),
|
||||||
|
barImage: _base64Image.value,
|
||||||
|
date: DateTime.now().formattedYHMS,
|
||||||
|
);
|
||||||
|
|
||||||
|
await safeCall(
|
||||||
|
call: () => rootLogic.chickenRepository.editStewardPurchasesOutSideOfTheProvince(
|
||||||
|
token: rootLogic.tokenService.accessToken.value!,
|
||||||
|
queryParameters: buildRawQueryParams(queryParams: {'key': key}),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
Future<void> deleteStewardPurchaseOutOfProvince(String key) async {
|
Future<void> deleteStewardPurchaseOutOfProvince(String key) async {
|
||||||
await safeCall(
|
await safeCall(
|
||||||
call: () => rootLogic.chickenRepository.deleteStewardPurchasesOutSideOfTheProvince(
|
call: () => rootLogic.chickenRepository.editStewardPurchasesOutSideOfTheProvince(
|
||||||
token: rootLogic.tokenService.accessToken.value!,
|
token: rootLogic.tokenService.accessToken.value!,
|
||||||
stewardFreeBarKey: key,
|
queryParameters: buildRawQueryParams(queryParams: {'key': key}),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -243,4 +275,12 @@ class BuyOutOfProvinceLogic extends GetxController {
|
|||||||
await rootLogic.onRefresh();
|
await rootLogic.onRefresh();
|
||||||
await getStewardPurchaseOutOfProvince();
|
await getStewardPurchaseOutOfProvince();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void toggleExpansion({int? index}) {
|
||||||
|
if (expandedListIndex.value == index || index == null) {
|
||||||
|
expandedListIndex.value = -1; // Collapse if the same index is tapped
|
||||||
|
} else {
|
||||||
|
expandedListIndex.value = index; // Expand the new index
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -43,15 +43,15 @@ class BuyOutOfProvincePage extends GetView<BuyOutOfProvinceLogic> {
|
|||||||
var item = data.value.data!.results![index];
|
var item = data.value.data!.results![index];
|
||||||
return ObxValue((val) {
|
return ObxValue((val) {
|
||||||
return ExpandableListItem2(
|
return ExpandableListItem2(
|
||||||
selected: val.contains(index),
|
selected: val.value == index,
|
||||||
onTap: () => controller.isExpandedList.toggle(index),
|
onTap: () => controller.toggleExpansion(index: index),
|
||||||
index: index,
|
index: index,
|
||||||
child: itemListWidget(item),
|
child: itemListWidget(item),
|
||||||
secondChild: itemListExpandedWidget(item),
|
secondChild: itemListExpandedWidget(item),
|
||||||
labelColor: AppColor.blueLight,
|
labelColor: AppColor.blueLight,
|
||||||
labelIcon: Assets.vec.truckFastOutlinedSvg.path,
|
labelIcon: Assets.vec.truckFastOutlinedSvg.path,
|
||||||
);
|
);
|
||||||
}, controller.isExpandedList);
|
}, controller.expandedListIndex);
|
||||||
},
|
},
|
||||||
itemCount: data.value.data?.results?.length ?? 0,
|
itemCount: data.value.data?.results?.length ?? 0,
|
||||||
separatorBuilder: (context, index) => SizedBox(height: 8.h),
|
separatorBuilder: (context, index) => SizedBox(height: 8.h),
|
||||||
@@ -380,6 +380,16 @@ class BuyOutOfProvincePage extends GetView<BuyOutOfProvinceLogic> {
|
|||||||
SeparatorInputFormatter(),
|
SeparatorInputFormatter(),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
||||||
|
UnitTextField(
|
||||||
|
controller: controller.carcassCountController,
|
||||||
|
hint: 'حجم',
|
||||||
|
unit: 'قطعه',
|
||||||
|
inputFormatters: [
|
||||||
|
FilteringTextInputFormatter.digitsOnly,
|
||||||
|
SeparatorInputFormatter(),
|
||||||
|
],
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import 'package:rasadyar_core/core.dart';
|
|||||||
class SalesOutOfProvinceLogic extends GetxController {
|
class SalesOutOfProvinceLogic extends GetxController {
|
||||||
StewardRootLogic rootLogic = Get.find<StewardRootLogic>();
|
StewardRootLogic rootLogic = Get.find<StewardRootLogic>();
|
||||||
|
|
||||||
SaleLogic get saleLogic => Get.find<SaleLogic>();
|
SaleLogic saleLogic = Get.find<SaleLogic>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -148,7 +148,7 @@ class SalesOutOfProvinceLogic extends GetxController {
|
|||||||
|
|
||||||
Future<void> deleteStewardPurchaseOutOfProvince(String key) async {
|
Future<void> deleteStewardPurchaseOutOfProvince(String key) async {
|
||||||
await safeCall(
|
await safeCall(
|
||||||
call: () => rootLogic.chickenRepository.deleteStewardPurchasesOutSideOfTheProvince(
|
call: () => rootLogic.chickenRepository.editStewardPurchasesOutSideOfTheProvince(
|
||||||
token: rootLogic.tokenService.accessToken.value!,
|
token: rootLogic.tokenService.accessToken.value!,
|
||||||
stewardFreeBarKey: key,
|
stewardFreeBarKey: key,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -32,45 +32,7 @@ class SalesOutOfProvincePage extends GetView<SalesOutOfProvinceLogic> {
|
|||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
inventoryWidget(controller.rootLogic),
|
inventoryWidget(controller.rootLogic),
|
||||||
/*Padding(
|
|
||||||
padding: const EdgeInsets.all(8.0),
|
|
||||||
child: Row(
|
|
||||||
spacing: 8,
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
child: _informationLabelCard(
|
|
||||||
title: 'مانده دولتی',
|
|
||||||
titleColor: AppColor.textColor,
|
|
||||||
borderColor: Color(0xFFFFAE00),
|
|
||||||
|
|
||||||
description: 356952222222.separatedByCommaFa,
|
|
||||||
iconPath: Assets.vec.cubeCardGovermentSvg.path,
|
|
||||||
bgDescriptionColor: Colors.white,
|
|
||||||
gradient: LinearGradient(
|
|
||||||
begin: Alignment.topCenter,
|
|
||||||
end: Alignment.bottomCenter,
|
|
||||||
colors: [Color(0xFFFFD47A), Colors.white],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
child: _informationLabelCard(
|
|
||||||
title: 'مانده آزاد',
|
|
||||||
borderColor: const Color(0xFF9758FF),
|
|
||||||
description: 9658554788.separatedByCommaFa,
|
|
||||||
unit: 'KG',
|
|
||||||
iconPath: Assets.vec.cubeCardFreeSvg.path,
|
|
||||||
bgDescriptionColor: Colors.white,
|
|
||||||
gradient: LinearGradient(
|
|
||||||
begin: Alignment.topCenter,
|
|
||||||
end: Alignment.bottomCenter,
|
|
||||||
colors: [const Color(0xFFD3B9FF), Colors.white],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),*/
|
|
||||||
ObxValue((data) {
|
ObxValue((data) {
|
||||||
return RPaginatedListView(
|
return RPaginatedListView(
|
||||||
onLoadMore: () async => controller.getOutProvinceSales(true),
|
onLoadMore: () async => controller.getOutProvinceSales(true),
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ class SalesOutOfProvinceSalesListLogic extends GetxController {
|
|||||||
Future<void> deleteStewardPurchaseOutOfProvince(String key) async {
|
Future<void> deleteStewardPurchaseOutOfProvince(String key) async {
|
||||||
await safeCall(
|
await safeCall(
|
||||||
call: () => rootLogic.chickenRepository
|
call: () => rootLogic.chickenRepository
|
||||||
.deleteStewardPurchasesOutSideOfTheProvince(
|
.editStewardPurchasesOutSideOfTheProvince(
|
||||||
token: rootLogic.tokenService.accessToken.value!,
|
token: rootLogic.tokenService.accessToken.value!,
|
||||||
stewardFreeBarKey: key,
|
stewardFreeBarKey: key,
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -19,6 +19,10 @@ extension XStringUtils on String {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String get faTitle {
|
||||||
|
return utilsMap[this] ?? this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, String> utilsMap = {
|
Map<String, String> utilsMap = {
|
||||||
@@ -30,4 +34,5 @@ Map<String, String> utilsMap = {
|
|||||||
'pending': 'در انتظار',
|
'pending': 'در انتظار',
|
||||||
'accepted': 'تایید شده',
|
'accepted': 'تایید شده',
|
||||||
'guild': 'صنف',
|
'guild': 'صنف',
|
||||||
|
'governmental': 'دولتی',
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -107,3 +107,44 @@ class ContainerBreadcrumb extends Breadcrumb {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
class _TriangleClipper extends CustomClipper<Path> {
|
||||||
|
final bool isFirst;
|
||||||
|
final bool isLast;
|
||||||
|
|
||||||
|
_TriangleClipper({required this.isFirst, required this.isLast});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Path getClip(Size size) {
|
||||||
|
final Path path = Path();
|
||||||
|
|
||||||
|
if (isFirst) {
|
||||||
|
path.moveTo(20, 0);
|
||||||
|
path.lineTo(size.width, 0);
|
||||||
|
path.lineTo(size.width, size.height);
|
||||||
|
path.lineTo(20, size.height);
|
||||||
|
} else {
|
||||||
|
path.moveTo(20, 0);
|
||||||
|
path.lineTo(size.width, 0);
|
||||||
|
path.lineTo(size.width - 20, size.height / 2);
|
||||||
|
path.lineTo(size.width, size.height);
|
||||||
|
path.lineTo(20, size.height);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isLast) {
|
||||||
|
path.moveTo(0, 0);
|
||||||
|
path.lineTo(0, size.height);
|
||||||
|
} else {
|
||||||
|
path.moveTo(20, 0);
|
||||||
|
path.lineTo(0, size.height / 2);
|
||||||
|
path.lineTo(20, size.height);
|
||||||
|
}
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
bool shouldReclip(CustomClipper<Path> oldClipper) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}*/
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
name: rasadyar_app
|
name: rasadyar_app
|
||||||
description: "A new Flutter project."
|
description: "A new Flutter project."
|
||||||
publish_to: 'none'
|
publish_to: 'none'
|
||||||
version: 1.3.20+17
|
version: 1.3.21+18
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ^3.9.2
|
sdk: ^3.9.2
|
||||||
|
|||||||
Reference in New Issue
Block a user