feat : chicken root page , inventory , sale in province
This commit is contained in:
1
assets/icons/inside.svg
Normal file
1
assets/icons/inside.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg viewBox="0 0 512 512" xmlns="http://www.w3.org/2000/svg"><g id="Flat"><g id="Arrow-33" fill="#8664cc"><path d="m472.95372 66.79135a11.18384 11.18384 0 0 1 0 15.81634l-181.71641 181.7164 36.00209 13.81319c13.36209 4.31352 9.07489 18.76609-1.09684 20.04494-18.87434 2.373-70.61994 4.4591-94.14164 5.31638a11.089 11.089 0 0 1 -11.50356-11.5036c.85727-23.5217 2.94337-75.26729 5.31638-94.14164 1.31052-10.42363 15.81188-14.20967 20.04494-1.09684l13.81318 36.00209 181.71641-181.71638a11.18383 11.18383 0 0 1 15.81633 0z"/><path d="m465.38749 484.35065h-401.57812a24 24 0 0 1 -24-24v-401.57813a24 24 0 0 1 24-24h205.375a10 10 0 0 1 10 10v28a10 10 0 0 1 -10 10h-181.375v353.57813h353.57812v-183.3125a10 10 0 0 1 10-10h28a10 10 0 0 1 10 10v207.3125a24 24 0 0 1 -24 24z"/></g></g><g id="Outline"><g id="Arrow-33-2" fill="#222123" data-name="Arrow-33"><path d="m231.60157 311.00586a18.59863 18.59863 0 0 1 -18.59912-19.28418c.998-27.39258 3.02295-76.13379 5.37011-94.80371 2.32631-18.51226 27.80257-22.98255 34.55469-2.67578l9.60938 25.0459 173.54837-173.54981a18.70785 18.70785 0 0 1 26.42285 0l15.749 15.749.00049.001a18.67348 18.67348 0 0 1 -.00049 26.42285l-173.54835 173.54887 25.04492 9.60938c20.47232 6.80642 15.65458 32.24873-2.6748 34.55468-18.65625 2.34571-67.40576 4.3711-94.8042 5.37012q-.33691.01168-.67285.01168zm1.65381-112.2168c-2.35987 18.77051-4.4668 71.626-5.2627 93.47949a3.58834 3.58834 0 0 0 3.73535 3.73536c21.85791-.79688 74.72266-2.9043 93.479-5.2627 2.37192-.29828 5.27469-3.67839-.272-5.46582-.36238-.1185 1.77168.68686-36.38427-13.94922a7.50431 7.50431 0 0 1 -2.6167-12.30566l181.71634-181.7168a3.68322 3.68322 0 0 0 -.00049-5.21l-15.74854-15.748a3.68616 3.68616 0 0 0 -5.21 0l-181.71627 181.71679a7.50472 7.50472 0 0 1 -12.30566-2.61719c-14.16716-36.93609-13.82894-36.01573-13.94775-36.38476-1.69999-5.26227-5.1275-2.96855-5.46631-.27149z"/><path d="m465.3877 491.85059h-401.57812a31.5357 31.5357 0 0 1 -31.5-31.5v-401.57813a31.5357 31.5357 0 0 1 31.5-31.5h205.375a17.52 17.52 0 0 1 17.5 17.5v28a17.52 17.52 0 0 1 -17.5 17.5h-173.875v338.57813h338.57812v-175.8125a17.52 17.52 0 0 1 17.5-17.5h28a17.52 17.52 0 0 1 17.5 17.5v207.3125a31.5357 31.5357 0 0 1 -31.5 31.5zm-401.57812-449.57813a16.51835 16.51835 0 0 0 -16.5 16.5v401.57813a16.51835 16.51835 0 0 0 16.5 16.5h401.57812a16.51835 16.51835 0 0 0 16.5-16.5v-207.3125a2.50263 2.50263 0 0 0 -2.5-2.5h-28a2.50263 2.50263 0 0 0 -2.5 2.5v183.3125a7.49975 7.49975 0 0 1 -7.5 7.5h-353.57812a7.49975 7.49975 0 0 1 -7.5-7.5v-353.57813a7.49974 7.49974 0 0 1 7.5-7.5h181.375a2.50263 2.50263 0 0 0 2.5-2.5v-28a2.50263 2.50263 0 0 0 -2.5-2.5z"/></g></g></svg>
|
||||
|
After Width: | Height: | Size: 2.6 KiB |
27
assets/icons/outside.svg
Normal file
27
assets/icons/outside.svg
Normal file
@@ -0,0 +1,27 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Capa_1" x="0px" y="0px" viewBox="0 0 512 512" style="enable-background:new 0 0 512 512;" xml:space="preserve" width="512" height="512">
|
||||
<g>
|
||||
<path style="fill:#9D63EB;" d="M341.549,260.394H71.866v66.183l30.002,30.001c9.449,9.448,25.604,2.756,25.604-10.606l0-29.971 		l233.47,0c13.364,0,20.056-16.157,10.607-25.607L341.549,260.394z"/>
|
||||
<path style="fill:#AE7DF0;" d="M341.549,260.394L337.156,256l34.393-34.394c9.449-9.449,2.757-25.606-10.607-25.607h-233.47 		v-29.971c0-13.362-16.155-20.054-25.604-10.606l-89.975,89.971c-5.858,5.857-5.858,15.355,0,21.212l59.973,59.971 		c9.45,9.449,25.606,2.757,25.606-10.607l0-14.97c0-8.284,6.716-15,15-15l218.47,0C344.306,286,350.999,269.843,341.549,260.394z"/>
|
||||
<polygon style="fill:#ACD8E3;" points="474.5,61 459.5,91 459.5,421 474.5,451 504.5,451 504.5,61 	"/>
|
||||
<polygon style="fill:#C2E9F2;" points="166,61 166,166 226,166 226,121 444.5,121 444.5,391 226,391 226,346 166,346 166,451 		474.5,451 474.5,61 	"/>
|
||||
|
||||
<polyline style="fill:none;stroke:#000000;stroke-width:15;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;" points=" 		444.5,271 444.5,391 226,391 226,346 166,346 166,451 504.5,451 504.5,61 166,61 166,166 226,166 226,121 444.5,121 444.5,241 	"/>
|
||||
<path style="fill:none;stroke:#000000;stroke-width:15;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;" d=" 		M256,316l104.943,0c13.363,0,20.056-16.157,10.607-25.606L337.156,256l34.393-34.393c9.45-9.449,2.757-25.607-10.607-25.607 		l-233.47,0v-29.97c0-13.363-16.157-20.056-25.606-10.607l-89.973,89.97c-5.858,5.858-5.858,15.355,0,21.212l89.975,89.971 		c9.449,9.448,25.604,2.756,25.604-10.606V316L226,316"/>
|
||||
</g>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.9 KiB |
1
assets/icons/whare_house.svg
Normal file
1
assets/icons/whare_house.svg
Normal file
File diff suppressed because one or more lines are too long
|
After Width: | Height: | Size: 51 KiB |
@@ -1,5 +1,6 @@
|
||||
|
||||
import 'package:rasadyar_auth/auth.dart';
|
||||
import 'package:rasadyar_chicken/data/di/chicken_di.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
final di = GetIt.instance;
|
||||
@@ -8,6 +9,7 @@ Future<void> setupInjection() async{
|
||||
await setupAuthDI();
|
||||
await setupAllCoreProvider();
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -8,4 +8,7 @@ class AssetsRes {
|
||||
|
||||
static const String PROJECT_NAME = 'rasadyar_app';
|
||||
static const String PROJECT_VERSION = '1.2.0+2';
|
||||
static const String INSIDE = 'assets/icons/inside.svg';
|
||||
static const String OUTSIDE = 'assets/icons/outside.svg';
|
||||
static const String WHARE_HOUSE = 'assets/icons/whare_house.svg';
|
||||
}
|
||||
|
||||
@@ -11,8 +11,6 @@ Future<void> setupAuthDI() async {
|
||||
diAuth.registerLazySingleton(() => DioRemoteManager());
|
||||
diAuth.registerLazySingleton<DioRemote>(() => DioRemote());
|
||||
|
||||
/* final manager = diAuth.get<DioRemoteManager>();
|
||||
final dioRemote = await manager.setEnvironment(ApiEnvironment.dam);*/
|
||||
|
||||
final dioRemote = diAuth.get<DioRemote>();
|
||||
await dioRemote.init();
|
||||
|
||||
6
packages/chicken/build.yaml
Normal file
6
packages/chicken/build.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
targets:
|
||||
$default:
|
||||
builders:
|
||||
json_serializable:
|
||||
options:
|
||||
field_rename: snake
|
||||
14
packages/chicken/lib/data/common/constant.dart
Normal file
14
packages/chicken/lib/data/common/constant.dart
Normal file
@@ -0,0 +1,14 @@
|
||||
enum ApiEnvironment {
|
||||
dam(url: 'https://api.dam.rasadyar.net/');
|
||||
|
||||
const ApiEnvironment({required this.url});
|
||||
|
||||
final String url;
|
||||
|
||||
String get baseUrl {
|
||||
switch (this) {
|
||||
case ApiEnvironment.dam:
|
||||
return url;
|
||||
}
|
||||
}
|
||||
}
|
||||
58
packages/chicken/lib/data/common/dio_error_handler.dart
Normal file
58
packages/chicken/lib/data/common/dio_error_handler.dart
Normal file
@@ -0,0 +1,58 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
class DioErrorHandler {
|
||||
void handle(DioException error) {
|
||||
switch (error.response?.statusCode) {
|
||||
case 401:
|
||||
_handleGeneric(error);
|
||||
break;
|
||||
case 403:
|
||||
_handleGeneric(error);
|
||||
break;
|
||||
|
||||
case 410:
|
||||
_handle410();
|
||||
break;
|
||||
default:
|
||||
_handleGeneric(error);
|
||||
}
|
||||
}
|
||||
|
||||
//wrong password/user name => "detail": "No active account found with the given credentials" - 401
|
||||
void _handle410() {
|
||||
Get.showSnackbar(_errorSnackBar('نام کاربری یا رمز عبور اشتباه است'));
|
||||
}
|
||||
|
||||
//wrong captcha => "detail": "Captcha code is incorrect" - 403
|
||||
void _handle403() {}
|
||||
|
||||
void _handleGeneric(DioException error) {
|
||||
Get.showSnackbar(
|
||||
_errorSnackBar(
|
||||
error.response?.data.keys.first == 'is_user'
|
||||
? 'کاربر با این شماره تلفن وجود ندارد'
|
||||
: error.response?.data[error.response?.data.keys.first] ??
|
||||
'خطا در برقراری ارتباط با سرور',
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
GetSnackBar _errorSnackBar(String message) {
|
||||
return GetSnackBar(
|
||||
titleText: Text(
|
||||
'خطا',
|
||||
style: AppFonts.yekan14.copyWith(color: Colors.white),
|
||||
),
|
||||
messageText: Text(
|
||||
message,
|
||||
style: AppFonts.yekan12.copyWith(color: Colors.white),
|
||||
),
|
||||
backgroundColor: AppColor.error,
|
||||
margin: EdgeInsets.symmetric(horizontal: 12, vertical: 8),
|
||||
borderRadius: 12,
|
||||
duration: Duration(milliseconds: 3500),
|
||||
snackPosition: SnackPosition.TOP,
|
||||
);
|
||||
}
|
||||
}
|
||||
33
packages/chicken/lib/data/common/dio_manager.dart
Normal file
33
packages/chicken/lib/data/common/dio_manager.dart
Normal file
@@ -0,0 +1,33 @@
|
||||
import 'package:rasadyar_auth/data/repositories/auth_repository_imp.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
import '../di/chicken_di.dart';
|
||||
import 'constant.dart';
|
||||
|
||||
class DioRemoteManager {
|
||||
DioRemote? _currentClient;
|
||||
ApiEnvironment? _currentEnv;
|
||||
|
||||
Future<DioRemote> setEnvironment([
|
||||
ApiEnvironment env = ApiEnvironment.dam,
|
||||
]) async {
|
||||
if (_currentEnv != env) {
|
||||
_currentClient = DioRemote(baseUrl: env.baseUrl);
|
||||
await _currentClient?.init();
|
||||
_currentEnv = env;
|
||||
}
|
||||
return _currentClient!;
|
||||
}
|
||||
|
||||
DioRemote get currentClient {
|
||||
if (_currentClient == null) {
|
||||
throw Exception('Call setEnvironment() before accessing DioRemote.');
|
||||
}
|
||||
|
||||
return _currentClient!;
|
||||
}
|
||||
|
||||
ApiEnvironment? get currentEnv => _currentEnv;
|
||||
}
|
||||
|
||||
|
||||
19
packages/chicken/lib/data/di/chicken_di.dart
Normal file
19
packages/chicken/lib/data/di/chicken_di.dart
Normal file
@@ -0,0 +1,19 @@
|
||||
import 'package:rasadyar_auth/data/di/auth_di.dart';
|
||||
import 'package:rasadyar_auth/data/services/token_storage_service.dart';
|
||||
import 'package:rasadyar_chicken/data/repositories/chicken_repository_imp.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
GetIt diChicken = GetIt.instance;
|
||||
|
||||
Future<void> setupChickenDI() async {
|
||||
var tokenService = Get.find<TokenStorageService>();
|
||||
|
||||
diAuth.registerLazySingleton<DioRemote>(
|
||||
() => DioRemote(baseUrl: tokenService.baseurl.value),
|
||||
);
|
||||
final dioRemote = diAuth.get<DioRemote>();
|
||||
await dioRemote.init();
|
||||
diAuth.registerLazySingleton<ChickenRepositoryImpl>(
|
||||
() => ChickenRepositoryImpl(dioRemote),
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'conform_allocation.freezed.dart';
|
||||
part 'conform_allocation.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class ConformAllocation with _$ConformAllocation {
|
||||
factory ConformAllocation({
|
||||
String? allocation_key,
|
||||
int? number_of_carcasses,
|
||||
int? weight_of_carcasses,
|
||||
int? amount,
|
||||
int? total_amount,
|
||||
}) = _ConformAllocation;
|
||||
|
||||
factory ConformAllocation.fromJson(Map<String, dynamic> json) =>
|
||||
_$ConformAllocationFromJson(json);
|
||||
}
|
||||
@@ -0,0 +1,160 @@
|
||||
// dart format width=80
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'conform_allocation.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
/// @nodoc
|
||||
mixin _$ConformAllocation {
|
||||
|
||||
String? get allocation_key; int? get number_of_carcasses; int? get weight_of_carcasses; int? get amount; int? get total_amount;
|
||||
/// Create a copy of ConformAllocation
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$ConformAllocationCopyWith<ConformAllocation> get copyWith => _$ConformAllocationCopyWithImpl<ConformAllocation>(this as ConformAllocation, _$identity);
|
||||
|
||||
/// Serializes this ConformAllocation to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is ConformAllocation&&(identical(other.allocation_key, allocation_key) || other.allocation_key == allocation_key)&&(identical(other.number_of_carcasses, number_of_carcasses) || other.number_of_carcasses == number_of_carcasses)&&(identical(other.weight_of_carcasses, weight_of_carcasses) || other.weight_of_carcasses == weight_of_carcasses)&&(identical(other.amount, amount) || other.amount == amount)&&(identical(other.total_amount, total_amount) || other.total_amount == total_amount));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,allocation_key,number_of_carcasses,weight_of_carcasses,amount,total_amount);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ConformAllocation(allocation_key: $allocation_key, number_of_carcasses: $number_of_carcasses, weight_of_carcasses: $weight_of_carcasses, amount: $amount, total_amount: $total_amount)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $ConformAllocationCopyWith<$Res> {
|
||||
factory $ConformAllocationCopyWith(ConformAllocation value, $Res Function(ConformAllocation) _then) = _$ConformAllocationCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
String? allocation_key, int? number_of_carcasses, int? weight_of_carcasses, int? amount, int? total_amount
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$ConformAllocationCopyWithImpl<$Res>
|
||||
implements $ConformAllocationCopyWith<$Res> {
|
||||
_$ConformAllocationCopyWithImpl(this._self, this._then);
|
||||
|
||||
final ConformAllocation _self;
|
||||
final $Res Function(ConformAllocation) _then;
|
||||
|
||||
/// Create a copy of ConformAllocation
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? allocation_key = freezed,Object? number_of_carcasses = freezed,Object? weight_of_carcasses = freezed,Object? amount = freezed,Object? total_amount = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
allocation_key: freezed == allocation_key ? _self.allocation_key : allocation_key // ignore: cast_nullable_to_non_nullable
|
||||
as String?,number_of_carcasses: freezed == number_of_carcasses ? _self.number_of_carcasses : number_of_carcasses // ignore: cast_nullable_to_non_nullable
|
||||
as int?,weight_of_carcasses: freezed == weight_of_carcasses ? _self.weight_of_carcasses : weight_of_carcasses // ignore: cast_nullable_to_non_nullable
|
||||
as int?,amount: freezed == amount ? _self.amount : amount // ignore: cast_nullable_to_non_nullable
|
||||
as int?,total_amount: freezed == total_amount ? _self.total_amount : total_amount // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
|
||||
class _ConformAllocation implements ConformAllocation {
|
||||
_ConformAllocation({this.allocation_key, this.number_of_carcasses, this.weight_of_carcasses, this.amount, this.total_amount});
|
||||
factory _ConformAllocation.fromJson(Map<String, dynamic> json) => _$ConformAllocationFromJson(json);
|
||||
|
||||
@override final String? allocation_key;
|
||||
@override final int? number_of_carcasses;
|
||||
@override final int? weight_of_carcasses;
|
||||
@override final int? amount;
|
||||
@override final int? total_amount;
|
||||
|
||||
/// Create a copy of ConformAllocation
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$ConformAllocationCopyWith<_ConformAllocation> get copyWith => __$ConformAllocationCopyWithImpl<_ConformAllocation>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$ConformAllocationToJson(this, );
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _ConformAllocation&&(identical(other.allocation_key, allocation_key) || other.allocation_key == allocation_key)&&(identical(other.number_of_carcasses, number_of_carcasses) || other.number_of_carcasses == number_of_carcasses)&&(identical(other.weight_of_carcasses, weight_of_carcasses) || other.weight_of_carcasses == weight_of_carcasses)&&(identical(other.amount, amount) || other.amount == amount)&&(identical(other.total_amount, total_amount) || other.total_amount == total_amount));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,allocation_key,number_of_carcasses,weight_of_carcasses,amount,total_amount);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ConformAllocation(allocation_key: $allocation_key, number_of_carcasses: $number_of_carcasses, weight_of_carcasses: $weight_of_carcasses, amount: $amount, total_amount: $total_amount)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$ConformAllocationCopyWith<$Res> implements $ConformAllocationCopyWith<$Res> {
|
||||
factory _$ConformAllocationCopyWith(_ConformAllocation value, $Res Function(_ConformAllocation) _then) = __$ConformAllocationCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
String? allocation_key, int? number_of_carcasses, int? weight_of_carcasses, int? amount, int? total_amount
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$ConformAllocationCopyWithImpl<$Res>
|
||||
implements _$ConformAllocationCopyWith<$Res> {
|
||||
__$ConformAllocationCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _ConformAllocation _self;
|
||||
final $Res Function(_ConformAllocation) _then;
|
||||
|
||||
/// Create a copy of ConformAllocation
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? allocation_key = freezed,Object? number_of_carcasses = freezed,Object? weight_of_carcasses = freezed,Object? amount = freezed,Object? total_amount = freezed,}) {
|
||||
return _then(_ConformAllocation(
|
||||
allocation_key: freezed == allocation_key ? _self.allocation_key : allocation_key // ignore: cast_nullable_to_non_nullable
|
||||
as String?,number_of_carcasses: freezed == number_of_carcasses ? _self.number_of_carcasses : number_of_carcasses // ignore: cast_nullable_to_non_nullable
|
||||
as int?,weight_of_carcasses: freezed == weight_of_carcasses ? _self.weight_of_carcasses : weight_of_carcasses // ignore: cast_nullable_to_non_nullable
|
||||
as int?,amount: freezed == amount ? _self.amount : amount // ignore: cast_nullable_to_non_nullable
|
||||
as int?,total_amount: freezed == total_amount ? _self.total_amount : total_amount // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// dart format on
|
||||
@@ -0,0 +1,25 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'conform_allocation.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_ConformAllocation _$ConformAllocationFromJson(Map<String, dynamic> json) =>
|
||||
_ConformAllocation(
|
||||
allocation_key: json['allocation_key'] as String?,
|
||||
number_of_carcasses: (json['number_of_carcasses'] as num?)?.toInt(),
|
||||
weight_of_carcasses: (json['weight_of_carcasses'] as num?)?.toInt(),
|
||||
amount: (json['amount'] as num?)?.toInt(),
|
||||
total_amount: (json['total_amount'] as num?)?.toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ConformAllocationToJson(_ConformAllocation instance) =>
|
||||
<String, dynamic>{
|
||||
'allocation_key': instance.allocation_key,
|
||||
'number_of_carcasses': instance.number_of_carcasses,
|
||||
'weight_of_carcasses': instance.weight_of_carcasses,
|
||||
'amount': instance.amount,
|
||||
'total_amount': instance.total_amount,
|
||||
};
|
||||
@@ -0,0 +1,20 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'steward_allocation_request.freezed.dart';
|
||||
part 'steward_allocation_request.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class StewardAllocationRequest with _$StewardAllocationRequest {
|
||||
const factory StewardAllocationRequest({
|
||||
bool? checkAllocation,
|
||||
String? allocationKey,
|
||||
String? state,
|
||||
int? registrationCode,
|
||||
int? receiverRealNumberOfCarcasses,
|
||||
int? receiverRealWeightOfCarcasses,
|
||||
int? weightLossOfCarcasses,
|
||||
}) = _StewardAllocationRequest;
|
||||
|
||||
factory StewardAllocationRequest.fromJson(Map<String, dynamic> json) =>
|
||||
_$StewardAllocationRequestFromJson(json);
|
||||
}
|
||||
@@ -0,0 +1,166 @@
|
||||
// dart format width=80
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'steward_allocation_request.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
/// @nodoc
|
||||
mixin _$StewardAllocationRequest {
|
||||
|
||||
bool? get checkAllocation; String? get allocationKey; String? get state; int? get registrationCode; int? get receiverRealNumberOfCarcasses; int? get receiverRealWeightOfCarcasses; int? get weightLossOfCarcasses;
|
||||
/// Create a copy of StewardAllocationRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$StewardAllocationRequestCopyWith<StewardAllocationRequest> get copyWith => _$StewardAllocationRequestCopyWithImpl<StewardAllocationRequest>(this as StewardAllocationRequest, _$identity);
|
||||
|
||||
/// Serializes this StewardAllocationRequest to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is StewardAllocationRequest&&(identical(other.checkAllocation, checkAllocation) || other.checkAllocation == checkAllocation)&&(identical(other.allocationKey, allocationKey) || other.allocationKey == allocationKey)&&(identical(other.state, state) || other.state == state)&&(identical(other.registrationCode, registrationCode) || other.registrationCode == registrationCode)&&(identical(other.receiverRealNumberOfCarcasses, receiverRealNumberOfCarcasses) || other.receiverRealNumberOfCarcasses == receiverRealNumberOfCarcasses)&&(identical(other.receiverRealWeightOfCarcasses, receiverRealWeightOfCarcasses) || other.receiverRealWeightOfCarcasses == receiverRealWeightOfCarcasses)&&(identical(other.weightLossOfCarcasses, weightLossOfCarcasses) || other.weightLossOfCarcasses == weightLossOfCarcasses));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,checkAllocation,allocationKey,state,registrationCode,receiverRealNumberOfCarcasses,receiverRealWeightOfCarcasses,weightLossOfCarcasses);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'StewardAllocationRequest(checkAllocation: $checkAllocation, allocationKey: $allocationKey, state: $state, registrationCode: $registrationCode, receiverRealNumberOfCarcasses: $receiverRealNumberOfCarcasses, receiverRealWeightOfCarcasses: $receiverRealWeightOfCarcasses, weightLossOfCarcasses: $weightLossOfCarcasses)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $StewardAllocationRequestCopyWith<$Res> {
|
||||
factory $StewardAllocationRequestCopyWith(StewardAllocationRequest value, $Res Function(StewardAllocationRequest) _then) = _$StewardAllocationRequestCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
bool? checkAllocation, String? allocationKey, String? state, int? registrationCode, int? receiverRealNumberOfCarcasses, int? receiverRealWeightOfCarcasses, int? weightLossOfCarcasses
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$StewardAllocationRequestCopyWithImpl<$Res>
|
||||
implements $StewardAllocationRequestCopyWith<$Res> {
|
||||
_$StewardAllocationRequestCopyWithImpl(this._self, this._then);
|
||||
|
||||
final StewardAllocationRequest _self;
|
||||
final $Res Function(StewardAllocationRequest) _then;
|
||||
|
||||
/// Create a copy of StewardAllocationRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? checkAllocation = freezed,Object? allocationKey = freezed,Object? state = freezed,Object? registrationCode = freezed,Object? receiverRealNumberOfCarcasses = freezed,Object? receiverRealWeightOfCarcasses = freezed,Object? weightLossOfCarcasses = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
checkAllocation: freezed == checkAllocation ? _self.checkAllocation : checkAllocation // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,allocationKey: freezed == allocationKey ? _self.allocationKey : allocationKey // ignore: cast_nullable_to_non_nullable
|
||||
as String?,state: freezed == state ? _self.state : state // ignore: cast_nullable_to_non_nullable
|
||||
as String?,registrationCode: freezed == registrationCode ? _self.registrationCode : registrationCode // ignore: cast_nullable_to_non_nullable
|
||||
as int?,receiverRealNumberOfCarcasses: freezed == receiverRealNumberOfCarcasses ? _self.receiverRealNumberOfCarcasses : receiverRealNumberOfCarcasses // ignore: cast_nullable_to_non_nullable
|
||||
as int?,receiverRealWeightOfCarcasses: freezed == receiverRealWeightOfCarcasses ? _self.receiverRealWeightOfCarcasses : receiverRealWeightOfCarcasses // ignore: cast_nullable_to_non_nullable
|
||||
as int?,weightLossOfCarcasses: freezed == weightLossOfCarcasses ? _self.weightLossOfCarcasses : weightLossOfCarcasses // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
|
||||
class _StewardAllocationRequest implements StewardAllocationRequest {
|
||||
const _StewardAllocationRequest({this.checkAllocation, this.allocationKey, this.state, this.registrationCode, this.receiverRealNumberOfCarcasses, this.receiverRealWeightOfCarcasses, this.weightLossOfCarcasses});
|
||||
factory _StewardAllocationRequest.fromJson(Map<String, dynamic> json) => _$StewardAllocationRequestFromJson(json);
|
||||
|
||||
@override final bool? checkAllocation;
|
||||
@override final String? allocationKey;
|
||||
@override final String? state;
|
||||
@override final int? registrationCode;
|
||||
@override final int? receiverRealNumberOfCarcasses;
|
||||
@override final int? receiverRealWeightOfCarcasses;
|
||||
@override final int? weightLossOfCarcasses;
|
||||
|
||||
/// Create a copy of StewardAllocationRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$StewardAllocationRequestCopyWith<_StewardAllocationRequest> get copyWith => __$StewardAllocationRequestCopyWithImpl<_StewardAllocationRequest>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$StewardAllocationRequestToJson(this, );
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _StewardAllocationRequest&&(identical(other.checkAllocation, checkAllocation) || other.checkAllocation == checkAllocation)&&(identical(other.allocationKey, allocationKey) || other.allocationKey == allocationKey)&&(identical(other.state, state) || other.state == state)&&(identical(other.registrationCode, registrationCode) || other.registrationCode == registrationCode)&&(identical(other.receiverRealNumberOfCarcasses, receiverRealNumberOfCarcasses) || other.receiverRealNumberOfCarcasses == receiverRealNumberOfCarcasses)&&(identical(other.receiverRealWeightOfCarcasses, receiverRealWeightOfCarcasses) || other.receiverRealWeightOfCarcasses == receiverRealWeightOfCarcasses)&&(identical(other.weightLossOfCarcasses, weightLossOfCarcasses) || other.weightLossOfCarcasses == weightLossOfCarcasses));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,checkAllocation,allocationKey,state,registrationCode,receiverRealNumberOfCarcasses,receiverRealWeightOfCarcasses,weightLossOfCarcasses);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'StewardAllocationRequest(checkAllocation: $checkAllocation, allocationKey: $allocationKey, state: $state, registrationCode: $registrationCode, receiverRealNumberOfCarcasses: $receiverRealNumberOfCarcasses, receiverRealWeightOfCarcasses: $receiverRealWeightOfCarcasses, weightLossOfCarcasses: $weightLossOfCarcasses)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$StewardAllocationRequestCopyWith<$Res> implements $StewardAllocationRequestCopyWith<$Res> {
|
||||
factory _$StewardAllocationRequestCopyWith(_StewardAllocationRequest value, $Res Function(_StewardAllocationRequest) _then) = __$StewardAllocationRequestCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
bool? checkAllocation, String? allocationKey, String? state, int? registrationCode, int? receiverRealNumberOfCarcasses, int? receiverRealWeightOfCarcasses, int? weightLossOfCarcasses
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$StewardAllocationRequestCopyWithImpl<$Res>
|
||||
implements _$StewardAllocationRequestCopyWith<$Res> {
|
||||
__$StewardAllocationRequestCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _StewardAllocationRequest _self;
|
||||
final $Res Function(_StewardAllocationRequest) _then;
|
||||
|
||||
/// Create a copy of StewardAllocationRequest
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? checkAllocation = freezed,Object? allocationKey = freezed,Object? state = freezed,Object? registrationCode = freezed,Object? receiverRealNumberOfCarcasses = freezed,Object? receiverRealWeightOfCarcasses = freezed,Object? weightLossOfCarcasses = freezed,}) {
|
||||
return _then(_StewardAllocationRequest(
|
||||
checkAllocation: freezed == checkAllocation ? _self.checkAllocation : checkAllocation // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,allocationKey: freezed == allocationKey ? _self.allocationKey : allocationKey // ignore: cast_nullable_to_non_nullable
|
||||
as String?,state: freezed == state ? _self.state : state // ignore: cast_nullable_to_non_nullable
|
||||
as String?,registrationCode: freezed == registrationCode ? _self.registrationCode : registrationCode // ignore: cast_nullable_to_non_nullable
|
||||
as int?,receiverRealNumberOfCarcasses: freezed == receiverRealNumberOfCarcasses ? _self.receiverRealNumberOfCarcasses : receiverRealNumberOfCarcasses // ignore: cast_nullable_to_non_nullable
|
||||
as int?,receiverRealWeightOfCarcasses: freezed == receiverRealWeightOfCarcasses ? _self.receiverRealWeightOfCarcasses : receiverRealWeightOfCarcasses // ignore: cast_nullable_to_non_nullable
|
||||
as int?,weightLossOfCarcasses: freezed == weightLossOfCarcasses ? _self.weightLossOfCarcasses : weightLossOfCarcasses // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// dart format on
|
||||
@@ -0,0 +1,33 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'steward_allocation_request.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_StewardAllocationRequest _$StewardAllocationRequestFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _StewardAllocationRequest(
|
||||
checkAllocation: json['check_allocation'] as bool?,
|
||||
allocationKey: json['allocation_key'] as String?,
|
||||
state: json['state'] as String?,
|
||||
registrationCode: (json['registration_code'] as num?)?.toInt(),
|
||||
receiverRealNumberOfCarcasses:
|
||||
(json['receiver_real_number_of_carcasses'] as num?)?.toInt(),
|
||||
receiverRealWeightOfCarcasses:
|
||||
(json['receiver_real_weight_of_carcasses'] as num?)?.toInt(),
|
||||
weightLossOfCarcasses: (json['weight_loss_of_carcasses'] as num?)?.toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$StewardAllocationRequestToJson(
|
||||
_StewardAllocationRequest instance,
|
||||
) => <String, dynamic>{
|
||||
'check_allocation': instance.checkAllocation,
|
||||
'allocation_key': instance.allocationKey,
|
||||
'state': instance.state,
|
||||
'registration_code': instance.registrationCode,
|
||||
'receiver_real_number_of_carcasses': instance.receiverRealNumberOfCarcasses,
|
||||
'receiver_real_weight_of_carcasses': instance.receiverRealWeightOfCarcasses,
|
||||
'weight_loss_of_carcasses': instance.weightLossOfCarcasses,
|
||||
};
|
||||
@@ -0,0 +1,26 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'submit_steward_allocation.freezed.dart';
|
||||
part 'submit_steward_allocation.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class SubmitStewardAllocation with _$SubmitStewardAllocation {
|
||||
const factory SubmitStewardAllocation({
|
||||
String? sellerType,
|
||||
String? buyerType,
|
||||
String? guildKey,
|
||||
String? productKey,
|
||||
String? type,
|
||||
String? allocationType,
|
||||
int? numberOfCarcasses,
|
||||
int? weightOfCarcasses,
|
||||
String? sellType,
|
||||
int? amount,
|
||||
int? totalAmount,
|
||||
bool? approvedPriceStatus,
|
||||
String? date,
|
||||
}) = _SubmitStewardAllocation;
|
||||
|
||||
factory SubmitStewardAllocation.fromJson(Map<String, dynamic> json) =>
|
||||
_$SubmitStewardAllocationFromJson(json);
|
||||
}
|
||||
@@ -0,0 +1,184 @@
|
||||
// dart format width=80
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'submit_steward_allocation.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
/// @nodoc
|
||||
mixin _$SubmitStewardAllocation {
|
||||
|
||||
String? get sellerType; String? get buyerType; String? get guildKey; String? get productKey; String? get type; String? get allocationType; int? get numberOfCarcasses; int? get weightOfCarcasses; String? get sellType; int? get amount; int? get totalAmount; bool? get approvedPriceStatus; String? get date;
|
||||
/// Create a copy of SubmitStewardAllocation
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$SubmitStewardAllocationCopyWith<SubmitStewardAllocation> get copyWith => _$SubmitStewardAllocationCopyWithImpl<SubmitStewardAllocation>(this as SubmitStewardAllocation, _$identity);
|
||||
|
||||
/// Serializes this SubmitStewardAllocation to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is SubmitStewardAllocation&&(identical(other.sellerType, sellerType) || other.sellerType == sellerType)&&(identical(other.buyerType, buyerType) || other.buyerType == buyerType)&&(identical(other.guildKey, guildKey) || other.guildKey == guildKey)&&(identical(other.productKey, productKey) || other.productKey == productKey)&&(identical(other.type, type) || other.type == type)&&(identical(other.allocationType, allocationType) || other.allocationType == allocationType)&&(identical(other.numberOfCarcasses, numberOfCarcasses) || other.numberOfCarcasses == numberOfCarcasses)&&(identical(other.weightOfCarcasses, weightOfCarcasses) || other.weightOfCarcasses == weightOfCarcasses)&&(identical(other.sellType, sellType) || other.sellType == sellType)&&(identical(other.amount, amount) || other.amount == amount)&&(identical(other.totalAmount, totalAmount) || other.totalAmount == totalAmount)&&(identical(other.approvedPriceStatus, approvedPriceStatus) || other.approvedPriceStatus == approvedPriceStatus)&&(identical(other.date, date) || other.date == date));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,sellerType,buyerType,guildKey,productKey,type,allocationType,numberOfCarcasses,weightOfCarcasses,sellType,amount,totalAmount,approvedPriceStatus,date);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'SubmitStewardAllocation(sellerType: $sellerType, buyerType: $buyerType, guildKey: $guildKey, productKey: $productKey, type: $type, allocationType: $allocationType, numberOfCarcasses: $numberOfCarcasses, weightOfCarcasses: $weightOfCarcasses, sellType: $sellType, amount: $amount, totalAmount: $totalAmount, approvedPriceStatus: $approvedPriceStatus, date: $date)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $SubmitStewardAllocationCopyWith<$Res> {
|
||||
factory $SubmitStewardAllocationCopyWith(SubmitStewardAllocation value, $Res Function(SubmitStewardAllocation) _then) = _$SubmitStewardAllocationCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
String? sellerType, String? buyerType, String? guildKey, String? productKey, String? type, String? allocationType, int? numberOfCarcasses, int? weightOfCarcasses, String? sellType, int? amount, int? totalAmount, bool? approvedPriceStatus, String? date
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$SubmitStewardAllocationCopyWithImpl<$Res>
|
||||
implements $SubmitStewardAllocationCopyWith<$Res> {
|
||||
_$SubmitStewardAllocationCopyWithImpl(this._self, this._then);
|
||||
|
||||
final SubmitStewardAllocation _self;
|
||||
final $Res Function(SubmitStewardAllocation) _then;
|
||||
|
||||
/// Create a copy of SubmitStewardAllocation
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? sellerType = freezed,Object? buyerType = freezed,Object? guildKey = freezed,Object? productKey = freezed,Object? type = freezed,Object? allocationType = freezed,Object? numberOfCarcasses = freezed,Object? weightOfCarcasses = freezed,Object? sellType = freezed,Object? amount = freezed,Object? totalAmount = freezed,Object? approvedPriceStatus = freezed,Object? date = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
sellerType: freezed == sellerType ? _self.sellerType : sellerType // ignore: cast_nullable_to_non_nullable
|
||||
as String?,buyerType: freezed == buyerType ? _self.buyerType : buyerType // ignore: cast_nullable_to_non_nullable
|
||||
as String?,guildKey: freezed == guildKey ? _self.guildKey : guildKey // ignore: cast_nullable_to_non_nullable
|
||||
as String?,productKey: freezed == productKey ? _self.productKey : productKey // ignore: cast_nullable_to_non_nullable
|
||||
as String?,type: freezed == type ? _self.type : type // ignore: cast_nullable_to_non_nullable
|
||||
as String?,allocationType: freezed == allocationType ? _self.allocationType : allocationType // ignore: cast_nullable_to_non_nullable
|
||||
as String?,numberOfCarcasses: freezed == numberOfCarcasses ? _self.numberOfCarcasses : numberOfCarcasses // ignore: cast_nullable_to_non_nullable
|
||||
as int?,weightOfCarcasses: freezed == weightOfCarcasses ? _self.weightOfCarcasses : weightOfCarcasses // ignore: cast_nullable_to_non_nullable
|
||||
as int?,sellType: freezed == sellType ? _self.sellType : sellType // ignore: cast_nullable_to_non_nullable
|
||||
as String?,amount: freezed == amount ? _self.amount : amount // ignore: cast_nullable_to_non_nullable
|
||||
as int?,totalAmount: freezed == totalAmount ? _self.totalAmount : totalAmount // ignore: cast_nullable_to_non_nullable
|
||||
as int?,approvedPriceStatus: freezed == approvedPriceStatus ? _self.approvedPriceStatus : approvedPriceStatus // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,date: freezed == date ? _self.date : date // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
|
||||
class _SubmitStewardAllocation implements SubmitStewardAllocation {
|
||||
const _SubmitStewardAllocation({this.sellerType, this.buyerType, this.guildKey, this.productKey, this.type, this.allocationType, this.numberOfCarcasses, this.weightOfCarcasses, this.sellType, this.amount, this.totalAmount, this.approvedPriceStatus, this.date});
|
||||
factory _SubmitStewardAllocation.fromJson(Map<String, dynamic> json) => _$SubmitStewardAllocationFromJson(json);
|
||||
|
||||
@override final String? sellerType;
|
||||
@override final String? buyerType;
|
||||
@override final String? guildKey;
|
||||
@override final String? productKey;
|
||||
@override final String? type;
|
||||
@override final String? allocationType;
|
||||
@override final int? numberOfCarcasses;
|
||||
@override final int? weightOfCarcasses;
|
||||
@override final String? sellType;
|
||||
@override final int? amount;
|
||||
@override final int? totalAmount;
|
||||
@override final bool? approvedPriceStatus;
|
||||
@override final String? date;
|
||||
|
||||
/// Create a copy of SubmitStewardAllocation
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$SubmitStewardAllocationCopyWith<_SubmitStewardAllocation> get copyWith => __$SubmitStewardAllocationCopyWithImpl<_SubmitStewardAllocation>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$SubmitStewardAllocationToJson(this, );
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _SubmitStewardAllocation&&(identical(other.sellerType, sellerType) || other.sellerType == sellerType)&&(identical(other.buyerType, buyerType) || other.buyerType == buyerType)&&(identical(other.guildKey, guildKey) || other.guildKey == guildKey)&&(identical(other.productKey, productKey) || other.productKey == productKey)&&(identical(other.type, type) || other.type == type)&&(identical(other.allocationType, allocationType) || other.allocationType == allocationType)&&(identical(other.numberOfCarcasses, numberOfCarcasses) || other.numberOfCarcasses == numberOfCarcasses)&&(identical(other.weightOfCarcasses, weightOfCarcasses) || other.weightOfCarcasses == weightOfCarcasses)&&(identical(other.sellType, sellType) || other.sellType == sellType)&&(identical(other.amount, amount) || other.amount == amount)&&(identical(other.totalAmount, totalAmount) || other.totalAmount == totalAmount)&&(identical(other.approvedPriceStatus, approvedPriceStatus) || other.approvedPriceStatus == approvedPriceStatus)&&(identical(other.date, date) || other.date == date));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,sellerType,buyerType,guildKey,productKey,type,allocationType,numberOfCarcasses,weightOfCarcasses,sellType,amount,totalAmount,approvedPriceStatus,date);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'SubmitStewardAllocation(sellerType: $sellerType, buyerType: $buyerType, guildKey: $guildKey, productKey: $productKey, type: $type, allocationType: $allocationType, numberOfCarcasses: $numberOfCarcasses, weightOfCarcasses: $weightOfCarcasses, sellType: $sellType, amount: $amount, totalAmount: $totalAmount, approvedPriceStatus: $approvedPriceStatus, date: $date)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$SubmitStewardAllocationCopyWith<$Res> implements $SubmitStewardAllocationCopyWith<$Res> {
|
||||
factory _$SubmitStewardAllocationCopyWith(_SubmitStewardAllocation value, $Res Function(_SubmitStewardAllocation) _then) = __$SubmitStewardAllocationCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
String? sellerType, String? buyerType, String? guildKey, String? productKey, String? type, String? allocationType, int? numberOfCarcasses, int? weightOfCarcasses, String? sellType, int? amount, int? totalAmount, bool? approvedPriceStatus, String? date
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$SubmitStewardAllocationCopyWithImpl<$Res>
|
||||
implements _$SubmitStewardAllocationCopyWith<$Res> {
|
||||
__$SubmitStewardAllocationCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _SubmitStewardAllocation _self;
|
||||
final $Res Function(_SubmitStewardAllocation) _then;
|
||||
|
||||
/// Create a copy of SubmitStewardAllocation
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? sellerType = freezed,Object? buyerType = freezed,Object? guildKey = freezed,Object? productKey = freezed,Object? type = freezed,Object? allocationType = freezed,Object? numberOfCarcasses = freezed,Object? weightOfCarcasses = freezed,Object? sellType = freezed,Object? amount = freezed,Object? totalAmount = freezed,Object? approvedPriceStatus = freezed,Object? date = freezed,}) {
|
||||
return _then(_SubmitStewardAllocation(
|
||||
sellerType: freezed == sellerType ? _self.sellerType : sellerType // ignore: cast_nullable_to_non_nullable
|
||||
as String?,buyerType: freezed == buyerType ? _self.buyerType : buyerType // ignore: cast_nullable_to_non_nullable
|
||||
as String?,guildKey: freezed == guildKey ? _self.guildKey : guildKey // ignore: cast_nullable_to_non_nullable
|
||||
as String?,productKey: freezed == productKey ? _self.productKey : productKey // ignore: cast_nullable_to_non_nullable
|
||||
as String?,type: freezed == type ? _self.type : type // ignore: cast_nullable_to_non_nullable
|
||||
as String?,allocationType: freezed == allocationType ? _self.allocationType : allocationType // ignore: cast_nullable_to_non_nullable
|
||||
as String?,numberOfCarcasses: freezed == numberOfCarcasses ? _self.numberOfCarcasses : numberOfCarcasses // ignore: cast_nullable_to_non_nullable
|
||||
as int?,weightOfCarcasses: freezed == weightOfCarcasses ? _self.weightOfCarcasses : weightOfCarcasses // ignore: cast_nullable_to_non_nullable
|
||||
as int?,sellType: freezed == sellType ? _self.sellType : sellType // ignore: cast_nullable_to_non_nullable
|
||||
as String?,amount: freezed == amount ? _self.amount : amount // ignore: cast_nullable_to_non_nullable
|
||||
as int?,totalAmount: freezed == totalAmount ? _self.totalAmount : totalAmount // ignore: cast_nullable_to_non_nullable
|
||||
as int?,approvedPriceStatus: freezed == approvedPriceStatus ? _self.approvedPriceStatus : approvedPriceStatus // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,date: freezed == date ? _self.date : date // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// dart format on
|
||||
@@ -0,0 +1,43 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'submit_steward_allocation.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_SubmitStewardAllocation _$SubmitStewardAllocationFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _SubmitStewardAllocation(
|
||||
sellerType: json['seller_type'] as String?,
|
||||
buyerType: json['buyer_type'] as String?,
|
||||
guildKey: json['guild_key'] as String?,
|
||||
productKey: json['product_key'] as String?,
|
||||
type: json['type'] as String?,
|
||||
allocationType: json['allocation_type'] as String?,
|
||||
numberOfCarcasses: (json['number_of_carcasses'] as num?)?.toInt(),
|
||||
weightOfCarcasses: (json['weight_of_carcasses'] as num?)?.toInt(),
|
||||
sellType: json['sell_type'] as String?,
|
||||
amount: (json['amount'] as num?)?.toInt(),
|
||||
totalAmount: (json['total_amount'] as num?)?.toInt(),
|
||||
approvedPriceStatus: json['approved_price_status'] as bool?,
|
||||
date: json['date'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$SubmitStewardAllocationToJson(
|
||||
_SubmitStewardAllocation instance,
|
||||
) => <String, dynamic>{
|
||||
'seller_type': instance.sellerType,
|
||||
'buyer_type': instance.buyerType,
|
||||
'guild_key': instance.guildKey,
|
||||
'product_key': instance.productKey,
|
||||
'type': instance.type,
|
||||
'allocation_type': instance.allocationType,
|
||||
'number_of_carcasses': instance.numberOfCarcasses,
|
||||
'weight_of_carcasses': instance.weightOfCarcasses,
|
||||
'sell_type': instance.sellType,
|
||||
'amount': instance.amount,
|
||||
'total_amount': instance.totalAmount,
|
||||
'approved_price_status': instance.approvedPriceStatus,
|
||||
'date': instance.date,
|
||||
};
|
||||
@@ -0,0 +1,227 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'allocated_made.freezed.dart';
|
||||
part 'allocated_made.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class AllocatedMadeModel with _$AllocatedMadeModel {
|
||||
factory AllocatedMadeModel({
|
||||
int? count,
|
||||
String? next,
|
||||
String? previous,
|
||||
List<AllocatedMadeResult>? results,
|
||||
}) = _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,
|
||||
}) = _Product;
|
||||
|
||||
factory Product.fromJson(Map<String, dynamic> json) =>
|
||||
_$ProductFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class Steward with _$Steward {
|
||||
factory Steward({
|
||||
int? id,
|
||||
User? user,
|
||||
Address? address,
|
||||
Activity? guild_area_activity,
|
||||
Activity? guild_type_activity,
|
||||
List<dynamic>? kill_house,
|
||||
List<dynamic>? steward_kill_house,
|
||||
List<dynamic>? stewards,
|
||||
PosStatus? get_pos_status,
|
||||
String? key,
|
||||
String? create_date,
|
||||
String? modify_date,
|
||||
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,
|
||||
bool? active,
|
||||
int? city_number,
|
||||
String? city_name,
|
||||
String? guilds_id,
|
||||
String? license_number,
|
||||
String? guilds_name,
|
||||
String? phone,
|
||||
String? type_activity,
|
||||
String? area_activity,
|
||||
int? province_number,
|
||||
String? province_name,
|
||||
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,
|
||||
String? condition,
|
||||
String? description_condition,
|
||||
bool? steward_active,
|
||||
dynamic steward_allocation_limit,
|
||||
bool? steward_limitation_allocation,
|
||||
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,
|
||||
int? wallet,
|
||||
List<dynamic>? cars,
|
||||
List<dynamic>? user_level,
|
||||
}) = _Steward;
|
||||
|
||||
factory Steward.fromJson(Map<String, dynamic> json) =>
|
||||
_$StewardFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class User with _$User {
|
||||
factory User({
|
||||
String? fullname,
|
||||
String? first_name,
|
||||
String? last_name,
|
||||
String? mobile,
|
||||
String? national_id,
|
||||
String? city,
|
||||
}) = _User;
|
||||
|
||||
factory User.fromJson(Map<String, dynamic> json) =>
|
||||
_$UserFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class Address with _$Address {
|
||||
factory Address({
|
||||
Province? province,
|
||||
Province? city,
|
||||
String? address,
|
||||
String? postal_code,
|
||||
}) = _Address;
|
||||
|
||||
factory Address.fromJson(Map<String, dynamic> json) =>
|
||||
_$AddressFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class Province with _$Province {
|
||||
factory Province({
|
||||
String? key,
|
||||
String? name,
|
||||
}) = _Province;
|
||||
|
||||
factory Province.fromJson(Map<String, dynamic> json) =>
|
||||
_$ProvinceFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class Activity with _$Activity {
|
||||
factory Activity({
|
||||
String? key,
|
||||
String? title,
|
||||
}) = _Activity;
|
||||
|
||||
factory Activity.fromJson(Map<String, dynamic> json) =>
|
||||
_$ActivityFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class PosStatus with _$PosStatus {
|
||||
factory PosStatus({
|
||||
int? len_active_sessions,
|
||||
bool? has_pons,
|
||||
bool? has_active_pons,
|
||||
}) = _PosStatus;
|
||||
|
||||
factory PosStatus.fromJson(Map<String, dynamic> json) =>
|
||||
_$PosStatusFromJson(json);
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,373 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
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(
|
||||
Map<String, dynamic> json,
|
||||
) => _AllocatedMadeResult(
|
||||
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'],
|
||||
steward: json['steward'] == null
|
||||
? null
|
||||
: Steward.fromJson(json['steward'] as Map<String, dynamic>),
|
||||
to_steward: json['to_steward'],
|
||||
guilds: json['guilds'],
|
||||
to_guilds: 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(),
|
||||
key: json['key'] as String?,
|
||||
create_date: json['create_date'] as String?,
|
||||
modify_date: 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:
|
||||
(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:
|
||||
(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?,
|
||||
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(),
|
||||
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?,
|
||||
state: json['state'] as String?,
|
||||
receiver_state: json['receiver_state'] as String?,
|
||||
allocation_state: 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'],
|
||||
car: json['car'],
|
||||
dispenser: json['dispenser'],
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$AllocatedMadeResultToJson(
|
||||
_AllocatedMadeResult instance,
|
||||
) => <String, dynamic>{
|
||||
'id': instance.id,
|
||||
'product': instance.product,
|
||||
'kill_house': instance.kill_house,
|
||||
'to_kill_house': instance.to_kill_house,
|
||||
'steward': instance.steward,
|
||||
'to_steward': instance.to_steward,
|
||||
'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,
|
||||
'key': instance.key,
|
||||
'create_date': instance.create_date,
|
||||
'modify_date': instance.modify_date,
|
||||
'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,
|
||||
'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,
|
||||
'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,
|
||||
'state': instance.state,
|
||||
'receiver_state': instance.receiver_state,
|
||||
'allocation_state': instance.allocation_state,
|
||||
'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,
|
||||
'car': instance.car,
|
||||
'dispenser': instance.dispenser,
|
||||
};
|
||||
|
||||
_Product _$ProductFromJson(Map<String, dynamic> json) =>
|
||||
_Product(weight_average: (json['weight_average'] as num?)?.toInt());
|
||||
|
||||
Map<String, dynamic> _$ProductToJson(_Product instance) => <String, dynamic>{
|
||||
'weight_average': instance.weight_average,
|
||||
};
|
||||
|
||||
_Steward _$StewardFromJson(Map<String, dynamic> json) => _Steward(
|
||||
id: (json['id'] as num?)?.toInt(),
|
||||
user: json['user'] == null
|
||||
? null
|
||||
: User.fromJson(json['user'] as Map<String, dynamic>),
|
||||
address: json['address'] == null
|
||||
? null
|
||||
: Address.fromJson(json['address'] as Map<String, dynamic>),
|
||||
guild_area_activity: json['guild_area_activity'] == null
|
||||
? null
|
||||
: Activity.fromJson(json['guild_area_activity'] as Map<String, dynamic>),
|
||||
guild_type_activity: 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>?,
|
||||
stewards: json['stewards'] as List<dynamic>?,
|
||||
get_pos_status: 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?,
|
||||
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'],
|
||||
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?,
|
||||
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?,
|
||||
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?,
|
||||
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?,
|
||||
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'],
|
||||
wallet: (json['wallet'] as num?)?.toInt(),
|
||||
cars: json['cars'] as List<dynamic>?,
|
||||
user_level: 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,
|
||||
'stewards': instance.stewards,
|
||||
'get_pos_status': instance.get_pos_status,
|
||||
'key': instance.key,
|
||||
'create_date': instance.create_date,
|
||||
'modify_date': instance.modify_date,
|
||||
'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,
|
||||
'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,
|
||||
'phone': instance.phone,
|
||||
'type_activity': instance.type_activity,
|
||||
'area_activity': instance.area_activity,
|
||||
'province_number': instance.province_number,
|
||||
'province_name': instance.province_name,
|
||||
'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,
|
||||
'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,
|
||||
'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,
|
||||
'wallet': instance.wallet,
|
||||
'cars': instance.cars,
|
||||
'user_level': instance.user_level,
|
||||
};
|
||||
|
||||
_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?,
|
||||
mobile: json['mobile'] as String?,
|
||||
national_id: 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,
|
||||
'mobile': instance.mobile,
|
||||
'national_id': instance.national_id,
|
||||
'city': instance.city,
|
||||
};
|
||||
|
||||
_Address _$AddressFromJson(Map<String, dynamic> json) => _Address(
|
||||
province: json['province'] == null
|
||||
? null
|
||||
: Province.fromJson(json['province'] as Map<String, dynamic>),
|
||||
city: json['city'] == null
|
||||
? null
|
||||
: Province.fromJson(json['city'] as Map<String, dynamic>),
|
||||
address: json['address'] as String?,
|
||||
postal_code: 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,
|
||||
};
|
||||
|
||||
_Province _$ProvinceFromJson(Map<String, dynamic> json) =>
|
||||
_Province(key: json['key'] as String?, name: json['name'] as String?);
|
||||
|
||||
Map<String, dynamic> _$ProvinceToJson(_Province instance) => <String, dynamic>{
|
||||
'key': instance.key,
|
||||
'name': instance.name,
|
||||
};
|
||||
|
||||
_Activity _$ActivityFromJson(Map<String, dynamic> json) =>
|
||||
_Activity(key: json['key'] as String?, title: json['title'] as String?);
|
||||
|
||||
Map<String, dynamic> _$ActivityToJson(_Activity instance) => <String, dynamic>{
|
||||
'key': instance.key,
|
||||
'title': instance.title,
|
||||
};
|
||||
|
||||
_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?,
|
||||
);
|
||||
|
||||
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,
|
||||
};
|
||||
@@ -0,0 +1,25 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'bar_information.freezed.dart';
|
||||
part 'bar_information.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class BarInformation with _$BarInformation {
|
||||
const factory BarInformation({
|
||||
int? totalBars,
|
||||
int? totalBarsQuantity,
|
||||
double? totalBarsWeight,
|
||||
int? totalEnteredBars,
|
||||
int? totalEnteredBarsQuantity,
|
||||
double? totalEnteredBarsWeight,
|
||||
int? totalNotEnteredBars,
|
||||
int? totalNotEnteredBarsQuantity,
|
||||
double? totalNotEnteredKillHouseRequestsWeight,
|
||||
int? totalRejectedBars,
|
||||
int? totalRejectedBarsQuantity,
|
||||
double? totalRejectedBarsWeight,
|
||||
}) = _BarInformation;
|
||||
|
||||
factory BarInformation.fromJson(Map<String, dynamic> json) =>
|
||||
_$BarInformationFromJson(json);
|
||||
}
|
||||
@@ -0,0 +1,181 @@
|
||||
// dart format width=80
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'bar_information.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
/// @nodoc
|
||||
mixin _$BarInformation {
|
||||
|
||||
int? get totalBars; int? get totalBarsQuantity; double? get totalBarsWeight; int? get totalEnteredBars; int? get totalEnteredBarsQuantity; double? get totalEnteredBarsWeight; int? get totalNotEnteredBars; int? get totalNotEnteredBarsQuantity; double? get totalNotEnteredKillHouseRequestsWeight; int? get totalRejectedBars; int? get totalRejectedBarsQuantity; double? get totalRejectedBarsWeight;
|
||||
/// Create a copy of BarInformation
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$BarInformationCopyWith<BarInformation> get copyWith => _$BarInformationCopyWithImpl<BarInformation>(this as BarInformation, _$identity);
|
||||
|
||||
/// Serializes this BarInformation to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is BarInformation&&(identical(other.totalBars, totalBars) || other.totalBars == totalBars)&&(identical(other.totalBarsQuantity, totalBarsQuantity) || other.totalBarsQuantity == totalBarsQuantity)&&(identical(other.totalBarsWeight, totalBarsWeight) || other.totalBarsWeight == totalBarsWeight)&&(identical(other.totalEnteredBars, totalEnteredBars) || other.totalEnteredBars == totalEnteredBars)&&(identical(other.totalEnteredBarsQuantity, totalEnteredBarsQuantity) || other.totalEnteredBarsQuantity == totalEnteredBarsQuantity)&&(identical(other.totalEnteredBarsWeight, totalEnteredBarsWeight) || other.totalEnteredBarsWeight == totalEnteredBarsWeight)&&(identical(other.totalNotEnteredBars, totalNotEnteredBars) || other.totalNotEnteredBars == totalNotEnteredBars)&&(identical(other.totalNotEnteredBarsQuantity, totalNotEnteredBarsQuantity) || other.totalNotEnteredBarsQuantity == totalNotEnteredBarsQuantity)&&(identical(other.totalNotEnteredKillHouseRequestsWeight, totalNotEnteredKillHouseRequestsWeight) || other.totalNotEnteredKillHouseRequestsWeight == totalNotEnteredKillHouseRequestsWeight)&&(identical(other.totalRejectedBars, totalRejectedBars) || other.totalRejectedBars == totalRejectedBars)&&(identical(other.totalRejectedBarsQuantity, totalRejectedBarsQuantity) || other.totalRejectedBarsQuantity == totalRejectedBarsQuantity)&&(identical(other.totalRejectedBarsWeight, totalRejectedBarsWeight) || other.totalRejectedBarsWeight == totalRejectedBarsWeight));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,totalBars,totalBarsQuantity,totalBarsWeight,totalEnteredBars,totalEnteredBarsQuantity,totalEnteredBarsWeight,totalNotEnteredBars,totalNotEnteredBarsQuantity,totalNotEnteredKillHouseRequestsWeight,totalRejectedBars,totalRejectedBarsQuantity,totalRejectedBarsWeight);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'BarInformation(totalBars: $totalBars, totalBarsQuantity: $totalBarsQuantity, totalBarsWeight: $totalBarsWeight, totalEnteredBars: $totalEnteredBars, totalEnteredBarsQuantity: $totalEnteredBarsQuantity, totalEnteredBarsWeight: $totalEnteredBarsWeight, totalNotEnteredBars: $totalNotEnteredBars, totalNotEnteredBarsQuantity: $totalNotEnteredBarsQuantity, totalNotEnteredKillHouseRequestsWeight: $totalNotEnteredKillHouseRequestsWeight, totalRejectedBars: $totalRejectedBars, totalRejectedBarsQuantity: $totalRejectedBarsQuantity, totalRejectedBarsWeight: $totalRejectedBarsWeight)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $BarInformationCopyWith<$Res> {
|
||||
factory $BarInformationCopyWith(BarInformation value, $Res Function(BarInformation) _then) = _$BarInformationCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
int? totalBars, int? totalBarsQuantity, double? totalBarsWeight, int? totalEnteredBars, int? totalEnteredBarsQuantity, double? totalEnteredBarsWeight, int? totalNotEnteredBars, int? totalNotEnteredBarsQuantity, double? totalNotEnteredKillHouseRequestsWeight, int? totalRejectedBars, int? totalRejectedBarsQuantity, double? totalRejectedBarsWeight
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$BarInformationCopyWithImpl<$Res>
|
||||
implements $BarInformationCopyWith<$Res> {
|
||||
_$BarInformationCopyWithImpl(this._self, this._then);
|
||||
|
||||
final BarInformation _self;
|
||||
final $Res Function(BarInformation) _then;
|
||||
|
||||
/// Create a copy of BarInformation
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? totalBars = freezed,Object? totalBarsQuantity = freezed,Object? totalBarsWeight = freezed,Object? totalEnteredBars = freezed,Object? totalEnteredBarsQuantity = freezed,Object? totalEnteredBarsWeight = freezed,Object? totalNotEnteredBars = freezed,Object? totalNotEnteredBarsQuantity = freezed,Object? totalNotEnteredKillHouseRequestsWeight = freezed,Object? totalRejectedBars = freezed,Object? totalRejectedBarsQuantity = freezed,Object? totalRejectedBarsWeight = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
totalBars: freezed == totalBars ? _self.totalBars : totalBars // ignore: cast_nullable_to_non_nullable
|
||||
as int?,totalBarsQuantity: freezed == totalBarsQuantity ? _self.totalBarsQuantity : totalBarsQuantity // ignore: cast_nullable_to_non_nullable
|
||||
as int?,totalBarsWeight: freezed == totalBarsWeight ? _self.totalBarsWeight : totalBarsWeight // ignore: cast_nullable_to_non_nullable
|
||||
as double?,totalEnteredBars: freezed == totalEnteredBars ? _self.totalEnteredBars : totalEnteredBars // ignore: cast_nullable_to_non_nullable
|
||||
as int?,totalEnteredBarsQuantity: freezed == totalEnteredBarsQuantity ? _self.totalEnteredBarsQuantity : totalEnteredBarsQuantity // ignore: cast_nullable_to_non_nullable
|
||||
as int?,totalEnteredBarsWeight: freezed == totalEnteredBarsWeight ? _self.totalEnteredBarsWeight : totalEnteredBarsWeight // ignore: cast_nullable_to_non_nullable
|
||||
as double?,totalNotEnteredBars: freezed == totalNotEnteredBars ? _self.totalNotEnteredBars : totalNotEnteredBars // ignore: cast_nullable_to_non_nullable
|
||||
as int?,totalNotEnteredBarsQuantity: freezed == totalNotEnteredBarsQuantity ? _self.totalNotEnteredBarsQuantity : totalNotEnteredBarsQuantity // ignore: cast_nullable_to_non_nullable
|
||||
as int?,totalNotEnteredKillHouseRequestsWeight: freezed == totalNotEnteredKillHouseRequestsWeight ? _self.totalNotEnteredKillHouseRequestsWeight : totalNotEnteredKillHouseRequestsWeight // ignore: cast_nullable_to_non_nullable
|
||||
as double?,totalRejectedBars: freezed == totalRejectedBars ? _self.totalRejectedBars : totalRejectedBars // ignore: cast_nullable_to_non_nullable
|
||||
as int?,totalRejectedBarsQuantity: freezed == totalRejectedBarsQuantity ? _self.totalRejectedBarsQuantity : totalRejectedBarsQuantity // ignore: cast_nullable_to_non_nullable
|
||||
as int?,totalRejectedBarsWeight: freezed == totalRejectedBarsWeight ? _self.totalRejectedBarsWeight : totalRejectedBarsWeight // ignore: cast_nullable_to_non_nullable
|
||||
as double?,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
|
||||
class _BarInformation implements BarInformation {
|
||||
const _BarInformation({this.totalBars, this.totalBarsQuantity, this.totalBarsWeight, this.totalEnteredBars, this.totalEnteredBarsQuantity, this.totalEnteredBarsWeight, this.totalNotEnteredBars, this.totalNotEnteredBarsQuantity, this.totalNotEnteredKillHouseRequestsWeight, this.totalRejectedBars, this.totalRejectedBarsQuantity, this.totalRejectedBarsWeight});
|
||||
factory _BarInformation.fromJson(Map<String, dynamic> json) => _$BarInformationFromJson(json);
|
||||
|
||||
@override final int? totalBars;
|
||||
@override final int? totalBarsQuantity;
|
||||
@override final double? totalBarsWeight;
|
||||
@override final int? totalEnteredBars;
|
||||
@override final int? totalEnteredBarsQuantity;
|
||||
@override final double? totalEnteredBarsWeight;
|
||||
@override final int? totalNotEnteredBars;
|
||||
@override final int? totalNotEnteredBarsQuantity;
|
||||
@override final double? totalNotEnteredKillHouseRequestsWeight;
|
||||
@override final int? totalRejectedBars;
|
||||
@override final int? totalRejectedBarsQuantity;
|
||||
@override final double? totalRejectedBarsWeight;
|
||||
|
||||
/// Create a copy of BarInformation
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$BarInformationCopyWith<_BarInformation> get copyWith => __$BarInformationCopyWithImpl<_BarInformation>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$BarInformationToJson(this, );
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _BarInformation&&(identical(other.totalBars, totalBars) || other.totalBars == totalBars)&&(identical(other.totalBarsQuantity, totalBarsQuantity) || other.totalBarsQuantity == totalBarsQuantity)&&(identical(other.totalBarsWeight, totalBarsWeight) || other.totalBarsWeight == totalBarsWeight)&&(identical(other.totalEnteredBars, totalEnteredBars) || other.totalEnteredBars == totalEnteredBars)&&(identical(other.totalEnteredBarsQuantity, totalEnteredBarsQuantity) || other.totalEnteredBarsQuantity == totalEnteredBarsQuantity)&&(identical(other.totalEnteredBarsWeight, totalEnteredBarsWeight) || other.totalEnteredBarsWeight == totalEnteredBarsWeight)&&(identical(other.totalNotEnteredBars, totalNotEnteredBars) || other.totalNotEnteredBars == totalNotEnteredBars)&&(identical(other.totalNotEnteredBarsQuantity, totalNotEnteredBarsQuantity) || other.totalNotEnteredBarsQuantity == totalNotEnteredBarsQuantity)&&(identical(other.totalNotEnteredKillHouseRequestsWeight, totalNotEnteredKillHouseRequestsWeight) || other.totalNotEnteredKillHouseRequestsWeight == totalNotEnteredKillHouseRequestsWeight)&&(identical(other.totalRejectedBars, totalRejectedBars) || other.totalRejectedBars == totalRejectedBars)&&(identical(other.totalRejectedBarsQuantity, totalRejectedBarsQuantity) || other.totalRejectedBarsQuantity == totalRejectedBarsQuantity)&&(identical(other.totalRejectedBarsWeight, totalRejectedBarsWeight) || other.totalRejectedBarsWeight == totalRejectedBarsWeight));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,totalBars,totalBarsQuantity,totalBarsWeight,totalEnteredBars,totalEnteredBarsQuantity,totalEnteredBarsWeight,totalNotEnteredBars,totalNotEnteredBarsQuantity,totalNotEnteredKillHouseRequestsWeight,totalRejectedBars,totalRejectedBarsQuantity,totalRejectedBarsWeight);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'BarInformation(totalBars: $totalBars, totalBarsQuantity: $totalBarsQuantity, totalBarsWeight: $totalBarsWeight, totalEnteredBars: $totalEnteredBars, totalEnteredBarsQuantity: $totalEnteredBarsQuantity, totalEnteredBarsWeight: $totalEnteredBarsWeight, totalNotEnteredBars: $totalNotEnteredBars, totalNotEnteredBarsQuantity: $totalNotEnteredBarsQuantity, totalNotEnteredKillHouseRequestsWeight: $totalNotEnteredKillHouseRequestsWeight, totalRejectedBars: $totalRejectedBars, totalRejectedBarsQuantity: $totalRejectedBarsQuantity, totalRejectedBarsWeight: $totalRejectedBarsWeight)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$BarInformationCopyWith<$Res> implements $BarInformationCopyWith<$Res> {
|
||||
factory _$BarInformationCopyWith(_BarInformation value, $Res Function(_BarInformation) _then) = __$BarInformationCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
int? totalBars, int? totalBarsQuantity, double? totalBarsWeight, int? totalEnteredBars, int? totalEnteredBarsQuantity, double? totalEnteredBarsWeight, int? totalNotEnteredBars, int? totalNotEnteredBarsQuantity, double? totalNotEnteredKillHouseRequestsWeight, int? totalRejectedBars, int? totalRejectedBarsQuantity, double? totalRejectedBarsWeight
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$BarInformationCopyWithImpl<$Res>
|
||||
implements _$BarInformationCopyWith<$Res> {
|
||||
__$BarInformationCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _BarInformation _self;
|
||||
final $Res Function(_BarInformation) _then;
|
||||
|
||||
/// Create a copy of BarInformation
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? totalBars = freezed,Object? totalBarsQuantity = freezed,Object? totalBarsWeight = freezed,Object? totalEnteredBars = freezed,Object? totalEnteredBarsQuantity = freezed,Object? totalEnteredBarsWeight = freezed,Object? totalNotEnteredBars = freezed,Object? totalNotEnteredBarsQuantity = freezed,Object? totalNotEnteredKillHouseRequestsWeight = freezed,Object? totalRejectedBars = freezed,Object? totalRejectedBarsQuantity = freezed,Object? totalRejectedBarsWeight = freezed,}) {
|
||||
return _then(_BarInformation(
|
||||
totalBars: freezed == totalBars ? _self.totalBars : totalBars // ignore: cast_nullable_to_non_nullable
|
||||
as int?,totalBarsQuantity: freezed == totalBarsQuantity ? _self.totalBarsQuantity : totalBarsQuantity // ignore: cast_nullable_to_non_nullable
|
||||
as int?,totalBarsWeight: freezed == totalBarsWeight ? _self.totalBarsWeight : totalBarsWeight // ignore: cast_nullable_to_non_nullable
|
||||
as double?,totalEnteredBars: freezed == totalEnteredBars ? _self.totalEnteredBars : totalEnteredBars // ignore: cast_nullable_to_non_nullable
|
||||
as int?,totalEnteredBarsQuantity: freezed == totalEnteredBarsQuantity ? _self.totalEnteredBarsQuantity : totalEnteredBarsQuantity // ignore: cast_nullable_to_non_nullable
|
||||
as int?,totalEnteredBarsWeight: freezed == totalEnteredBarsWeight ? _self.totalEnteredBarsWeight : totalEnteredBarsWeight // ignore: cast_nullable_to_non_nullable
|
||||
as double?,totalNotEnteredBars: freezed == totalNotEnteredBars ? _self.totalNotEnteredBars : totalNotEnteredBars // ignore: cast_nullable_to_non_nullable
|
||||
as int?,totalNotEnteredBarsQuantity: freezed == totalNotEnteredBarsQuantity ? _self.totalNotEnteredBarsQuantity : totalNotEnteredBarsQuantity // ignore: cast_nullable_to_non_nullable
|
||||
as int?,totalNotEnteredKillHouseRequestsWeight: freezed == totalNotEnteredKillHouseRequestsWeight ? _self.totalNotEnteredKillHouseRequestsWeight : totalNotEnteredKillHouseRequestsWeight // ignore: cast_nullable_to_non_nullable
|
||||
as double?,totalRejectedBars: freezed == totalRejectedBars ? _self.totalRejectedBars : totalRejectedBars // ignore: cast_nullable_to_non_nullable
|
||||
as int?,totalRejectedBarsQuantity: freezed == totalRejectedBarsQuantity ? _self.totalRejectedBarsQuantity : totalRejectedBarsQuantity // ignore: cast_nullable_to_non_nullable
|
||||
as int?,totalRejectedBarsWeight: freezed == totalRejectedBarsWeight ? _self.totalRejectedBarsWeight : totalRejectedBarsWeight // ignore: cast_nullable_to_non_nullable
|
||||
as double?,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// dart format on
|
||||
@@ -0,0 +1,47 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'bar_information.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_BarInformation _$BarInformationFromJson(Map<String, dynamic> json) =>
|
||||
_BarInformation(
|
||||
totalBars: (json['total_bars'] as num?)?.toInt(),
|
||||
totalBarsQuantity: (json['total_bars_quantity'] as num?)?.toInt(),
|
||||
totalBarsWeight: (json['total_bars_weight'] as num?)?.toDouble(),
|
||||
totalEnteredBars: (json['total_entered_bars'] as num?)?.toInt(),
|
||||
totalEnteredBarsQuantity: (json['total_entered_bars_quantity'] as num?)
|
||||
?.toInt(),
|
||||
totalEnteredBarsWeight: (json['total_entered_bars_weight'] as num?)
|
||||
?.toDouble(),
|
||||
totalNotEnteredBars: (json['total_not_entered_bars'] as num?)?.toInt(),
|
||||
totalNotEnteredBarsQuantity:
|
||||
(json['total_not_entered_bars_quantity'] as num?)?.toInt(),
|
||||
totalNotEnteredKillHouseRequestsWeight:
|
||||
(json['total_not_entered_kill_house_requests_weight'] as num?)
|
||||
?.toDouble(),
|
||||
totalRejectedBars: (json['total_rejected_bars'] as num?)?.toInt(),
|
||||
totalRejectedBarsQuantity: (json['total_rejected_bars_quantity'] as num?)
|
||||
?.toInt(),
|
||||
totalRejectedBarsWeight: (json['total_rejected_bars_weight'] as num?)
|
||||
?.toDouble(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$BarInformationToJson(_BarInformation instance) =>
|
||||
<String, dynamic>{
|
||||
'total_bars': instance.totalBars,
|
||||
'total_bars_quantity': instance.totalBarsQuantity,
|
||||
'total_bars_weight': instance.totalBarsWeight,
|
||||
'total_entered_bars': instance.totalEnteredBars,
|
||||
'total_entered_bars_quantity': instance.totalEnteredBarsQuantity,
|
||||
'total_entered_bars_weight': instance.totalEnteredBarsWeight,
|
||||
'total_not_entered_bars': instance.totalNotEnteredBars,
|
||||
'total_not_entered_bars_quantity': instance.totalNotEnteredBarsQuantity,
|
||||
'total_not_entered_kill_house_requests_weight':
|
||||
instance.totalNotEnteredKillHouseRequestsWeight,
|
||||
'total_rejected_bars': instance.totalRejectedBars,
|
||||
'total_rejected_bars_quantity': instance.totalRejectedBarsQuantity,
|
||||
'total_rejected_bars_weight': instance.totalRejectedBarsWeight,
|
||||
};
|
||||
@@ -0,0 +1,28 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'guild_model.freezed.dart';
|
||||
part 'guild_model.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class GuildModel with _$GuildModel {
|
||||
const factory GuildModel({
|
||||
String? key,
|
||||
String? guildsName,
|
||||
bool? steward,
|
||||
User? user,
|
||||
}) = _GuildModel;
|
||||
|
||||
factory GuildModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$GuildModelFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class User with _$User {
|
||||
const factory User({
|
||||
String? fullname,
|
||||
String? mobile,
|
||||
String? city,
|
||||
}) = _User;
|
||||
|
||||
factory User.fromJson(Map<String, dynamic> json) => _$UserFromJson(json);
|
||||
}
|
||||
@@ -0,0 +1,320 @@
|
||||
// dart format width=80
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'guild_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
/// @nodoc
|
||||
mixin _$GuildModel {
|
||||
|
||||
String? get key; String? get guildsName; bool? get steward; User? get user;
|
||||
/// Create a copy of GuildModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$GuildModelCopyWith<GuildModel> get copyWith => _$GuildModelCopyWithImpl<GuildModel>(this as GuildModel, _$identity);
|
||||
|
||||
/// Serializes this GuildModel to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is GuildModel&&(identical(other.key, key) || other.key == key)&&(identical(other.guildsName, guildsName) || other.guildsName == guildsName)&&(identical(other.steward, steward) || other.steward == steward)&&(identical(other.user, user) || other.user == user));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,key,guildsName,steward,user);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'GuildModel(key: $key, guildsName: $guildsName, steward: $steward, user: $user)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $GuildModelCopyWith<$Res> {
|
||||
factory $GuildModelCopyWith(GuildModel value, $Res Function(GuildModel) _then) = _$GuildModelCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
String? key, String? guildsName, bool? steward, User? user
|
||||
});
|
||||
|
||||
|
||||
$UserCopyWith<$Res>? get user;
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$GuildModelCopyWithImpl<$Res>
|
||||
implements $GuildModelCopyWith<$Res> {
|
||||
_$GuildModelCopyWithImpl(this._self, this._then);
|
||||
|
||||
final GuildModel _self;
|
||||
final $Res Function(GuildModel) _then;
|
||||
|
||||
/// Create a copy of GuildModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? key = freezed,Object? guildsName = freezed,Object? steward = freezed,Object? user = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable
|
||||
as String?,guildsName: freezed == guildsName ? _self.guildsName : guildsName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,steward: freezed == steward ? _self.steward : steward // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,user: freezed == user ? _self.user : user // ignore: cast_nullable_to_non_nullable
|
||||
as User?,
|
||||
));
|
||||
}
|
||||
/// Create a copy of GuildModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$UserCopyWith<$Res>? get user {
|
||||
if (_self.user == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $UserCopyWith<$Res>(_self.user!, (value) {
|
||||
return _then(_self.copyWith(user: value));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
|
||||
class _GuildModel implements GuildModel {
|
||||
const _GuildModel({this.key, this.guildsName, this.steward, this.user});
|
||||
factory _GuildModel.fromJson(Map<String, dynamic> json) => _$GuildModelFromJson(json);
|
||||
|
||||
@override final String? key;
|
||||
@override final String? guildsName;
|
||||
@override final bool? steward;
|
||||
@override final User? user;
|
||||
|
||||
/// Create a copy of GuildModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$GuildModelCopyWith<_GuildModel> get copyWith => __$GuildModelCopyWithImpl<_GuildModel>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$GuildModelToJson(this, );
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _GuildModel&&(identical(other.key, key) || other.key == key)&&(identical(other.guildsName, guildsName) || other.guildsName == guildsName)&&(identical(other.steward, steward) || other.steward == steward)&&(identical(other.user, user) || other.user == user));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,key,guildsName,steward,user);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'GuildModel(key: $key, guildsName: $guildsName, steward: $steward, user: $user)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$GuildModelCopyWith<$Res> implements $GuildModelCopyWith<$Res> {
|
||||
factory _$GuildModelCopyWith(_GuildModel value, $Res Function(_GuildModel) _then) = __$GuildModelCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
String? key, String? guildsName, bool? steward, User? user
|
||||
});
|
||||
|
||||
|
||||
@override $UserCopyWith<$Res>? get user;
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$GuildModelCopyWithImpl<$Res>
|
||||
implements _$GuildModelCopyWith<$Res> {
|
||||
__$GuildModelCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _GuildModel _self;
|
||||
final $Res Function(_GuildModel) _then;
|
||||
|
||||
/// Create a copy of GuildModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? key = freezed,Object? guildsName = freezed,Object? steward = freezed,Object? user = freezed,}) {
|
||||
return _then(_GuildModel(
|
||||
key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable
|
||||
as String?,guildsName: freezed == guildsName ? _self.guildsName : guildsName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,steward: freezed == steward ? _self.steward : steward // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,user: freezed == user ? _self.user : user // ignore: cast_nullable_to_non_nullable
|
||||
as User?,
|
||||
));
|
||||
}
|
||||
|
||||
/// Create a copy of GuildModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$UserCopyWith<$Res>? get user {
|
||||
if (_self.user == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $UserCopyWith<$Res>(_self.user!, (value) {
|
||||
return _then(_self.copyWith(user: value));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// @nodoc
|
||||
mixin _$User {
|
||||
|
||||
String? get fullname; String? get mobile; String? get city;
|
||||
/// Create a copy of User
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$UserCopyWith<User> get copyWith => _$UserCopyWithImpl<User>(this as User, _$identity);
|
||||
|
||||
/// Serializes this User to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is User&&(identical(other.fullname, fullname) || other.fullname == fullname)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.city, city) || other.city == city));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,fullname,mobile,city);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'User(fullname: $fullname, mobile: $mobile, city: $city)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $UserCopyWith<$Res> {
|
||||
factory $UserCopyWith(User value, $Res Function(User) _then) = _$UserCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
String? fullname, String? mobile, String? city
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$UserCopyWithImpl<$Res>
|
||||
implements $UserCopyWith<$Res> {
|
||||
_$UserCopyWithImpl(this._self, this._then);
|
||||
|
||||
final User _self;
|
||||
final $Res Function(User) _then;
|
||||
|
||||
/// Create a copy of User
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? fullname = freezed,Object? mobile = freezed,Object? city = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
fullname: freezed == fullname ? _self.fullname : fullname // ignore: cast_nullable_to_non_nullable
|
||||
as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable
|
||||
as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
|
||||
class _User implements User {
|
||||
const _User({this.fullname, this.mobile, this.city});
|
||||
factory _User.fromJson(Map<String, dynamic> json) => _$UserFromJson(json);
|
||||
|
||||
@override final String? fullname;
|
||||
@override final String? mobile;
|
||||
@override final String? city;
|
||||
|
||||
/// Create a copy of User
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$UserCopyWith<_User> get copyWith => __$UserCopyWithImpl<_User>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$UserToJson(this, );
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _User&&(identical(other.fullname, fullname) || other.fullname == fullname)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.city, city) || other.city == city));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,fullname,mobile,city);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'User(fullname: $fullname, mobile: $mobile, city: $city)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$UserCopyWith<$Res> implements $UserCopyWith<$Res> {
|
||||
factory _$UserCopyWith(_User value, $Res Function(_User) _then) = __$UserCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
String? fullname, String? mobile, String? city
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$UserCopyWithImpl<$Res>
|
||||
implements _$UserCopyWith<$Res> {
|
||||
__$UserCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _User _self;
|
||||
final $Res Function(_User) _then;
|
||||
|
||||
/// Create a copy of User
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? fullname = freezed,Object? mobile = freezed,Object? city = freezed,}) {
|
||||
return _then(_User(
|
||||
fullname: freezed == fullname ? _self.fullname : fullname // ignore: cast_nullable_to_non_nullable
|
||||
as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable
|
||||
as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// dart format on
|
||||
@@ -0,0 +1,36 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'guild_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_GuildModel _$GuildModelFromJson(Map<String, dynamic> json) => _GuildModel(
|
||||
key: json['key'] as String?,
|
||||
guildsName: json['guilds_name'] as String?,
|
||||
steward: json['steward'] as bool?,
|
||||
user: json['user'] == null
|
||||
? null
|
||||
: User.fromJson(json['user'] as Map<String, dynamic>),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$GuildModelToJson(_GuildModel instance) =>
|
||||
<String, dynamic>{
|
||||
'key': instance.key,
|
||||
'guilds_name': instance.guildsName,
|
||||
'steward': instance.steward,
|
||||
'user': instance.user,
|
||||
};
|
||||
|
||||
_User _$UserFromJson(Map<String, dynamic> json) => _User(
|
||||
fullname: json['fullname'] as String?,
|
||||
mobile: json['mobile'] as String?,
|
||||
city: json['city'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$UserToJson(_User instance) => <String, dynamic>{
|
||||
'fullname': instance.fullname,
|
||||
'mobile': instance.mobile,
|
||||
'city': instance.city,
|
||||
};
|
||||
@@ -0,0 +1,160 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'guild_profile.freezed.dart';
|
||||
part 'guild_profile.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class GuildProfile with _$GuildProfile {
|
||||
const factory GuildProfile({
|
||||
int? id,
|
||||
User? user,
|
||||
Address? address,
|
||||
GuildAreaActivity? guild_area_activity,
|
||||
GuildTypeActivity? guild_type_activity,
|
||||
List<dynamic>? kill_house,
|
||||
List<dynamic>? steward_kill_house,
|
||||
List<dynamic>? stewards,
|
||||
GetPosStatus? get_pos_status,
|
||||
String? key,
|
||||
String? create_date,
|
||||
String? modify_date,
|
||||
bool? trash,
|
||||
String? user_id_foreign_key,
|
||||
String? address_id_foreign_key,
|
||||
String? user_bank_id_foreign_key,
|
||||
String? wallet_id_foreign_key,
|
||||
String? provincial_government_id_key,
|
||||
dynamic identity_documents,
|
||||
bool? active,
|
||||
int? city_number,
|
||||
String? city_name,
|
||||
String? guilds_id,
|
||||
String? license_number,
|
||||
String? guilds_name,
|
||||
String? phone,
|
||||
String? type_activity,
|
||||
String? area_activity,
|
||||
int? province_number,
|
||||
String? province_name,
|
||||
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,
|
||||
String? condition,
|
||||
String? description_condition,
|
||||
bool? steward_active,
|
||||
dynamic steward_allocation_limit,
|
||||
bool? steward_limitation_allocation,
|
||||
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,
|
||||
int? wallet,
|
||||
List<dynamic>? cars,
|
||||
List<dynamic>? user_level,
|
||||
}) = _GuildProfile;
|
||||
|
||||
factory GuildProfile.fromJson(Map<String, dynamic> json) =>
|
||||
_$GuildProfileFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class User with _$User {
|
||||
const factory User({
|
||||
String? fullname,
|
||||
String? first_name,
|
||||
String? last_name,
|
||||
String? mobile,
|
||||
String? national_id,
|
||||
String? city,
|
||||
}) = _User;
|
||||
|
||||
factory User.fromJson(Map<String, dynamic> json) => _$UserFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class Address with _$Address {
|
||||
const factory Address({
|
||||
Province? province,
|
||||
City? city,
|
||||
String? address,
|
||||
String? postal_code,
|
||||
}) = _Address;
|
||||
|
||||
factory Address.fromJson(Map<String, dynamic> json) =>
|
||||
_$AddressFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class Province with _$Province {
|
||||
const factory Province({
|
||||
String? key,
|
||||
String? name,
|
||||
}) = _Province;
|
||||
|
||||
factory Province.fromJson(Map<String, dynamic> json) =>
|
||||
_$ProvinceFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class City with _$City {
|
||||
const factory City({
|
||||
String? key,
|
||||
String? name,
|
||||
}) = _City;
|
||||
|
||||
factory City.fromJson(Map<String, dynamic> json) => _$CityFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class GuildAreaActivity with _$GuildAreaActivity {
|
||||
const factory GuildAreaActivity({
|
||||
String? key,
|
||||
String? title,
|
||||
}) = _GuildAreaActivity;
|
||||
|
||||
factory GuildAreaActivity.fromJson(Map<String, dynamic> json) =>
|
||||
_$GuildAreaActivityFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class GuildTypeActivity with _$GuildTypeActivity {
|
||||
const factory GuildTypeActivity({
|
||||
String? key,
|
||||
String? title,
|
||||
}) = _GuildTypeActivity;
|
||||
|
||||
factory GuildTypeActivity.fromJson(Map<String, dynamic> json) =>
|
||||
_$GuildTypeActivityFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class GetPosStatus with _$GetPosStatus {
|
||||
const factory GetPosStatus({
|
||||
int? len_active_sessions,
|
||||
bool? has_pons,
|
||||
bool? has_active_pons,
|
||||
}) = _GetPosStatus;
|
||||
|
||||
factory GetPosStatus.fromJson(Map<String, dynamic> json) =>
|
||||
_$GetPosStatusFromJson(json);
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,244 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'guild_profile.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_GuildProfile _$GuildProfileFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _GuildProfile(
|
||||
id: (json['id'] as num?)?.toInt(),
|
||||
user: json['user'] == null
|
||||
? null
|
||||
: User.fromJson(json['user'] as Map<String, dynamic>),
|
||||
address: json['address'] == null
|
||||
? null
|
||||
: Address.fromJson(json['address'] as Map<String, dynamic>),
|
||||
guild_area_activity: json['guild_area_activity'] == null
|
||||
? null
|
||||
: GuildAreaActivity.fromJson(
|
||||
json['guild_area_activity'] as Map<String, dynamic>,
|
||||
),
|
||||
guild_type_activity: json['guild_type_activity'] == null
|
||||
? null
|
||||
: GuildTypeActivity.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>?,
|
||||
stewards: json['stewards'] as List<dynamic>?,
|
||||
get_pos_status: json['get_pos_status'] == null
|
||||
? null
|
||||
: GetPosStatus.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?,
|
||||
trash: json['trash'] as bool?,
|
||||
user_id_foreign_key: json['user_id_foreign_key'] as String?,
|
||||
address_id_foreign_key: json['address_id_foreign_key'] as String?,
|
||||
user_bank_id_foreign_key: json['user_bank_id_foreign_key'] as String?,
|
||||
wallet_id_foreign_key: json['wallet_id_foreign_key'] as String?,
|
||||
provincial_government_id_key: json['provincial_government_id_key'] as String?,
|
||||
identity_documents: 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?,
|
||||
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?,
|
||||
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?,
|
||||
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?,
|
||||
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'],
|
||||
wallet: (json['wallet'] as num?)?.toInt(),
|
||||
cars: json['cars'] as List<dynamic>?,
|
||||
user_level: json['user_level'] as List<dynamic>?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$GuildProfileToJson(_GuildProfile 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,
|
||||
'stewards': instance.stewards,
|
||||
'get_pos_status': instance.get_pos_status,
|
||||
'key': instance.key,
|
||||
'create_date': instance.create_date,
|
||||
'modify_date': instance.modify_date,
|
||||
'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,
|
||||
'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,
|
||||
'phone': instance.phone,
|
||||
'type_activity': instance.type_activity,
|
||||
'area_activity': instance.area_activity,
|
||||
'province_number': instance.province_number,
|
||||
'province_name': instance.province_name,
|
||||
'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,
|
||||
'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,
|
||||
'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,
|
||||
'wallet': instance.wallet,
|
||||
'cars': instance.cars,
|
||||
'user_level': instance.user_level,
|
||||
};
|
||||
|
||||
_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?,
|
||||
mobile: json['mobile'] as String?,
|
||||
national_id: 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,
|
||||
'mobile': instance.mobile,
|
||||
'national_id': instance.national_id,
|
||||
'city': instance.city,
|
||||
};
|
||||
|
||||
_Address _$AddressFromJson(Map<String, dynamic> json) => _Address(
|
||||
province: json['province'] == null
|
||||
? null
|
||||
: Province.fromJson(json['province'] as Map<String, dynamic>),
|
||||
city: json['city'] == null
|
||||
? null
|
||||
: City.fromJson(json['city'] as Map<String, dynamic>),
|
||||
address: json['address'] as String?,
|
||||
postal_code: 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,
|
||||
};
|
||||
|
||||
_Province _$ProvinceFromJson(Map<String, dynamic> json) =>
|
||||
_Province(key: json['key'] as String?, name: json['name'] as String?);
|
||||
|
||||
Map<String, dynamic> _$ProvinceToJson(_Province instance) => <String, dynamic>{
|
||||
'key': instance.key,
|
||||
'name': instance.name,
|
||||
};
|
||||
|
||||
_City _$CityFromJson(Map<String, dynamic> json) =>
|
||||
_City(key: json['key'] as String?, name: json['name'] as String?);
|
||||
|
||||
Map<String, dynamic> _$CityToJson(_City instance) => <String, dynamic>{
|
||||
'key': instance.key,
|
||||
'name': instance.name,
|
||||
};
|
||||
|
||||
_GuildAreaActivity _$GuildAreaActivityFromJson(Map<String, dynamic> json) =>
|
||||
_GuildAreaActivity(
|
||||
key: json['key'] as String?,
|
||||
title: json['title'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$GuildAreaActivityToJson(_GuildAreaActivity instance) =>
|
||||
<String, dynamic>{'key': instance.key, 'title': instance.title};
|
||||
|
||||
_GuildTypeActivity _$GuildTypeActivityFromJson(Map<String, dynamic> json) =>
|
||||
_GuildTypeActivity(
|
||||
key: json['key'] as String?,
|
||||
title: json['title'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$GuildTypeActivityToJson(_GuildTypeActivity instance) =>
|
||||
<String, dynamic>{'key': instance.key, 'title': instance.title};
|
||||
|
||||
_GetPosStatus _$GetPosStatusFromJson(Map<String, dynamic> json) =>
|
||||
_GetPosStatus(
|
||||
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?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$GetPosStatusToJson(_GetPosStatus instance) =>
|
||||
<String, dynamic>{
|
||||
'len_active_sessions': instance.len_active_sessions,
|
||||
'has_pons': instance.has_pons,
|
||||
'has_active_pons': instance.has_active_pons,
|
||||
};
|
||||
@@ -0,0 +1,311 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'imported_loads_model.freezed.dart';
|
||||
part 'imported_loads_model.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class ImportedLoadsModel with _$ImportedLoadsModel {
|
||||
const factory ImportedLoadsModel({
|
||||
int? count,
|
||||
String? next,
|
||||
String? previous,
|
||||
List<ImportedLoad>? results,
|
||||
}) = _ImportedLoadsModel;
|
||||
|
||||
factory ImportedLoadsModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$ImportedLoadsModelFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class ImportedLoad with _$ImportedLoad {
|
||||
const factory ImportedLoad({
|
||||
int? id,
|
||||
Product? product,
|
||||
KillHouse? killHouse,
|
||||
dynamic toKillHouse,
|
||||
dynamic steward,
|
||||
ToSteward? toSteward,
|
||||
dynamic guilds,
|
||||
dynamic 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,
|
||||
double? weightOfCarcasses,
|
||||
double? realWeightOfCarcasses,
|
||||
double? receiverRealWeightOfCarcasses,
|
||||
double? 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,
|
||||
dynamic loggedRegistrationCode,
|
||||
String? state,
|
||||
String? receiverState,
|
||||
String? allocationState,
|
||||
String? date,
|
||||
dynamic role,
|
||||
dynamic stewardTempKey,
|
||||
bool? approvedPriceStatus,
|
||||
bool? calculateStatus,
|
||||
bool? temporaryTrash,
|
||||
bool? temporaryDeleted,
|
||||
dynamic createdBy,
|
||||
dynamic modifiedBy,
|
||||
dynamic wareHouse,
|
||||
dynamic stewardWareHouse,
|
||||
dynamic car,
|
||||
dynamic dispenser,
|
||||
}) = _ImportedLoad;
|
||||
|
||||
factory ImportedLoad.fromJson(Map<String, dynamic> json) =>
|
||||
_$ImportedLoadFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class Product with _$Product {
|
||||
const factory Product({
|
||||
double? weightAverage,
|
||||
}) = _Product;
|
||||
|
||||
factory Product.fromJson(Map<String, dynamic> json) =>
|
||||
_$ProductFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class KillHouse with _$KillHouse {
|
||||
const factory KillHouse({
|
||||
String? key,
|
||||
KillHouseOperator? killHouseOperator,
|
||||
String? name,
|
||||
bool? killer,
|
||||
}) = _KillHouse;
|
||||
|
||||
factory KillHouse.fromJson(Map<String, dynamic> json) =>
|
||||
_$KillHouseFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class KillHouseOperator with _$KillHouseOperator {
|
||||
const factory KillHouseOperator({
|
||||
User? user,
|
||||
}) = _KillHouseOperator;
|
||||
|
||||
factory KillHouseOperator.fromJson(Map<String, dynamic> json) =>
|
||||
_$KillHouseOperatorFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class User with _$User {
|
||||
const factory User({
|
||||
String? fullname,
|
||||
String? firstName,
|
||||
String? lastName,
|
||||
int? baseOrder,
|
||||
String? mobile,
|
||||
String? nationalId,
|
||||
String? nationalCode,
|
||||
String? key,
|
||||
City? city,
|
||||
String? unitName,
|
||||
String? unitNationalId,
|
||||
String? unitRegistrationNumber,
|
||||
String? unitEconomicalNumber,
|
||||
String? unitProvince,
|
||||
String? unitCity,
|
||||
String? unitPostalCode,
|
||||
String? unitAddress,
|
||||
}) = _User;
|
||||
|
||||
factory User.fromJson(Map<String, dynamic> json) => _$UserFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class City with _$City {
|
||||
const factory City({
|
||||
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,
|
||||
dynamic createdBy,
|
||||
dynamic modifiedBy,
|
||||
int? province,
|
||||
}) = _City;
|
||||
|
||||
factory City.fromJson(Map<String, dynamic> json) => _$CityFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class ToSteward with _$ToSteward {
|
||||
const factory ToSteward({
|
||||
int? id,
|
||||
ToStewardUser? user,
|
||||
Address? address,
|
||||
Activity? guildAreaActivity,
|
||||
Activity? guildTypeActivity,
|
||||
List<dynamic>? killHouse,
|
||||
List<dynamic>? stewardKillHouse,
|
||||
List<dynamic>? stewards,
|
||||
PosStatus? getPosStatus,
|
||||
String? key,
|
||||
String? createDate,
|
||||
String? modifyDate,
|
||||
bool? trash,
|
||||
dynamic userIdForeignKey,
|
||||
dynamic addressIdForeignKey,
|
||||
dynamic userBankIdForeignKey,
|
||||
dynamic walletIdForeignKey,
|
||||
dynamic provincialGovernmentIdKey,
|
||||
dynamic identityDocuments,
|
||||
bool? active,
|
||||
int? cityNumber,
|
||||
String? cityName,
|
||||
String? guildsId,
|
||||
String? licenseNumber,
|
||||
String? guildsName,
|
||||
dynamic phone,
|
||||
String? typeActivity,
|
||||
String? areaActivity,
|
||||
int? provinceNumber,
|
||||
String? provinceName,
|
||||
bool? steward,
|
||||
bool? hasPos,
|
||||
dynamic centersAllocation,
|
||||
dynamic killHouseCentersAllocation,
|
||||
dynamic allocationLimit,
|
||||
bool? limitationAllocation,
|
||||
dynamic registerarRole,
|
||||
dynamic registerarFullname,
|
||||
dynamic registerarMobile,
|
||||
bool? killHouseRegister,
|
||||
bool? stewardRegister,
|
||||
bool? guildsRoomRegister,
|
||||
bool? posCompanyRegister,
|
||||
String? provinceAcceptState,
|
||||
dynamic provinceMessage,
|
||||
dynamic condition,
|
||||
dynamic descriptionCondition,
|
||||
bool? stewardActive,
|
||||
dynamic stewardAllocationLimit,
|
||||
bool? stewardLimitationAllocation,
|
||||
bool? license,
|
||||
dynamic licenseForm,
|
||||
dynamic licenseFile,
|
||||
dynamic reviewerRole,
|
||||
dynamic reviewerFullname,
|
||||
dynamic reviewerMobile,
|
||||
dynamic checkerMessage,
|
||||
bool? finalAccept,
|
||||
bool? temporaryRegistration,
|
||||
dynamic createdBy,
|
||||
dynamic modifiedBy,
|
||||
dynamic userBankInfo,
|
||||
int? wallet,
|
||||
List<dynamic>? cars,
|
||||
List<dynamic>? userLevel,
|
||||
}) = _ToSteward;
|
||||
|
||||
factory ToSteward.fromJson(Map<String, dynamic> json) =>
|
||||
_$ToStewardFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class ToStewardUser with _$ToStewardUser {
|
||||
const factory ToStewardUser({
|
||||
String? fullname,
|
||||
String? firstName,
|
||||
String? lastName,
|
||||
String? mobile,
|
||||
String? nationalId,
|
||||
String? city,
|
||||
}) = _ToStewardUser;
|
||||
|
||||
factory ToStewardUser.fromJson(Map<String, dynamic> json) =>
|
||||
_$ToStewardUserFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class Address with _$Address {
|
||||
const factory Address({
|
||||
Province? province,
|
||||
CitySimple? city,
|
||||
String? address,
|
||||
String? postalCode,
|
||||
}) = _Address;
|
||||
|
||||
factory Address.fromJson(Map<String, dynamic> json) =>
|
||||
_$AddressFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class Province with _$Province {
|
||||
const factory Province({
|
||||
String? key,
|
||||
String? name,
|
||||
}) = _Province;
|
||||
|
||||
factory Province.fromJson(Map<String, dynamic> json) =>
|
||||
_$ProvinceFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class CitySimple with _$CitySimple {
|
||||
const factory CitySimple({
|
||||
String? key,
|
||||
String? name,
|
||||
}) = _CitySimple;
|
||||
|
||||
factory CitySimple.fromJson(Map<String, dynamic> json) =>
|
||||
_$CitySimpleFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class Activity with _$Activity {
|
||||
const factory Activity({
|
||||
String? key,
|
||||
String? title,
|
||||
}) = _Activity;
|
||||
|
||||
factory Activity.fromJson(Map<String, dynamic> json) =>
|
||||
_$ActivityFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class PosStatus with _$PosStatus {
|
||||
const factory PosStatus({
|
||||
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
@@ -0,0 +1,491 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'imported_loads_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_ImportedLoadsModel _$ImportedLoadsModelFromJson(Map<String, dynamic> json) =>
|
||||
_ImportedLoadsModel(
|
||||
count: (json['count'] as num?)?.toInt(),
|
||||
next: json['next'] as String?,
|
||||
previous: json['previous'] as String?,
|
||||
results: (json['results'] as List<dynamic>?)
|
||||
?.map((e) => ImportedLoad.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ImportedLoadsModelToJson(_ImportedLoadsModel instance) =>
|
||||
<String, dynamic>{
|
||||
'count': instance.count,
|
||||
'next': instance.next,
|
||||
'previous': instance.previous,
|
||||
'results': instance.results,
|
||||
};
|
||||
|
||||
_ImportedLoad _$ImportedLoadFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _ImportedLoad(
|
||||
id: (json['id'] as num?)?.toInt(),
|
||||
product: json['product'] == null
|
||||
? null
|
||||
: Product.fromJson(json['product'] as Map<String, dynamic>),
|
||||
killHouse: json['kill_house'] == null
|
||||
? null
|
||||
: KillHouse.fromJson(json['kill_house'] as Map<String, dynamic>),
|
||||
toKillHouse: json['to_kill_house'],
|
||||
steward: json['steward'],
|
||||
toSteward: json['to_steward'] == null
|
||||
? null
|
||||
: ToSteward.fromJson(json['to_steward'] as Map<String, dynamic>),
|
||||
guilds: json['guilds'],
|
||||
toGuilds: json['to_guilds'],
|
||||
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?,
|
||||
createDate: json['create_date'] as String?,
|
||||
modifyDate: json['modify_date'] as String?,
|
||||
trash: json['trash'] as bool?,
|
||||
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(),
|
||||
weightOfCarcasses: (json['weight_of_carcasses'] as num?)?.toDouble(),
|
||||
realWeightOfCarcasses: (json['real_weight_of_carcasses'] as num?)?.toDouble(),
|
||||
receiverRealWeightOfCarcasses:
|
||||
(json['receiver_real_weight_of_carcasses'] as num?)?.toDouble(),
|
||||
weightLossOfCarcasses: (json['weight_loss_of_carcasses'] as num?)?.toDouble(),
|
||||
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?,
|
||||
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(),
|
||||
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'],
|
||||
state: json['state'] as String?,
|
||||
receiverState: json['receiver_state'] as String?,
|
||||
allocationState: json['allocation_state'] as String?,
|
||||
date: json['date'] as String?,
|
||||
role: json['role'],
|
||||
stewardTempKey: json['steward_temp_key'],
|
||||
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'],
|
||||
modifiedBy: json['modified_by'],
|
||||
wareHouse: json['ware_house'],
|
||||
stewardWareHouse: json['steward_ware_house'],
|
||||
car: json['car'],
|
||||
dispenser: json['dispenser'],
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ImportedLoadToJson(
|
||||
_ImportedLoad instance,
|
||||
) => <String, dynamic>{
|
||||
'id': instance.id,
|
||||
'product': instance.product,
|
||||
'kill_house': instance.killHouse,
|
||||
'to_kill_house': instance.toKillHouse,
|
||||
'steward': instance.steward,
|
||||
'to_steward': instance.toSteward,
|
||||
'guilds': instance.guilds,
|
||||
'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.createDate,
|
||||
'modify_date': instance.modifyDate,
|
||||
'trash': instance.trash,
|
||||
'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.saleType,
|
||||
'allocation_type': instance.allocationType,
|
||||
'system_registration_code': instance.systemRegistrationCode,
|
||||
'registration_code': instance.registrationCode,
|
||||
'amount': instance.amount,
|
||||
'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.receiverState,
|
||||
'allocation_state': instance.allocationState,
|
||||
'date': instance.date,
|
||||
'role': instance.role,
|
||||
'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(weightAverage: (json['weight_average'] as num?)?.toDouble());
|
||||
|
||||
Map<String, dynamic> _$ProductToJson(_Product instance) => <String, dynamic>{
|
||||
'weight_average': instance.weightAverage,
|
||||
};
|
||||
|
||||
_KillHouse _$KillHouseFromJson(Map<String, dynamic> json) => _KillHouse(
|
||||
key: json['key'] as String?,
|
||||
killHouseOperator: json['kill_house_operator'] == null
|
||||
? null
|
||||
: KillHouseOperator.fromJson(
|
||||
json['kill_house_operator'] as Map<String, dynamic>,
|
||||
),
|
||||
name: json['name'] as String?,
|
||||
killer: json['killer'] as bool?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$KillHouseToJson(_KillHouse instance) =>
|
||||
<String, dynamic>{
|
||||
'key': instance.key,
|
||||
'kill_house_operator': instance.killHouseOperator,
|
||||
'name': instance.name,
|
||||
'killer': instance.killer,
|
||||
};
|
||||
|
||||
_KillHouseOperator _$KillHouseOperatorFromJson(Map<String, dynamic> json) =>
|
||||
_KillHouseOperator(
|
||||
user: json['user'] == null
|
||||
? null
|
||||
: User.fromJson(json['user'] as Map<String, dynamic>),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$KillHouseOperatorToJson(_KillHouseOperator instance) =>
|
||||
<String, dynamic>{'user': instance.user};
|
||||
|
||||
_User _$UserFromJson(Map<String, dynamic> json) => _User(
|
||||
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
|
||||
: City.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> _$UserToJson(_User 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,
|
||||
};
|
||||
|
||||
_City _$CityFromJson(Map<String, dynamic> json) => _City(
|
||||
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?,
|
||||
createdBy: json['created_by'],
|
||||
modifiedBy: json['modified_by'],
|
||||
province: (json['province'] as num?)?.toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$CityToJson(_City 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,
|
||||
'created_by': instance.createdBy,
|
||||
'modified_by': instance.modifiedBy,
|
||||
'province': instance.province,
|
||||
};
|
||||
|
||||
_ToSteward _$ToStewardFromJson(Map<String, dynamic> json) => _ToSteward(
|
||||
id: (json['id'] as num?)?.toInt(),
|
||||
user: json['user'] == null
|
||||
? null
|
||||
: ToStewardUser.fromJson(json['user'] as Map<String, dynamic>),
|
||||
address: json['address'] == null
|
||||
? null
|
||||
: Address.fromJson(json['address'] as Map<String, dynamic>),
|
||||
guildAreaActivity: json['guild_area_activity'] == null
|
||||
? null
|
||||
: Activity.fromJson(json['guild_area_activity'] as Map<String, dynamic>),
|
||||
guildTypeActivity: json['guild_type_activity'] == null
|
||||
? null
|
||||
: Activity.fromJson(json['guild_type_activity'] as Map<String, dynamic>),
|
||||
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
|
||||
? null
|
||||
: PosStatus.fromJson(json['get_pos_status'] as Map<String, dynamic>),
|
||||
key: json['key'] as String?,
|
||||
createDate: json['create_date'] as String?,
|
||||
modifyDate: json['modify_date'] as String?,
|
||||
trash: json['trash'] as bool?,
|
||||
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?,
|
||||
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'],
|
||||
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?,
|
||||
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'],
|
||||
registerarFullname: json['registerar_fullname'],
|
||||
registerarMobile: json['registerar_mobile'],
|
||||
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'],
|
||||
condition: json['condition'],
|
||||
descriptionCondition: json['description_condition'],
|
||||
stewardActive: json['steward_active'] as bool?,
|
||||
stewardAllocationLimit: json['steward_allocation_limit'],
|
||||
stewardLimitationAllocation: json['steward_limitation_allocation'] as bool?,
|
||||
license: json['license'] as bool?,
|
||||
licenseForm: json['license_form'],
|
||||
licenseFile: json['license_file'],
|
||||
reviewerRole: json['reviewer_role'],
|
||||
reviewerFullname: json['reviewer_fullname'],
|
||||
reviewerMobile: json['reviewer_mobile'],
|
||||
checkerMessage: json['checker_message'],
|
||||
finalAccept: json['final_accept'] as bool?,
|
||||
temporaryRegistration: json['temporary_registration'] as bool?,
|
||||
createdBy: json['created_by'],
|
||||
modifiedBy: json['modified_by'],
|
||||
userBankInfo: json['user_bank_info'],
|
||||
wallet: (json['wallet'] as num?)?.toInt(),
|
||||
cars: json['cars'] as List<dynamic>?,
|
||||
userLevel: json['user_level'] as List<dynamic>?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ToStewardToJson(_ToSteward instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'user': instance.user,
|
||||
'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,
|
||||
'key': instance.key,
|
||||
'create_date': instance.createDate,
|
||||
'modify_date': instance.modifyDate,
|
||||
'trash': instance.trash,
|
||||
'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.cityNumber,
|
||||
'city_name': instance.cityName,
|
||||
'guilds_id': instance.guildsId,
|
||||
'license_number': instance.licenseNumber,
|
||||
'guilds_name': instance.guildsName,
|
||||
'phone': instance.phone,
|
||||
'type_activity': instance.typeActivity,
|
||||
'area_activity': instance.areaActivity,
|
||||
'province_number': instance.provinceNumber,
|
||||
'province_name': instance.provinceName,
|
||||
'steward': instance.steward,
|
||||
'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.descriptionCondition,
|
||||
'steward_active': instance.stewardActive,
|
||||
'steward_allocation_limit': instance.stewardAllocationLimit,
|
||||
'steward_limitation_allocation': instance.stewardLimitationAllocation,
|
||||
'license': instance.license,
|
||||
'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.userLevel,
|
||||
};
|
||||
|
||||
_ToStewardUser _$ToStewardUserFromJson(Map<String, dynamic> json) =>
|
||||
_ToStewardUser(
|
||||
fullname: json['fullname'] as String?,
|
||||
firstName: json['first_name'] as String?,
|
||||
lastName: json['last_name'] as String?,
|
||||
mobile: json['mobile'] as String?,
|
||||
nationalId: json['national_id'] as String?,
|
||||
city: json['city'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ToStewardUserToJson(_ToStewardUser instance) =>
|
||||
<String, dynamic>{
|
||||
'fullname': instance.fullname,
|
||||
'first_name': instance.firstName,
|
||||
'last_name': instance.lastName,
|
||||
'mobile': instance.mobile,
|
||||
'national_id': instance.nationalId,
|
||||
'city': instance.city,
|
||||
};
|
||||
|
||||
_Address _$AddressFromJson(Map<String, dynamic> json) => _Address(
|
||||
province: json['province'] == null
|
||||
? null
|
||||
: Province.fromJson(json['province'] as Map<String, dynamic>),
|
||||
city: json['city'] == null
|
||||
? null
|
||||
: CitySimple.fromJson(json['city'] as Map<String, dynamic>),
|
||||
address: json['address'] 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.postalCode,
|
||||
};
|
||||
|
||||
_Province _$ProvinceFromJson(Map<String, dynamic> json) =>
|
||||
_Province(key: json['key'] as String?, name: json['name'] as String?);
|
||||
|
||||
Map<String, dynamic> _$ProvinceToJson(_Province instance) => <String, dynamic>{
|
||||
'key': instance.key,
|
||||
'name': instance.name,
|
||||
};
|
||||
|
||||
_CitySimple _$CitySimpleFromJson(Map<String, dynamic> json) =>
|
||||
_CitySimple(key: json['key'] as String?, name: json['name'] as String?);
|
||||
|
||||
Map<String, dynamic> _$CitySimpleToJson(_CitySimple instance) =>
|
||||
<String, dynamic>{'key': instance.key, 'name': instance.name};
|
||||
|
||||
_Activity _$ActivityFromJson(Map<String, dynamic> json) =>
|
||||
_Activity(key: json['key'] as String?, title: json['title'] as String?);
|
||||
|
||||
Map<String, dynamic> _$ActivityToJson(_Activity instance) => <String, dynamic>{
|
||||
'key': instance.key,
|
||||
'title': instance.title,
|
||||
};
|
||||
|
||||
_PosStatus _$PosStatusFromJson(Map<String, dynamic> json) => _PosStatus(
|
||||
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.lenActiveSessions,
|
||||
'has_pons': instance.hasPons,
|
||||
'has_active_pons': instance.hasActivePons,
|
||||
};
|
||||
@@ -0,0 +1,56 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'inventory_model.freezed.dart';
|
||||
part 'inventory_model.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class InventoryModel with _$InventoryModel {
|
||||
const factory InventoryModel({
|
||||
int? id,
|
||||
String? key,
|
||||
String? createDate,
|
||||
String? modifyDate,
|
||||
bool? trash,
|
||||
String? name,
|
||||
int? provinceGovernmentalCarcassesQuantity,
|
||||
int? provinceGovernmentalCarcassesWeight,
|
||||
int? provinceFreeCarcassesQuantity,
|
||||
int? provinceFreeCarcassesWeight,
|
||||
int? receiveGovernmentalCarcassesQuantity,
|
||||
int? receiveGovernmentalCarcassesWeight,
|
||||
int? receiveFreeCarcassesQuantity,
|
||||
int? receiveFreeCarcassesWeight,
|
||||
int? freeBuyingCarcassesQuantity,
|
||||
int? freeBuyingCarcassesWeight,
|
||||
int? totalGovernmentalCarcassesQuantity,
|
||||
int? totalGovernmentalCarcassesWeight,
|
||||
int? totalFreeBarsCarcassesQuantity,
|
||||
int? totalFreeBarsCarcassesWeight,
|
||||
double? weightAverage,
|
||||
int? totalCarcassesQuantity,
|
||||
int? totalCarcassesWeight,
|
||||
int? freezingQuantity,
|
||||
int? freezingWeight,
|
||||
int? lossWeight,
|
||||
int? outProvinceAllocatedQuantity,
|
||||
int? outProvinceAllocatedWeight,
|
||||
int? provinceAllocatedQuantity,
|
||||
int? provinceAllocatedWeight,
|
||||
int? realAllocatedQuantity,
|
||||
int? realAllocatedWeight,
|
||||
int? coldHouseAllocatedWeight,
|
||||
int? posAllocatedWeight,
|
||||
int? segmentationWeight,
|
||||
int? totalRemainQuantity,
|
||||
int? totalRemainWeight,
|
||||
int? freePrice,
|
||||
int? approvedPrice,
|
||||
bool? approvedPriceStatus,
|
||||
int? parentProduct,
|
||||
int? killHouse,
|
||||
int? guild,
|
||||
}) = _InventoryModel; // Changed to _InventoryModel
|
||||
|
||||
factory InventoryModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$InventoryModelFromJson(json);
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,127 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'inventory_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_InventoryModel _$InventoryModelFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _InventoryModel(
|
||||
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?,
|
||||
name: json['name'] as String?,
|
||||
provinceGovernmentalCarcassesQuantity:
|
||||
(json['province_governmental_carcasses_quantity'] as num?)?.toInt(),
|
||||
provinceGovernmentalCarcassesWeight:
|
||||
(json['province_governmental_carcasses_weight'] as num?)?.toInt(),
|
||||
provinceFreeCarcassesQuantity:
|
||||
(json['province_free_carcasses_quantity'] as num?)?.toInt(),
|
||||
provinceFreeCarcassesWeight: (json['province_free_carcasses_weight'] as num?)
|
||||
?.toInt(),
|
||||
receiveGovernmentalCarcassesQuantity:
|
||||
(json['receive_governmental_carcasses_quantity'] as num?)?.toInt(),
|
||||
receiveGovernmentalCarcassesWeight:
|
||||
(json['receive_governmental_carcasses_weight'] as num?)?.toInt(),
|
||||
receiveFreeCarcassesQuantity:
|
||||
(json['receive_free_carcasses_quantity'] as num?)?.toInt(),
|
||||
receiveFreeCarcassesWeight: (json['receive_free_carcasses_weight'] as num?)
|
||||
?.toInt(),
|
||||
freeBuyingCarcassesQuantity: (json['free_buying_carcasses_quantity'] as num?)
|
||||
?.toInt(),
|
||||
freeBuyingCarcassesWeight: (json['free_buying_carcasses_weight'] as num?)
|
||||
?.toInt(),
|
||||
totalGovernmentalCarcassesQuantity:
|
||||
(json['total_governmental_carcasses_quantity'] as num?)?.toInt(),
|
||||
totalGovernmentalCarcassesWeight:
|
||||
(json['total_governmental_carcasses_weight'] as num?)?.toInt(),
|
||||
totalFreeBarsCarcassesQuantity:
|
||||
(json['total_free_bars_carcasses_quantity'] as num?)?.toInt(),
|
||||
totalFreeBarsCarcassesWeight:
|
||||
(json['total_free_bars_carcasses_weight'] as num?)?.toInt(),
|
||||
weightAverage: (json['weight_average'] as num?)?.toDouble(),
|
||||
totalCarcassesQuantity: (json['total_carcasses_quantity'] as num?)?.toInt(),
|
||||
totalCarcassesWeight: (json['total_carcasses_weight'] as num?)?.toInt(),
|
||||
freezingQuantity: (json['freezing_quantity'] as num?)?.toInt(),
|
||||
freezingWeight: (json['freezing_weight'] as num?)?.toInt(),
|
||||
lossWeight: (json['loss_weight'] as num?)?.toInt(),
|
||||
outProvinceAllocatedQuantity:
|
||||
(json['out_province_allocated_quantity'] as num?)?.toInt(),
|
||||
outProvinceAllocatedWeight: (json['out_province_allocated_weight'] as num?)
|
||||
?.toInt(),
|
||||
provinceAllocatedQuantity: (json['province_allocated_quantity'] as num?)
|
||||
?.toInt(),
|
||||
provinceAllocatedWeight: (json['province_allocated_weight'] as num?)?.toInt(),
|
||||
realAllocatedQuantity: (json['real_allocated_quantity'] as num?)?.toInt(),
|
||||
realAllocatedWeight: (json['real_allocated_weight'] as num?)?.toInt(),
|
||||
coldHouseAllocatedWeight: (json['cold_house_allocated_weight'] as num?)
|
||||
?.toInt(),
|
||||
posAllocatedWeight: (json['pos_allocated_weight'] as num?)?.toInt(),
|
||||
segmentationWeight: (json['segmentation_weight'] as num?)?.toInt(),
|
||||
totalRemainQuantity: (json['total_remain_quantity'] as num?)?.toInt(),
|
||||
totalRemainWeight: (json['total_remain_weight'] as num?)?.toInt(),
|
||||
freePrice: (json['free_price'] as num?)?.toInt(),
|
||||
approvedPrice: (json['approved_price'] as num?)?.toInt(),
|
||||
approvedPriceStatus: json['approved_price_status'] as bool?,
|
||||
parentProduct: (json['parent_product'] as num?)?.toInt(),
|
||||
killHouse: (json['kill_house'] as num?)?.toInt(),
|
||||
guild: (json['guild'] as num?)?.toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$InventoryModelToJson(
|
||||
_InventoryModel instance,
|
||||
) => <String, dynamic>{
|
||||
'id': instance.id,
|
||||
'key': instance.key,
|
||||
'create_date': instance.createDate,
|
||||
'modify_date': instance.modifyDate,
|
||||
'trash': instance.trash,
|
||||
'name': instance.name,
|
||||
'province_governmental_carcasses_quantity':
|
||||
instance.provinceGovernmentalCarcassesQuantity,
|
||||
'province_governmental_carcasses_weight':
|
||||
instance.provinceGovernmentalCarcassesWeight,
|
||||
'province_free_carcasses_quantity': instance.provinceFreeCarcassesQuantity,
|
||||
'province_free_carcasses_weight': instance.provinceFreeCarcassesWeight,
|
||||
'receive_governmental_carcasses_quantity':
|
||||
instance.receiveGovernmentalCarcassesQuantity,
|
||||
'receive_governmental_carcasses_weight':
|
||||
instance.receiveGovernmentalCarcassesWeight,
|
||||
'receive_free_carcasses_quantity': instance.receiveFreeCarcassesQuantity,
|
||||
'receive_free_carcasses_weight': instance.receiveFreeCarcassesWeight,
|
||||
'free_buying_carcasses_quantity': instance.freeBuyingCarcassesQuantity,
|
||||
'free_buying_carcasses_weight': instance.freeBuyingCarcassesWeight,
|
||||
'total_governmental_carcasses_quantity':
|
||||
instance.totalGovernmentalCarcassesQuantity,
|
||||
'total_governmental_carcasses_weight':
|
||||
instance.totalGovernmentalCarcassesWeight,
|
||||
'total_free_bars_carcasses_quantity': instance.totalFreeBarsCarcassesQuantity,
|
||||
'total_free_bars_carcasses_weight': instance.totalFreeBarsCarcassesWeight,
|
||||
'weight_average': instance.weightAverage,
|
||||
'total_carcasses_quantity': instance.totalCarcassesQuantity,
|
||||
'total_carcasses_weight': instance.totalCarcassesWeight,
|
||||
'freezing_quantity': instance.freezingQuantity,
|
||||
'freezing_weight': instance.freezingWeight,
|
||||
'loss_weight': instance.lossWeight,
|
||||
'out_province_allocated_quantity': instance.outProvinceAllocatedQuantity,
|
||||
'out_province_allocated_weight': instance.outProvinceAllocatedWeight,
|
||||
'province_allocated_quantity': instance.provinceAllocatedQuantity,
|
||||
'province_allocated_weight': instance.provinceAllocatedWeight,
|
||||
'real_allocated_quantity': instance.realAllocatedQuantity,
|
||||
'real_allocated_weight': instance.realAllocatedWeight,
|
||||
'cold_house_allocated_weight': instance.coldHouseAllocatedWeight,
|
||||
'pos_allocated_weight': instance.posAllocatedWeight,
|
||||
'segmentation_weight': instance.segmentationWeight,
|
||||
'total_remain_quantity': instance.totalRemainQuantity,
|
||||
'total_remain_weight': instance.totalRemainWeight,
|
||||
'free_price': instance.freePrice,
|
||||
'approved_price': instance.approvedPrice,
|
||||
'approved_price_status': instance.approvedPriceStatus,
|
||||
'parent_product': instance.parentProduct,
|
||||
'kill_house': instance.killHouse,
|
||||
'guild': instance.guild,
|
||||
};
|
||||
@@ -0,0 +1,15 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'kill_house_distribution_info.freezed.dart';
|
||||
part 'kill_house_distribution_info.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class KillHouseDistributionInfo with _$KillHouseDistributionInfo {
|
||||
const factory KillHouseDistributionInfo({
|
||||
double? stewardAllocationsWeight,
|
||||
double? freeSalesWeight,
|
||||
}) = _KillHouseDistributionInfo;
|
||||
|
||||
factory KillHouseDistributionInfo.fromJson(Map<String, dynamic> json) =>
|
||||
_$KillHouseDistributionInfoFromJson(json);
|
||||
}
|
||||
@@ -0,0 +1,151 @@
|
||||
// dart format width=80
|
||||
// coverage:ignore-file
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// ignore_for_file: type=lint
|
||||
// ignore_for_file: unused_element, deprecated_member_use, deprecated_member_use_from_same_package, use_function_type_syntax_for_parameters, unnecessary_const, avoid_init_to_null, invalid_override_different_default_values_named, prefer_expression_function_bodies, annotate_overrides, invalid_annotation_target, unnecessary_question_mark
|
||||
|
||||
part of 'kill_house_distribution_info.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
/// @nodoc
|
||||
mixin _$KillHouseDistributionInfo {
|
||||
|
||||
double? get stewardAllocationsWeight; double? get freeSalesWeight;
|
||||
/// Create a copy of KillHouseDistributionInfo
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$KillHouseDistributionInfoCopyWith<KillHouseDistributionInfo> get copyWith => _$KillHouseDistributionInfoCopyWithImpl<KillHouseDistributionInfo>(this as KillHouseDistributionInfo, _$identity);
|
||||
|
||||
/// Serializes this KillHouseDistributionInfo to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is KillHouseDistributionInfo&&(identical(other.stewardAllocationsWeight, stewardAllocationsWeight) || other.stewardAllocationsWeight == stewardAllocationsWeight)&&(identical(other.freeSalesWeight, freeSalesWeight) || other.freeSalesWeight == freeSalesWeight));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,stewardAllocationsWeight,freeSalesWeight);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'KillHouseDistributionInfo(stewardAllocationsWeight: $stewardAllocationsWeight, freeSalesWeight: $freeSalesWeight)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $KillHouseDistributionInfoCopyWith<$Res> {
|
||||
factory $KillHouseDistributionInfoCopyWith(KillHouseDistributionInfo value, $Res Function(KillHouseDistributionInfo) _then) = _$KillHouseDistributionInfoCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
double? stewardAllocationsWeight, double? freeSalesWeight
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$KillHouseDistributionInfoCopyWithImpl<$Res>
|
||||
implements $KillHouseDistributionInfoCopyWith<$Res> {
|
||||
_$KillHouseDistributionInfoCopyWithImpl(this._self, this._then);
|
||||
|
||||
final KillHouseDistributionInfo _self;
|
||||
final $Res Function(KillHouseDistributionInfo) _then;
|
||||
|
||||
/// Create a copy of KillHouseDistributionInfo
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? stewardAllocationsWeight = freezed,Object? freeSalesWeight = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
stewardAllocationsWeight: freezed == stewardAllocationsWeight ? _self.stewardAllocationsWeight : stewardAllocationsWeight // ignore: cast_nullable_to_non_nullable
|
||||
as double?,freeSalesWeight: freezed == freeSalesWeight ? _self.freeSalesWeight : freeSalesWeight // ignore: cast_nullable_to_non_nullable
|
||||
as double?,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
|
||||
class _KillHouseDistributionInfo implements KillHouseDistributionInfo {
|
||||
const _KillHouseDistributionInfo({this.stewardAllocationsWeight, this.freeSalesWeight});
|
||||
factory _KillHouseDistributionInfo.fromJson(Map<String, dynamic> json) => _$KillHouseDistributionInfoFromJson(json);
|
||||
|
||||
@override final double? stewardAllocationsWeight;
|
||||
@override final double? freeSalesWeight;
|
||||
|
||||
/// Create a copy of KillHouseDistributionInfo
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$KillHouseDistributionInfoCopyWith<_KillHouseDistributionInfo> get copyWith => __$KillHouseDistributionInfoCopyWithImpl<_KillHouseDistributionInfo>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$KillHouseDistributionInfoToJson(this, );
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _KillHouseDistributionInfo&&(identical(other.stewardAllocationsWeight, stewardAllocationsWeight) || other.stewardAllocationsWeight == stewardAllocationsWeight)&&(identical(other.freeSalesWeight, freeSalesWeight) || other.freeSalesWeight == freeSalesWeight));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,stewardAllocationsWeight,freeSalesWeight);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'KillHouseDistributionInfo(stewardAllocationsWeight: $stewardAllocationsWeight, freeSalesWeight: $freeSalesWeight)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$KillHouseDistributionInfoCopyWith<$Res> implements $KillHouseDistributionInfoCopyWith<$Res> {
|
||||
factory _$KillHouseDistributionInfoCopyWith(_KillHouseDistributionInfo value, $Res Function(_KillHouseDistributionInfo) _then) = __$KillHouseDistributionInfoCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
double? stewardAllocationsWeight, double? freeSalesWeight
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$KillHouseDistributionInfoCopyWithImpl<$Res>
|
||||
implements _$KillHouseDistributionInfoCopyWith<$Res> {
|
||||
__$KillHouseDistributionInfoCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _KillHouseDistributionInfo _self;
|
||||
final $Res Function(_KillHouseDistributionInfo) _then;
|
||||
|
||||
/// Create a copy of KillHouseDistributionInfo
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? stewardAllocationsWeight = freezed,Object? freeSalesWeight = freezed,}) {
|
||||
return _then(_KillHouseDistributionInfo(
|
||||
stewardAllocationsWeight: freezed == stewardAllocationsWeight ? _self.stewardAllocationsWeight : stewardAllocationsWeight // ignore: cast_nullable_to_non_nullable
|
||||
as double?,freeSalesWeight: freezed == freeSalesWeight ? _self.freeSalesWeight : freeSalesWeight // ignore: cast_nullable_to_non_nullable
|
||||
as double?,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// dart format on
|
||||
@@ -0,0 +1,22 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'kill_house_distribution_info.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_KillHouseDistributionInfo _$KillHouseDistributionInfoFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _KillHouseDistributionInfo(
|
||||
stewardAllocationsWeight: (json['steward_allocations_weight'] as num?)
|
||||
?.toDouble(),
|
||||
freeSalesWeight: (json['free_sales_weight'] as num?)?.toDouble(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$KillHouseDistributionInfoToJson(
|
||||
_KillHouseDistributionInfo instance,
|
||||
) => <String, dynamic>{
|
||||
'steward_allocations_weight': instance.stewardAllocationsWeight,
|
||||
'free_sales_weight': instance.freeSalesWeight,
|
||||
};
|
||||
@@ -0,0 +1,67 @@
|
||||
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'roles_products.freezed.dart';
|
||||
part 'roles_products.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class RolesProductsModel with _$RolesProductsModel {
|
||||
factory RolesProductsModel({
|
||||
required List<ProductModel> products,
|
||||
}) = _RolesProductsModel;
|
||||
|
||||
factory RolesProductsModel.fromJson(Map<String, dynamic> json) => _$RolesProductsModelFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class ProductModel with _$ProductModel {
|
||||
factory ProductModel({
|
||||
int? id,
|
||||
String? key,
|
||||
String? create_date, // Changed from createDate, removed @JsonKey
|
||||
String? modify_date, // Changed from modifyDate, removed @JsonKey
|
||||
bool? trash,
|
||||
String? name,
|
||||
int? provinceGovernmentalCarcassesQuantity,
|
||||
int? provinceGovernmentalCarcassesWeight,
|
||||
int? provinceFreeCarcassesQuantity,
|
||||
int? provinceFreeCarcassesWeight,
|
||||
int? receiveGovernmentalCarcassesQuantity,
|
||||
int? receiveGovernmentalCarcassesWeight,
|
||||
int? receiveFreeCarcassesQuantity,
|
||||
int? receiveFreeCarcassesWeight,
|
||||
int? freeBuyingCarcassesQuantity,
|
||||
int? freeBuyingCarcassesWeight,
|
||||
int? totalGovernmentalCarcassesQuantity,
|
||||
int? totalGovernmentalCarcassesWeight,
|
||||
int? totalFreeBarsCarcassesQuantity,
|
||||
int? totalFreeBarsCarcassesWeight,
|
||||
double? weightAverage,
|
||||
int? totalCarcassesQuantity,
|
||||
int? totalCarcassesWeight,
|
||||
int? freezingQuantity,
|
||||
int? freezingWeight,
|
||||
int? lossWeight,
|
||||
int? outProvinceAllocatedQuantity,
|
||||
int? outProvinceAllocatedWeight,
|
||||
int? provinceAllocatedQuantity,
|
||||
int? provinceAllocatedWeight,
|
||||
int? realAllocatedQuantity,
|
||||
int? realAllocatedWeight,
|
||||
int? coldHouseAllocatedWeight,
|
||||
int? posAllocatedWeight,
|
||||
int? segmentationWeight,
|
||||
int? totalRemainQuantity,
|
||||
int? totalRemainWeight,
|
||||
int? freePrice,
|
||||
int? approvedPrice,
|
||||
bool? approvedPriceStatus,
|
||||
dynamic createdBy,
|
||||
dynamic modifiedBy,
|
||||
int? parentProduct,
|
||||
dynamic killHouse,
|
||||
int? guild,
|
||||
}) = _ProductModel;
|
||||
|
||||
factory ProductModel.fromJson(Map<String, dynamic> json) => _$ProductModelFromJson(json);
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,141 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'roles_products.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_RolesProductsModel _$RolesProductsModelFromJson(Map<String, dynamic> json) =>
|
||||
_RolesProductsModel(
|
||||
products: (json['products'] as List<dynamic>)
|
||||
.map((e) => ProductModel.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$RolesProductsModelToJson(_RolesProductsModel instance) =>
|
||||
<String, dynamic>{'products': instance.products};
|
||||
|
||||
_ProductModel _$ProductModelFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _ProductModel(
|
||||
id: (json['id'] as num?)?.toInt(),
|
||||
key: json['key'] as String?,
|
||||
create_date: json['create_date'] as String?,
|
||||
modify_date: json['modify_date'] as String?,
|
||||
trash: json['trash'] as bool?,
|
||||
name: json['name'] as String?,
|
||||
provinceGovernmentalCarcassesQuantity:
|
||||
(json['province_governmental_carcasses_quantity'] as num?)?.toInt(),
|
||||
provinceGovernmentalCarcassesWeight:
|
||||
(json['province_governmental_carcasses_weight'] as num?)?.toInt(),
|
||||
provinceFreeCarcassesQuantity:
|
||||
(json['province_free_carcasses_quantity'] as num?)?.toInt(),
|
||||
provinceFreeCarcassesWeight: (json['province_free_carcasses_weight'] as num?)
|
||||
?.toInt(),
|
||||
receiveGovernmentalCarcassesQuantity:
|
||||
(json['receive_governmental_carcasses_quantity'] as num?)?.toInt(),
|
||||
receiveGovernmentalCarcassesWeight:
|
||||
(json['receive_governmental_carcasses_weight'] as num?)?.toInt(),
|
||||
receiveFreeCarcassesQuantity:
|
||||
(json['receive_free_carcasses_quantity'] as num?)?.toInt(),
|
||||
receiveFreeCarcassesWeight: (json['receive_free_carcasses_weight'] as num?)
|
||||
?.toInt(),
|
||||
freeBuyingCarcassesQuantity: (json['free_buying_carcasses_quantity'] as num?)
|
||||
?.toInt(),
|
||||
freeBuyingCarcassesWeight: (json['free_buying_carcasses_weight'] as num?)
|
||||
?.toInt(),
|
||||
totalGovernmentalCarcassesQuantity:
|
||||
(json['total_governmental_carcasses_quantity'] as num?)?.toInt(),
|
||||
totalGovernmentalCarcassesWeight:
|
||||
(json['total_governmental_carcasses_weight'] as num?)?.toInt(),
|
||||
totalFreeBarsCarcassesQuantity:
|
||||
(json['total_free_bars_carcasses_quantity'] as num?)?.toInt(),
|
||||
totalFreeBarsCarcassesWeight:
|
||||
(json['total_free_bars_carcasses_weight'] as num?)?.toInt(),
|
||||
weightAverage: (json['weight_average'] as num?)?.toDouble(),
|
||||
totalCarcassesQuantity: (json['total_carcasses_quantity'] as num?)?.toInt(),
|
||||
totalCarcassesWeight: (json['total_carcasses_weight'] as num?)?.toInt(),
|
||||
freezingQuantity: (json['freezing_quantity'] as num?)?.toInt(),
|
||||
freezingWeight: (json['freezing_weight'] as num?)?.toInt(),
|
||||
lossWeight: (json['loss_weight'] as num?)?.toInt(),
|
||||
outProvinceAllocatedQuantity:
|
||||
(json['out_province_allocated_quantity'] as num?)?.toInt(),
|
||||
outProvinceAllocatedWeight: (json['out_province_allocated_weight'] as num?)
|
||||
?.toInt(),
|
||||
provinceAllocatedQuantity: (json['province_allocated_quantity'] as num?)
|
||||
?.toInt(),
|
||||
provinceAllocatedWeight: (json['province_allocated_weight'] as num?)?.toInt(),
|
||||
realAllocatedQuantity: (json['real_allocated_quantity'] as num?)?.toInt(),
|
||||
realAllocatedWeight: (json['real_allocated_weight'] as num?)?.toInt(),
|
||||
coldHouseAllocatedWeight: (json['cold_house_allocated_weight'] as num?)
|
||||
?.toInt(),
|
||||
posAllocatedWeight: (json['pos_allocated_weight'] as num?)?.toInt(),
|
||||
segmentationWeight: (json['segmentation_weight'] as num?)?.toInt(),
|
||||
totalRemainQuantity: (json['total_remain_quantity'] as num?)?.toInt(),
|
||||
totalRemainWeight: (json['total_remain_weight'] as num?)?.toInt(),
|
||||
freePrice: (json['free_price'] as num?)?.toInt(),
|
||||
approvedPrice: (json['approved_price'] as num?)?.toInt(),
|
||||
approvedPriceStatus: json['approved_price_status'] as bool?,
|
||||
createdBy: json['created_by'],
|
||||
modifiedBy: json['modified_by'],
|
||||
parentProduct: (json['parent_product'] as num?)?.toInt(),
|
||||
killHouse: json['kill_house'],
|
||||
guild: (json['guild'] as num?)?.toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ProductModelToJson(
|
||||
_ProductModel instance,
|
||||
) => <String, dynamic>{
|
||||
'id': instance.id,
|
||||
'key': instance.key,
|
||||
'create_date': instance.create_date,
|
||||
'modify_date': instance.modify_date,
|
||||
'trash': instance.trash,
|
||||
'name': instance.name,
|
||||
'province_governmental_carcasses_quantity':
|
||||
instance.provinceGovernmentalCarcassesQuantity,
|
||||
'province_governmental_carcasses_weight':
|
||||
instance.provinceGovernmentalCarcassesWeight,
|
||||
'province_free_carcasses_quantity': instance.provinceFreeCarcassesQuantity,
|
||||
'province_free_carcasses_weight': instance.provinceFreeCarcassesWeight,
|
||||
'receive_governmental_carcasses_quantity':
|
||||
instance.receiveGovernmentalCarcassesQuantity,
|
||||
'receive_governmental_carcasses_weight':
|
||||
instance.receiveGovernmentalCarcassesWeight,
|
||||
'receive_free_carcasses_quantity': instance.receiveFreeCarcassesQuantity,
|
||||
'receive_free_carcasses_weight': instance.receiveFreeCarcassesWeight,
|
||||
'free_buying_carcasses_quantity': instance.freeBuyingCarcassesQuantity,
|
||||
'free_buying_carcasses_weight': instance.freeBuyingCarcassesWeight,
|
||||
'total_governmental_carcasses_quantity':
|
||||
instance.totalGovernmentalCarcassesQuantity,
|
||||
'total_governmental_carcasses_weight':
|
||||
instance.totalGovernmentalCarcassesWeight,
|
||||
'total_free_bars_carcasses_quantity': instance.totalFreeBarsCarcassesQuantity,
|
||||
'total_free_bars_carcasses_weight': instance.totalFreeBarsCarcassesWeight,
|
||||
'weight_average': instance.weightAverage,
|
||||
'total_carcasses_quantity': instance.totalCarcassesQuantity,
|
||||
'total_carcasses_weight': instance.totalCarcassesWeight,
|
||||
'freezing_quantity': instance.freezingQuantity,
|
||||
'freezing_weight': instance.freezingWeight,
|
||||
'loss_weight': instance.lossWeight,
|
||||
'out_province_allocated_quantity': instance.outProvinceAllocatedQuantity,
|
||||
'out_province_allocated_weight': instance.outProvinceAllocatedWeight,
|
||||
'province_allocated_quantity': instance.provinceAllocatedQuantity,
|
||||
'province_allocated_weight': instance.provinceAllocatedWeight,
|
||||
'real_allocated_quantity': instance.realAllocatedQuantity,
|
||||
'real_allocated_weight': instance.realAllocatedWeight,
|
||||
'cold_house_allocated_weight': instance.coldHouseAllocatedWeight,
|
||||
'pos_allocated_weight': instance.posAllocatedWeight,
|
||||
'segmentation_weight': instance.segmentationWeight,
|
||||
'total_remain_quantity': instance.totalRemainQuantity,
|
||||
'total_remain_weight': instance.totalRemainWeight,
|
||||
'free_price': instance.freePrice,
|
||||
'approved_price': instance.approvedPrice,
|
||||
'approved_price_status': instance.approvedPriceStatus,
|
||||
'created_by': instance.createdBy,
|
||||
'modified_by': instance.modifiedBy,
|
||||
'parent_product': instance.parentProduct,
|
||||
'kill_house': instance.killHouse,
|
||||
'guild': instance.guild,
|
||||
};
|
||||
@@ -0,0 +1,266 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'waiting_arrival.freezed.dart';
|
||||
part 'waiting_arrival.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class WaitingArrivalModel with _$WaitingArrivalModel {
|
||||
factory WaitingArrivalModel({
|
||||
required int count,
|
||||
String? next,
|
||||
String? previous,
|
||||
required List<ResultModel> results,
|
||||
}) = _WaitingArrivalModel;
|
||||
|
||||
factory WaitingArrivalModel.fromJson(Map<String, dynamic> json) => _$WaitingArrivalModelFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class ResultModel with _$ResultModel {
|
||||
factory ResultModel({
|
||||
int? id,
|
||||
ProductModel? product,
|
||||
KillHouseModel? killHouse,
|
||||
dynamic toKillHouse,
|
||||
dynamic steward,
|
||||
@JsonKey(name: 'to_steward') ToStewardModel? toSteward,
|
||||
dynamic guilds,
|
||||
dynamic 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,
|
||||
double? weightOfCarcasses,
|
||||
double? realWeightOfCarcasses,
|
||||
double? receiverRealWeightOfCarcasses,
|
||||
double? 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,
|
||||
dynamic loggedRegistrationCode,
|
||||
String? state,
|
||||
String? receiverState,
|
||||
String? allocationState,
|
||||
String? date,
|
||||
dynamic role,
|
||||
dynamic stewardTempKey,
|
||||
bool? approvedPriceStatus,
|
||||
bool? calculateStatus,
|
||||
bool? temporaryTrash,
|
||||
bool? temporaryDeleted,
|
||||
dynamic createdBy,
|
||||
dynamic modifiedBy,
|
||||
dynamic wareHouse,
|
||||
dynamic stewardWareHouse,
|
||||
dynamic car,
|
||||
dynamic dispenser,
|
||||
}) = _ResultModel;
|
||||
|
||||
factory ResultModel.fromJson(Map<String, dynamic> json) => _$ResultModelFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class ProductModel with _$ProductModel {
|
||||
factory ProductModel({
|
||||
double? weightAverage,
|
||||
}) = _ProductModel;
|
||||
|
||||
factory ProductModel.fromJson(Map<String, dynamic> json) => _$ProductModelFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class ToStewardModel with _$ToStewardModel {
|
||||
factory ToStewardModel({
|
||||
int? id,
|
||||
ToStewardUserModel? user,
|
||||
AddressModel? address,
|
||||
GuildAreaActivityModel? guildAreaActivity,
|
||||
GuildTypeActivityModel? guildTypeActivity,
|
||||
List<dynamic>? killHouse,
|
||||
List<dynamic>? stewardKillHouse,
|
||||
List<dynamic>? stewards,
|
||||
GetPosStatusModel? getPosStatus,
|
||||
String? key,
|
||||
@JsonKey(name: 'create_date') String? createDate,
|
||||
@JsonKey(name: 'modify_date') String? modifyDate,
|
||||
bool? trash,
|
||||
bool? active,
|
||||
String? guildsId,
|
||||
String? licenseNumber,
|
||||
String? guildsName,
|
||||
String? typeActivity,
|
||||
String? areaActivity,
|
||||
bool? steward,
|
||||
bool? hasPos,
|
||||
String? provinceAcceptState,
|
||||
}) = _ToStewardModel;
|
||||
|
||||
factory ToStewardModel.fromJson(Map<String, dynamic> json) => _$ToStewardModelFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class ToStewardUserModel with _$ToStewardUserModel {
|
||||
factory ToStewardUserModel({
|
||||
String? fullname,
|
||||
@JsonKey(name: 'first_name') String? firstName,
|
||||
@JsonKey(name: 'last_name') String? lastName,
|
||||
String? mobile,
|
||||
@JsonKey(name: 'national_id') String? nationalId,
|
||||
String? city,
|
||||
}) = _ToStewardUserModel;
|
||||
|
||||
factory ToStewardUserModel.fromJson(Map<String, dynamic> json) => _$ToStewardUserModelFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class ToStewardCityModel with _$ToStewardCityModel {
|
||||
factory ToStewardCityModel({
|
||||
String? key,
|
||||
@JsonKey(name: 'name') String? title,
|
||||
}) = _ToStewardCityModel;
|
||||
|
||||
factory ToStewardCityModel.fromJson(Map<String, dynamic> json) => _$ToStewardCityModelFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class ToStewardProvinceModel with _$ToStewardProvinceModel {
|
||||
factory ToStewardProvinceModel({
|
||||
String? key,
|
||||
@JsonKey(name: 'name') String? title,
|
||||
}) = _ToStewardProvinceModel;
|
||||
|
||||
factory ToStewardProvinceModel.fromJson(Map<String, dynamic> json) => _$ToStewardProvinceModelFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class AddressModel with _$AddressModel {
|
||||
factory AddressModel({
|
||||
ToStewardProvinceModel? province,
|
||||
ToStewardCityModel? city,
|
||||
String? address,
|
||||
String? postalCode,
|
||||
}) = _AddressModel;
|
||||
|
||||
factory AddressModel.fromJson(Map<String, dynamic> json) => _$AddressModelFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class GuildAreaActivityModel with _$GuildAreaActivityModel {
|
||||
factory GuildAreaActivityModel({
|
||||
String? key,
|
||||
String? title,
|
||||
}) = _GuildAreaActivityModel;
|
||||
|
||||
factory GuildAreaActivityModel.fromJson(Map<String, dynamic> json) => _$GuildAreaActivityModelFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class GuildTypeActivityModel with _$GuildTypeActivityModel {
|
||||
factory GuildTypeActivityModel({
|
||||
String? key,
|
||||
String? title,
|
||||
}) = _GuildTypeActivityModel;
|
||||
|
||||
factory GuildTypeActivityModel.fromJson(Map<String, dynamic> json) => _$GuildTypeActivityModelFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class GetPosStatusModel with _$GetPosStatusModel {
|
||||
factory GetPosStatusModel({
|
||||
int? lenActiveSessions,
|
||||
bool? hasPons,
|
||||
bool? hasActivePons,
|
||||
}) = _GetPosStatusModel;
|
||||
|
||||
factory GetPosStatusModel.fromJson(Map<String, dynamic> json) => _$GetPosStatusModelFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class KillHouseModel with _$KillHouseModel {
|
||||
factory KillHouseModel({
|
||||
String? key,
|
||||
@JsonKey(name: 'kill_house_operator') KillHouseOperatorModel? operator,
|
||||
String? name,
|
||||
bool? killer,
|
||||
}) = _KillHouseModel;
|
||||
|
||||
factory KillHouseModel.fromJson(Map<String, dynamic> json) => _$KillHouseModelFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class KillHouseOperatorModel with _$KillHouseOperatorModel {
|
||||
factory KillHouseOperatorModel({
|
||||
UserModel? user,
|
||||
}) = _KillHouseOperatorModel;
|
||||
|
||||
factory KillHouseOperatorModel.fromJson(Map<String, dynamic> json) => _$KillHouseOperatorModelFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class UserModel with _$UserModel {
|
||||
factory UserModel({
|
||||
String? fullname,
|
||||
String? firstName,
|
||||
String? lastName,
|
||||
int? baseOrder,
|
||||
String? mobile,
|
||||
String? nationalId,
|
||||
String? nationalCode,
|
||||
String? key,
|
||||
CityModel? city,
|
||||
String? unitName,
|
||||
String? unitNationalId,
|
||||
String? unitRegistrationNumber,
|
||||
String? unitEconomicalNumber,
|
||||
String? unitProvince,
|
||||
String? unitCity,
|
||||
String? unitPostalCode,
|
||||
String? unitAddress,
|
||||
}) = _UserModel;
|
||||
|
||||
factory UserModel.fromJson(Map<String, dynamic> json) => _$UserModelFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class CityModel with _$CityModel {
|
||||
factory CityModel({
|
||||
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,
|
||||
dynamic createdBy,
|
||||
dynamic modifiedBy,
|
||||
int? province,
|
||||
}) = _CityModel;
|
||||
|
||||
factory CityModel.fromJson(Map<String, dynamic> json) => _$CityModelFromJson(json);
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,440 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'waiting_arrival.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_WaitingArrivalModel _$WaitingArrivalModelFromJson(Map<String, dynamic> json) =>
|
||||
_WaitingArrivalModel(
|
||||
count: (json['count'] as num).toInt(),
|
||||
next: json['next'] as String?,
|
||||
previous: json['previous'] as String?,
|
||||
results: (json['results'] as List<dynamic>)
|
||||
.map((e) => ResultModel.fromJson(e as Map<String, dynamic>))
|
||||
.toList(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$WaitingArrivalModelToJson(
|
||||
_WaitingArrivalModel instance,
|
||||
) => <String, dynamic>{
|
||||
'count': instance.count,
|
||||
'next': instance.next,
|
||||
'previous': instance.previous,
|
||||
'results': instance.results,
|
||||
};
|
||||
|
||||
_ResultModel _$ResultModelFromJson(Map<String, dynamic> json) => _ResultModel(
|
||||
id: (json['id'] as num?)?.toInt(),
|
||||
product: json['product'] == null
|
||||
? null
|
||||
: ProductModel.fromJson(json['product'] as Map<String, dynamic>),
|
||||
killHouse: json['kill_house'] == null
|
||||
? null
|
||||
: KillHouseModel.fromJson(json['kill_house'] as Map<String, dynamic>),
|
||||
toKillHouse: json['to_kill_house'],
|
||||
steward: json['steward'],
|
||||
toSteward: json['to_steward'] == null
|
||||
? null
|
||||
: ToStewardModel.fromJson(json['to_steward'] as Map<String, dynamic>),
|
||||
guilds: json['guilds'],
|
||||
toGuilds: json['to_guilds'],
|
||||
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?,
|
||||
createDate: json['create_date'] as String?,
|
||||
modifyDate: json['modify_date'] as String?,
|
||||
trash: json['trash'] as bool?,
|
||||
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(),
|
||||
weightOfCarcasses: (json['weight_of_carcasses'] as num?)?.toDouble(),
|
||||
realWeightOfCarcasses: (json['real_weight_of_carcasses'] as num?)?.toDouble(),
|
||||
receiverRealWeightOfCarcasses:
|
||||
(json['receiver_real_weight_of_carcasses'] as num?)?.toDouble(),
|
||||
weightLossOfCarcasses: (json['weight_loss_of_carcasses'] as num?)?.toDouble(),
|
||||
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?,
|
||||
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(),
|
||||
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'],
|
||||
state: json['state'] as String?,
|
||||
receiverState: json['receiver_state'] as String?,
|
||||
allocationState: json['allocation_state'] as String?,
|
||||
date: json['date'] as String?,
|
||||
role: json['role'],
|
||||
stewardTempKey: json['steward_temp_key'],
|
||||
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'],
|
||||
modifiedBy: json['modified_by'],
|
||||
wareHouse: json['ware_house'],
|
||||
stewardWareHouse: json['steward_ware_house'],
|
||||
car: json['car'],
|
||||
dispenser: json['dispenser'],
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ResultModelToJson(
|
||||
_ResultModel instance,
|
||||
) => <String, dynamic>{
|
||||
'id': instance.id,
|
||||
'product': instance.product,
|
||||
'kill_house': instance.killHouse,
|
||||
'to_kill_house': instance.toKillHouse,
|
||||
'steward': instance.steward,
|
||||
'to_steward': instance.toSteward,
|
||||
'guilds': instance.guilds,
|
||||
'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.createDate,
|
||||
'modify_date': instance.modifyDate,
|
||||
'trash': instance.trash,
|
||||
'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.saleType,
|
||||
'allocation_type': instance.allocationType,
|
||||
'system_registration_code': instance.systemRegistrationCode,
|
||||
'registration_code': instance.registrationCode,
|
||||
'amount': instance.amount,
|
||||
'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.receiverState,
|
||||
'allocation_state': instance.allocationState,
|
||||
'date': instance.date,
|
||||
'role': instance.role,
|
||||
'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,
|
||||
};
|
||||
|
||||
_ProductModel _$ProductModelFromJson(Map<String, dynamic> json) =>
|
||||
_ProductModel(weightAverage: (json['weight_average'] as num?)?.toDouble());
|
||||
|
||||
Map<String, dynamic> _$ProductModelToJson(_ProductModel instance) =>
|
||||
<String, dynamic>{'weight_average': instance.weightAverage};
|
||||
|
||||
_ToStewardModel _$ToStewardModelFromJson(Map<String, dynamic> json) =>
|
||||
_ToStewardModel(
|
||||
id: (json['id'] as num?)?.toInt(),
|
||||
user: json['user'] == null
|
||||
? null
|
||||
: ToStewardUserModel.fromJson(json['user'] as Map<String, dynamic>),
|
||||
address: json['address'] == null
|
||||
? null
|
||||
: AddressModel.fromJson(json['address'] as Map<String, dynamic>),
|
||||
guildAreaActivity: json['guild_area_activity'] == null
|
||||
? null
|
||||
: GuildAreaActivityModel.fromJson(
|
||||
json['guild_area_activity'] as Map<String, dynamic>,
|
||||
),
|
||||
guildTypeActivity: json['guild_type_activity'] == null
|
||||
? null
|
||||
: GuildTypeActivityModel.fromJson(
|
||||
json['guild_type_activity'] as Map<String, dynamic>,
|
||||
),
|
||||
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
|
||||
? null
|
||||
: GetPosStatusModel.fromJson(
|
||||
json['get_pos_status'] as Map<String, dynamic>,
|
||||
),
|
||||
key: json['key'] as String?,
|
||||
createDate: json['create_date'] as String?,
|
||||
modifyDate: json['modify_date'] as String?,
|
||||
trash: json['trash'] as bool?,
|
||||
active: json['active'] as bool?,
|
||||
guildsId: json['guilds_id'] as String?,
|
||||
licenseNumber: json['license_number'] as String?,
|
||||
guildsName: json['guilds_name'] as String?,
|
||||
typeActivity: json['type_activity'] as String?,
|
||||
areaActivity: json['area_activity'] as String?,
|
||||
steward: json['steward'] as bool?,
|
||||
hasPos: json['has_pos'] as bool?,
|
||||
provinceAcceptState: json['province_accept_state'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ToStewardModelToJson(_ToStewardModel instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'user': instance.user,
|
||||
'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,
|
||||
'key': instance.key,
|
||||
'create_date': instance.createDate,
|
||||
'modify_date': instance.modifyDate,
|
||||
'trash': instance.trash,
|
||||
'active': instance.active,
|
||||
'guilds_id': instance.guildsId,
|
||||
'license_number': instance.licenseNumber,
|
||||
'guilds_name': instance.guildsName,
|
||||
'type_activity': instance.typeActivity,
|
||||
'area_activity': instance.areaActivity,
|
||||
'steward': instance.steward,
|
||||
'has_pos': instance.hasPos,
|
||||
'province_accept_state': instance.provinceAcceptState,
|
||||
};
|
||||
|
||||
_ToStewardUserModel _$ToStewardUserModelFromJson(Map<String, dynamic> json) =>
|
||||
_ToStewardUserModel(
|
||||
fullname: json['fullname'] as String?,
|
||||
firstName: json['first_name'] as String?,
|
||||
lastName: json['last_name'] as String?,
|
||||
mobile: json['mobile'] as String?,
|
||||
nationalId: json['national_id'] as String?,
|
||||
city: json['city'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ToStewardUserModelToJson(_ToStewardUserModel instance) =>
|
||||
<String, dynamic>{
|
||||
'fullname': instance.fullname,
|
||||
'first_name': instance.firstName,
|
||||
'last_name': instance.lastName,
|
||||
'mobile': instance.mobile,
|
||||
'national_id': instance.nationalId,
|
||||
'city': instance.city,
|
||||
};
|
||||
|
||||
_ToStewardCityModel _$ToStewardCityModelFromJson(Map<String, dynamic> json) =>
|
||||
_ToStewardCityModel(
|
||||
key: json['key'] as String?,
|
||||
title: json['name'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ToStewardCityModelToJson(_ToStewardCityModel instance) =>
|
||||
<String, dynamic>{'key': instance.key, 'name': instance.title};
|
||||
|
||||
_ToStewardProvinceModel _$ToStewardProvinceModelFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _ToStewardProvinceModel(
|
||||
key: json['key'] as String?,
|
||||
title: json['name'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ToStewardProvinceModelToJson(
|
||||
_ToStewardProvinceModel instance,
|
||||
) => <String, dynamic>{'key': instance.key, 'name': instance.title};
|
||||
|
||||
_AddressModel _$AddressModelFromJson(Map<String, dynamic> json) =>
|
||||
_AddressModel(
|
||||
province: json['province'] == null
|
||||
? null
|
||||
: ToStewardProvinceModel.fromJson(
|
||||
json['province'] as Map<String, dynamic>,
|
||||
),
|
||||
city: json['city'] == null
|
||||
? null
|
||||
: ToStewardCityModel.fromJson(json['city'] as Map<String, dynamic>),
|
||||
address: json['address'] as String?,
|
||||
postalCode: json['postal_code'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$AddressModelToJson(_AddressModel instance) =>
|
||||
<String, dynamic>{
|
||||
'province': instance.province,
|
||||
'city': instance.city,
|
||||
'address': instance.address,
|
||||
'postal_code': instance.postalCode,
|
||||
};
|
||||
|
||||
_GuildAreaActivityModel _$GuildAreaActivityModelFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _GuildAreaActivityModel(
|
||||
key: json['key'] as String?,
|
||||
title: json['title'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$GuildAreaActivityModelToJson(
|
||||
_GuildAreaActivityModel instance,
|
||||
) => <String, dynamic>{'key': instance.key, 'title': instance.title};
|
||||
|
||||
_GuildTypeActivityModel _$GuildTypeActivityModelFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _GuildTypeActivityModel(
|
||||
key: json['key'] as String?,
|
||||
title: json['title'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$GuildTypeActivityModelToJson(
|
||||
_GuildTypeActivityModel instance,
|
||||
) => <String, dynamic>{'key': instance.key, 'title': instance.title};
|
||||
|
||||
_GetPosStatusModel _$GetPosStatusModelFromJson(Map<String, dynamic> json) =>
|
||||
_GetPosStatusModel(
|
||||
lenActiveSessions: (json['len_active_sessions'] as num?)?.toInt(),
|
||||
hasPons: json['has_pons'] as bool?,
|
||||
hasActivePons: json['has_active_pons'] as bool?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$GetPosStatusModelToJson(_GetPosStatusModel instance) =>
|
||||
<String, dynamic>{
|
||||
'len_active_sessions': instance.lenActiveSessions,
|
||||
'has_pons': instance.hasPons,
|
||||
'has_active_pons': instance.hasActivePons,
|
||||
};
|
||||
|
||||
_KillHouseModel _$KillHouseModelFromJson(Map<String, dynamic> json) =>
|
||||
_KillHouseModel(
|
||||
key: json['key'] as String?,
|
||||
operator: json['kill_house_operator'] == null
|
||||
? null
|
||||
: KillHouseOperatorModel.fromJson(
|
||||
json['kill_house_operator'] as Map<String, dynamic>,
|
||||
),
|
||||
name: json['name'] as String?,
|
||||
killer: json['killer'] as bool?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$KillHouseModelToJson(_KillHouseModel instance) =>
|
||||
<String, dynamic>{
|
||||
'key': instance.key,
|
||||
'kill_house_operator': instance.operator,
|
||||
'name': instance.name,
|
||||
'killer': instance.killer,
|
||||
};
|
||||
|
||||
_KillHouseOperatorModel _$KillHouseOperatorModelFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _KillHouseOperatorModel(
|
||||
user: json['user'] == null
|
||||
? null
|
||||
: UserModel.fromJson(json['user'] as Map<String, dynamic>),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$KillHouseOperatorModelToJson(
|
||||
_KillHouseOperatorModel instance,
|
||||
) => <String, dynamic>{'user': instance.user};
|
||||
|
||||
_UserModel _$UserModelFromJson(Map<String, dynamic> json) => _UserModel(
|
||||
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
|
||||
: CityModel.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> _$UserModelToJson(_UserModel 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,
|
||||
};
|
||||
|
||||
_CityModel _$CityModelFromJson(Map<String, dynamic> json) => _CityModel(
|
||||
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?,
|
||||
createdBy: json['created_by'],
|
||||
modifiedBy: json['modified_by'],
|
||||
province: (json['province'] as num?)?.toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$CityModelToJson(_CityModel 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,
|
||||
'created_by': instance.createdBy,
|
||||
'modified_by': instance.modifiedBy,
|
||||
'province': instance.province,
|
||||
};
|
||||
@@ -0,0 +1,60 @@
|
||||
import 'package:rasadyar_chicken/data/models/request/submit_steward_allocation/submit_steward_allocation.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/allocated_made/allocated_made.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/bar_information/bar_information.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/guild/guild_model.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/guild_profile/guild_profile.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/imported_loads_model/imported_loads_model.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/inventory/inventory_model.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/kill_house_distribution_info/kill_house_distribution_info.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/roles_products/roles_products.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/waiting_arrival/waiting_arrival.dart' hide ProductModel;
|
||||
|
||||
abstract class ChickenRepository {
|
||||
Future<List<InventoryModel>?> getInventory({required String token});
|
||||
|
||||
Future<KillHouseDistributionInfo?> getIKillHouseDistributionInfo({
|
||||
required String token,
|
||||
});
|
||||
|
||||
Future<BarInformation?> getGeneralBarInformation({required String token});
|
||||
|
||||
Future<WaitingArrivalModel?> getWaitingArrivals({
|
||||
required String token,
|
||||
int? page,
|
||||
});
|
||||
|
||||
Future<void> setSateForArrivals({
|
||||
required String token,
|
||||
required Map<String, dynamic> request,
|
||||
});
|
||||
|
||||
Future<ImportedLoadsModel?> getImportedLoadsModel({
|
||||
required String token,
|
||||
required int page,
|
||||
});
|
||||
|
||||
Future<AllocatedMadeModel?> getAllocatedMade({
|
||||
required String token,
|
||||
required int page,
|
||||
});
|
||||
|
||||
Future<void> confirmAllocation({
|
||||
required String token,
|
||||
required Map<String, dynamic> allocation,
|
||||
});
|
||||
|
||||
Future<void> denyAllocation({
|
||||
required String token,
|
||||
required String allocationToken,
|
||||
});
|
||||
|
||||
Future<void> confirmAllAllocation({
|
||||
required String token,
|
||||
required List<String> allocationTokens,
|
||||
});
|
||||
|
||||
Future<List<ProductModel>?> getRolesProducts({required String token});
|
||||
Future<List<GuildModel>?> getGuilds({required String token,required bool isFree});
|
||||
Future<GuildProfile?> getProfile({required String token});
|
||||
Future<void> postSubmitStewardAllocation({required String token,required SubmitStewardAllocation request});
|
||||
}
|
||||
@@ -0,0 +1,194 @@
|
||||
import 'package:rasadyar_chicken/data/models/request/submit_steward_allocation/submit_steward_allocation.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/allocated_made/allocated_made.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/bar_information/bar_information.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/guild/guild_model.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/guild_profile/guild_profile.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/imported_loads_model/imported_loads_model.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/inventory/inventory_model.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/kill_house_distribution_info/kill_house_distribution_info.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/roles_products/roles_products.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/waiting_arrival/waiting_arrival.dart'
|
||||
hide ProductModel;
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
import 'chicken_repository.dart';
|
||||
|
||||
class ChickenRepositoryImpl implements ChickenRepository {
|
||||
final DioRemote _httpClient;
|
||||
|
||||
ChickenRepositoryImpl(this._httpClient);
|
||||
|
||||
@override
|
||||
Future<List<InventoryModel>?> getInventory({required String token}) async {
|
||||
var res = await _httpClient.get(
|
||||
'/roles-products/?role=Steward',
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
fromJsonList: (json) => (json)
|
||||
.map((item) => InventoryModel.fromJson(item as Map<String, dynamic>))
|
||||
.toList(),
|
||||
);
|
||||
|
||||
return res.data;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<KillHouseDistributionInfo?> getIKillHouseDistributionInfo({
|
||||
required String token,
|
||||
}) async {
|
||||
var res = await _httpClient.get(
|
||||
'/kill-house-distribution-info/?role=Steward',
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
fromJson: KillHouseDistributionInfo.fromJson,
|
||||
);
|
||||
|
||||
return res.data;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<BarInformation?> getGeneralBarInformation({
|
||||
required String token,
|
||||
}) async {
|
||||
var res = await _httpClient.get(
|
||||
'/bars_for_kill_house_dashboard/?role=Steward',
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
fromJson: BarInformation.fromJson,
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<WaitingArrivalModel?> getWaitingArrivals({
|
||||
required String token,
|
||||
int? page,
|
||||
}) async {
|
||||
var res = await _httpClient.get(
|
||||
'/steward-allocation/?search=filter&value=&role=Steward&page=${page ?? 1}&page_size=10&type=not_entered',
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
fromJson: WaitingArrivalModel.fromJson,
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> setSateForArrivals({
|
||||
required String token,
|
||||
required Map<String, dynamic> request,
|
||||
}) async {
|
||||
await _httpClient.put(
|
||||
'/steward-allocation/0/',
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
data: request,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<ImportedLoadsModel?> getImportedLoadsModel({
|
||||
required String token,
|
||||
required int page,
|
||||
}) async {
|
||||
var res = await _httpClient.get(
|
||||
'/steward-allocation/?role=Steward&search=filter&page=${page}&page_size=10&value=&type=entered',
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
fromJson: ImportedLoadsModel.fromJson,
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<AllocatedMadeModel?> getAllocatedMade({
|
||||
required String token,
|
||||
required int page,
|
||||
}) async {
|
||||
var res = await _httpClient.get(
|
||||
'/steward-allocation/?search=filter&value=&role=Steward&page=$page&page_size=100',
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
fromJson: AllocatedMadeModel.fromJson,
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> confirmAllocation({
|
||||
required String token,
|
||||
required Map<String, dynamic> allocation,
|
||||
}) async {
|
||||
var res = await _httpClient.put(
|
||||
'/steward-allocation/0/',
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
data: allocation,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> denyAllocation({
|
||||
required String token,
|
||||
required String allocationToken,
|
||||
}) async {
|
||||
await _httpClient.delete(
|
||||
'/steward-allocation/0/?steward_allocation_key=$allocationToken',
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> confirmAllAllocation({
|
||||
required String token,
|
||||
required List<String> allocationTokens,
|
||||
}) async {
|
||||
await _httpClient.put(
|
||||
'/steward-allocation/0/',
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
data: {'steward_allocation_list': allocationTokens},
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<ProductModel>?> getRolesProducts({required String token}) async {
|
||||
var res = await _httpClient.get(
|
||||
'/roles-products/?role=Steward',
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
fromJsonList: (json) => json
|
||||
.map((item) => ProductModel.fromJson(item as Map<String, dynamic>))
|
||||
.toList(),
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<GuildModel>?> getGuilds({
|
||||
required String token,
|
||||
required bool isFree,
|
||||
}) async {
|
||||
var res = await _httpClient.get(
|
||||
'/guilds/?role=Steward&free=$isFree',
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
|
||||
fromJsonList: (json) => json
|
||||
.map((item) => GuildModel.fromJson(item as Map<String, dynamic>))
|
||||
.toList(),
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<GuildProfile?> getProfile({required String token}) async {
|
||||
var res = await _httpClient.get(
|
||||
'/guilds/0/?profile',
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
fromJson: GuildProfile.fromJson,
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> postSubmitStewardAllocation({
|
||||
required String token,
|
||||
required SubmitStewardAllocation request,
|
||||
}) async {
|
||||
await _httpClient.post(
|
||||
'/steward-allocation/',
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
data: request.toJson(),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,151 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_auth/data/utils/safe_call.dart';
|
||||
import 'package:rasadyar_chicken/chicken.dart';
|
||||
import 'package:rasadyar_chicken/data/models/request/steward_allocation/steward_allocation_request.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/bar_information/bar_information.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/imported_loads_model/imported_loads_model.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/waiting_arrival/waiting_arrival.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
class EnteringTheWarehouseLogic extends GetxController {
|
||||
RootLogic rootLogic = Get.find<RootLogic>();
|
||||
Rxn<BarInformation> barInformation = Rxn<BarInformation>();
|
||||
Rxn<WaitingArrivalModel> waitingForArrival = Rxn<WaitingArrivalModel>();
|
||||
Rxn<ImportedLoadsModel> importedLoads = Rxn<ImportedLoadsModel>();
|
||||
RxInt acceptType = 1.obs;
|
||||
TextEditingController weightController = TextEditingController();
|
||||
TextEditingController volumeController = TextEditingController();
|
||||
TextEditingController weightLossController = TextEditingController();
|
||||
TextEditingController authenticationCodeController = TextEditingController();
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
super.onReady();
|
||||
rootLogic.getInventory();
|
||||
getBarGeneralInformation();
|
||||
getWaitingArrivals();
|
||||
getImportedEntried();
|
||||
}
|
||||
|
||||
Future<void> getBarGeneralInformation() async {
|
||||
safeCall(
|
||||
call: () async =>
|
||||
await rootLogic.chickenRepository.getGeneralBarInformation(
|
||||
token: rootLogic.tokenService.accessToken.value!,
|
||||
),
|
||||
onError: (error, stackTrace) {
|
||||
eLog(error);
|
||||
},
|
||||
onSuccess: (result) {
|
||||
if (result != null) {
|
||||
barInformation.value = result;
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> getWaitingArrivals() async {
|
||||
safeCall(
|
||||
call: () async => await rootLogic.chickenRepository.getWaitingArrivals(
|
||||
token: rootLogic.tokenService.accessToken.value!,
|
||||
page: 1,
|
||||
),
|
||||
onError: (error, stackTrace) {
|
||||
eLog(error);
|
||||
},
|
||||
onSuccess: (result) {
|
||||
if (result != null) {
|
||||
waitingForArrival.value = result;
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> acceptEntried(String key) async {
|
||||
var request = StewardAllocationRequest(
|
||||
allocationKey: key,
|
||||
checkAllocation: true,
|
||||
state: 'accepted',
|
||||
receiverRealNumberOfCarcasses: int.parse(
|
||||
volumeController.text.isNotEmpty ? volumeController.text : '0',
|
||||
),
|
||||
receiverRealWeightOfCarcasses: int.parse(
|
||||
weightController.text.isNotEmpty ? weightController.text : '0',
|
||||
),
|
||||
registrationCode: acceptType.value == 1
|
||||
? int.parse(
|
||||
authenticationCodeController.text.isNotEmpty
|
||||
? authenticationCodeController.text
|
||||
: '0',
|
||||
)
|
||||
: null,
|
||||
weightLossOfCarcasses: int.parse(
|
||||
weightLossController.text.isNotEmpty ? weightLossController.text : '0',
|
||||
),
|
||||
).toJson();
|
||||
request.removeWhere((key, value) => value == null);
|
||||
|
||||
safeCall(
|
||||
call: () async => await rootLogic.chickenRepository.setSateForArrivals(
|
||||
token: rootLogic.tokenService.accessToken.value!,
|
||||
request: request,
|
||||
),
|
||||
onError: (error, stackTrace) {
|
||||
eLog(error);
|
||||
},
|
||||
onSuccess: (result) {
|
||||
clearControllers();
|
||||
getWaitingArrivals();
|
||||
getBarGeneralInformation();
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> denyEntried(String key) async {
|
||||
var request = StewardAllocationRequest(
|
||||
allocationKey: key,
|
||||
checkAllocation: true,
|
||||
state: 'rejected',
|
||||
).toJson();
|
||||
request.removeWhere((key, value) => value == null);
|
||||
|
||||
safeCall(
|
||||
call: () async => await rootLogic.chickenRepository.setSateForArrivals(
|
||||
token: rootLogic.tokenService.accessToken.value!,
|
||||
request: request,
|
||||
),
|
||||
onError: (error, stackTrace) {
|
||||
eLog(error);
|
||||
},
|
||||
onSuccess: (result) {
|
||||
getWaitingArrivals();
|
||||
getBarGeneralInformation();
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> getImportedEntried() async {
|
||||
safeCall(
|
||||
call: () async => await rootLogic.chickenRepository.getImportedLoadsModel(
|
||||
token: rootLogic.tokenService.accessToken.value!,
|
||||
page: 1,
|
||||
),
|
||||
onError: (error, stackTrace) {
|
||||
eLog(error);
|
||||
},
|
||||
onSuccess: (result) {
|
||||
if(result!=null){
|
||||
importedLoads.value = result;
|
||||
}
|
||||
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
clearControllers() {
|
||||
weightController.clear();
|
||||
volumeController.clear();
|
||||
weightLossController.clear();
|
||||
authenticationCodeController.clear();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
extension xStringUtils on String {
|
||||
get faAllocationType {
|
||||
final tmp = split('_');
|
||||
tmp.insert(1, '_');
|
||||
if (tmp.length > 1) {
|
||||
return tmp.map((e) => utilsMap[e] ?? e).join(' ');
|
||||
} else {
|
||||
return utilsMap[this] ?? this;
|
||||
}
|
||||
}
|
||||
|
||||
get faItem => utilsMap[this] ?? this;
|
||||
|
||||
}
|
||||
|
||||
Map<String, String> utilsMap = {
|
||||
'killhouse': 'کشتارگاه',
|
||||
'_': 'به',
|
||||
'steward': 'مباشر',
|
||||
'exclusive': 'اختصاصی',
|
||||
'free': 'آزاد',
|
||||
'pending': 'در انتظار',
|
||||
'accepted': 'تایید شده',
|
||||
'guild':'صنف'
|
||||
};
|
||||
@@ -0,0 +1,600 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/bar_information/bar_information.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/inventory/inventory_model.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/waiting_arrival/waiting_arrival.dart';
|
||||
import 'package:rasadyar_chicken/presentation/pages/entering_the_warehouse/string_utils.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
import 'logic.dart';
|
||||
|
||||
class EnteringTheWarehousePage extends GetView<EnteringTheWarehouseLogic> {
|
||||
EnteringTheWarehousePage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: RAppBar(title: 'ورود به انبار'),
|
||||
body: SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
inventoryWidget(),
|
||||
ObxValue((data) {
|
||||
return generalBarInformation(data.value);
|
||||
}, controller.barInformation),
|
||||
waitingForArrival(),
|
||||
importedLoads(),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget inventoryWidget() {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8.0),
|
||||
child: Column(
|
||||
children: [
|
||||
const SizedBox(height: 20),
|
||||
Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: Text(
|
||||
'موجودی انبار',
|
||||
style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 4),
|
||||
ObxValue(
|
||||
(data) => data.isEmpty
|
||||
? Container(
|
||||
margin: const EdgeInsets.symmetric(vertical: 2),
|
||||
height: 80,
|
||||
padding: EdgeInsets.all(6),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(color: AppColor.blueNormal, width: 1),
|
||||
),
|
||||
child: Center(child: CircularProgressIndicator()),
|
||||
)
|
||||
: ListView.separated(
|
||||
shrinkWrap: true,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
itemCount: controller.rootLogic.inventoryList.length,
|
||||
separatorBuilder: (context, index) =>
|
||||
const SizedBox(height: 8),
|
||||
itemBuilder: (context, index) {
|
||||
return ObxValue((expand) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
controller.rootLogic.toggleExpanded(index);
|
||||
},
|
||||
behavior: HitTestBehavior.opaque,
|
||||
child: AnimatedContainer(
|
||||
onEnd: () {
|
||||
controller
|
||||
.rootLogic
|
||||
.inventoryExpandedList[index] = !controller
|
||||
.rootLogic
|
||||
.inventoryExpandedList[index]!;
|
||||
},
|
||||
margin: const EdgeInsets.symmetric(vertical: 2),
|
||||
padding: EdgeInsets.all(6),
|
||||
curve: Curves.easeInOut,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(
|
||||
color: AppColor.blueNormal,
|
||||
width: 1,
|
||||
),
|
||||
),
|
||||
duration: const Duration(seconds: 1),
|
||||
height: expand.keys.contains(index) ? 250 : 80,
|
||||
child: inventoryItem(
|
||||
isExpanded:
|
||||
expand.keys.contains(index) && expand[index]!,
|
||||
index: index,
|
||||
model: controller.rootLogic.inventoryList[index],
|
||||
),
|
||||
),
|
||||
);
|
||||
}, controller.rootLogic.inventoryExpandedList);
|
||||
},
|
||||
),
|
||||
controller.rootLogic.inventoryList,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget inventoryItem({
|
||||
required bool isExpanded,
|
||||
required int index,
|
||||
required InventoryModel model,
|
||||
}) {
|
||||
return Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
spacing: 8,
|
||||
children: [
|
||||
buildRow('نام محصول', model.name ?? ''),
|
||||
Visibility(
|
||||
visible: isExpanded,
|
||||
child: Column(
|
||||
spacing: 8,
|
||||
children: [
|
||||
buildRow('وزن خریدهای دولتی داخل استان (کیلوگرم)', '0'),
|
||||
buildRow(
|
||||
'وزن خریدهای آزاد داخل استان (کیلوگرم)',
|
||||
model.receiveFreeCarcassesWeight.toString(),
|
||||
),
|
||||
buildRow(
|
||||
'وزن خریدهای خارج استان (کیلوگرم)',
|
||||
model.freeBuyingCarcassesWeight.toString(),
|
||||
),
|
||||
buildRow(
|
||||
'کل ورودی به انبار (کیلوگرم)',
|
||||
model.totalFreeBarsCarcassesWeight.toString(),
|
||||
),
|
||||
buildRow(
|
||||
'کل فروش (کیلوگرم)',
|
||||
model.realAllocatedWeight.toString(),
|
||||
),
|
||||
buildRow(
|
||||
'مانده انبار (کیلوگرم)',
|
||||
model.totalRemainWeight.toString(),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget buildRow(String title, String value) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 4.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Flexible(
|
||||
flex: 2,
|
||||
child: Text(
|
||||
title,
|
||||
textAlign: TextAlign.right,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
),
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: Text(
|
||||
value,
|
||||
textAlign: TextAlign.left,
|
||||
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget generalBarInformation(BarInformation? model) {
|
||||
return Column(
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8.0),
|
||||
child: Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: Text(
|
||||
'اطلاعات کلی بارها',
|
||||
style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
height: 290,
|
||||
margin: const EdgeInsets.all(8),
|
||||
padding: const EdgeInsets.all(12),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(color: AppColor.blueNormal, width: 1),
|
||||
),
|
||||
child: model != null
|
||||
? Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
spacing: 8,
|
||||
children: [
|
||||
buildRow(
|
||||
'تعداد کل بارها',
|
||||
model.totalBars!.toInt().toString(),
|
||||
),
|
||||
buildRow(
|
||||
'وزن کل بارها (کیلوگرم)',
|
||||
model.totalBarsWeight!.toInt().toString(),
|
||||
),
|
||||
buildRow(
|
||||
'تعداد کل بارهای وارد شده',
|
||||
model.totalEnteredBars!.toInt().toString(),
|
||||
),
|
||||
buildRow(
|
||||
'وزن کل بار وارد شده (کیلوگرم)',
|
||||
model.totalEnteredBarsWeight!.toInt().toString(),
|
||||
),
|
||||
buildRow(
|
||||
'تعداد کل بارهای وارد نشده',
|
||||
model.totalNotEnteredBars!.toInt().toString(),
|
||||
),
|
||||
buildRow(
|
||||
'وزن کل بار وارد نشده (کیلوگرم)',
|
||||
model.totalNotEnteredKillHouseRequestsWeight!
|
||||
.toInt()
|
||||
.toString(),
|
||||
),
|
||||
buildRow(
|
||||
'تعداد کل بارهای رد شده',
|
||||
model.totalRejectedBars!.toInt().toString(),
|
||||
),
|
||||
buildRow(
|
||||
' وزن کل بارهای رد شده',
|
||||
model.totalRejectedBarsWeight!.toInt().toString(),
|
||||
),
|
||||
],
|
||||
)
|
||||
: const Center(child: CircularProgressIndicator()),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget waitingForArrival() {
|
||||
return Column(
|
||||
children: [
|
||||
const SizedBox(height: 8),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8.0),
|
||||
child: Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: Text(
|
||||
'موجودی انبار',
|
||||
style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
),
|
||||
),
|
||||
ObxValue((data) {
|
||||
if (data.value == null) {
|
||||
return Container(
|
||||
height: 80,
|
||||
margin: const EdgeInsets.all(8),
|
||||
padding: const EdgeInsets.all(12),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(color: AppColor.blueNormal, width: 1),
|
||||
),
|
||||
child: Center(child: CircularProgressIndicator()),
|
||||
);
|
||||
} else if (data.value?.results.isEmpty ?? true) {
|
||||
return Container(
|
||||
height: 80,
|
||||
margin: const EdgeInsets.all(8),
|
||||
padding: const EdgeInsets.all(12),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(color: AppColor.blueNormal, width: 1),
|
||||
),
|
||||
child: Center(child: Text('هیچ ورودی در انتظار نیست')),
|
||||
);
|
||||
} else {
|
||||
return Container(
|
||||
margin: const EdgeInsets.symmetric(vertical: 2),
|
||||
height: 700,
|
||||
padding: const EdgeInsets.all(6),
|
||||
child:
|
||||
ListView.separated(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
itemCount: data.value?.results.length ?? 0,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
final result = data.value!.results[index];
|
||||
return Card(
|
||||
margin: const EdgeInsets.symmetric(vertical: 4.0),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
side: const BorderSide(
|
||||
color: AppColor.blueNormal,
|
||||
width: 1,
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
buildRow('ردیف', '${index + 1}'),
|
||||
buildRow(
|
||||
'تاریخ ثبت',
|
||||
result.date!.formattedJalaliDate ?? 'N/A',
|
||||
),
|
||||
buildRow(
|
||||
'نوع تخصیص',
|
||||
result.allocationType?.faAllocationType ?? 'N/A',
|
||||
),
|
||||
buildRow(
|
||||
'مشخصات خریدار',
|
||||
result.toSteward?.user?.fullname ?? 'N/A',
|
||||
),
|
||||
buildRow(
|
||||
'مشخصات فروشنده',
|
||||
result.killHouse?.name ?? 'N/A',
|
||||
),
|
||||
buildRow(
|
||||
'نوع فروش',
|
||||
result.sellType?.faItem ?? 'N/A',
|
||||
),
|
||||
buildRow(
|
||||
'قیمت هر کیلو',
|
||||
'${result.amount ?? 0} تومان',
|
||||
),
|
||||
buildRow(
|
||||
'قیمت کل',
|
||||
'${result.totalAmount ?? 0} تومان',
|
||||
),
|
||||
buildRow(
|
||||
'وزن تخصیصی',
|
||||
'${result.weightOfCarcasses?.toInt() ?? 0} کیلوگرم',
|
||||
),
|
||||
buildRow('وضعیت', result.state?.faItem ?? 'N/A'),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
child: RElevated(
|
||||
text: 'تایید',
|
||||
onPressed: () {
|
||||
Get.bottomSheet(acceptBottomSheet(result));
|
||||
},
|
||||
height: 40,
|
||||
),
|
||||
),
|
||||
SizedBox(width: 20),
|
||||
Expanded(
|
||||
child: RElevated(
|
||||
text: 'رد',
|
||||
onPressed: () {
|
||||
controller.denyEntried(result.key!);
|
||||
Get.back();
|
||||
},
|
||||
backgroundColor: AppColor.error,
|
||||
height: 40,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
separatorBuilder: (BuildContext context, int index) =>
|
||||
SizedBox(height: 8),
|
||||
),
|
||||
|
||||
);
|
||||
}
|
||||
}, controller.waitingForArrival)
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
Widget importedLoads() {
|
||||
return Column(
|
||||
children: [
|
||||
const SizedBox(height: 8),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8.0),
|
||||
child: Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: Text(
|
||||
'بارهای وارد شده',
|
||||
style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
),
|
||||
),
|
||||
ObxValue((data) {
|
||||
if (data.value == null) {
|
||||
return Container(
|
||||
height: 80,
|
||||
margin: const EdgeInsets.all(8),
|
||||
padding: const EdgeInsets.all(12),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(color: AppColor.blueNormal, width: 1),
|
||||
),
|
||||
child: Center(child: CircularProgressIndicator()),
|
||||
);
|
||||
}
|
||||
else if (data.value?.results?.isEmpty ?? true) {
|
||||
return Container(
|
||||
height: 80,
|
||||
margin: const EdgeInsets.all(8),
|
||||
padding: const EdgeInsets.all(12),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(color: AppColor.blueNormal, width: 1),
|
||||
),
|
||||
child: Center(child: Text( 'هیچ بار وارد شدهای وجود ندارد')),
|
||||
);
|
||||
} else {
|
||||
return Container(
|
||||
margin: const EdgeInsets.symmetric(vertical: 2),
|
||||
height: 700,
|
||||
padding: const EdgeInsets.all(6),
|
||||
child:
|
||||
ListView.separated(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
itemCount: data.value?.results?.length ?? 0,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
final result = data.value!.results![index];
|
||||
return Card(
|
||||
margin: const EdgeInsets.symmetric(vertical: 4.0),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
side: const BorderSide(
|
||||
color: AppColor.blueNormal,
|
||||
width: 1,
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
buildRow('ردیف', '${index + 1}'),
|
||||
buildRow(
|
||||
'تاریخ ثبت',
|
||||
result.date!.formattedJalaliDate ?? 'N/A',
|
||||
),
|
||||
buildRow(
|
||||
'نوع تخصیص',
|
||||
result.allocationType?.faAllocationType ?? 'N/A',
|
||||
),
|
||||
buildRow(
|
||||
'مشخصات خریدار',
|
||||
'${result.toSteward?.user?.fullname} - ${result.toSteward?.guildsName}' ?? 'N/A',
|
||||
),
|
||||
buildRow(
|
||||
'مشخصات فروشنده',
|
||||
result.killHouse?.name ?? 'N/A',
|
||||
),
|
||||
buildRow(
|
||||
'نوع فروش',
|
||||
result.sellType?.faItem ?? 'N/A',
|
||||
),
|
||||
buildRow(
|
||||
'قیمت هر کیلو',
|
||||
'${result.amount ?? 0} ریال ',
|
||||
),
|
||||
buildRow(
|
||||
'قیمت کل',
|
||||
'${result.totalAmount ?? 0} ریال',
|
||||
),
|
||||
buildRow(
|
||||
'وزن تخصیصی',
|
||||
'${result.weightOfCarcasses?.toInt() ?? 0} کیلوگرم',
|
||||
),
|
||||
buildRow('کداحراز', result.registrationCode?.toString() ?? 'N/A'),
|
||||
buildRow('وضعیت کد احراز', result.systemRegistrationCode == true ?"ارسال شده":"ارسال نشده" ?? 'N/A'),
|
||||
buildRow('افت وزن(کیلوگرم)', result.weightLossOfCarcasses?.toInt().toString() ?? 'N/A'),
|
||||
buildRow('وضعیت', result.receiverState?.faItem ?? 'N/A'),
|
||||
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
separatorBuilder: (BuildContext context, int index) =>
|
||||
SizedBox(height: 8),
|
||||
),
|
||||
|
||||
);
|
||||
}
|
||||
}, controller.importedLoads)
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Widget acceptBottomSheet(ResultModel resultModel) {
|
||||
return BaseBottomSheet(
|
||||
height: 500,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
spacing: 8,
|
||||
children: [
|
||||
RTextField(
|
||||
controller: controller.weightController,
|
||||
initText: resultModel.realWeightOfCarcasses?.toInt().toString(),
|
||||
label: 'ورزن',
|
||||
keyboardType: TextInputType.number,
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
RTextField(
|
||||
controller: controller.volumeController,
|
||||
label: 'حجم',
|
||||
keyboardType: TextInputType.number,
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
RTextField(
|
||||
controller: controller.weightLossController,
|
||||
label: 'افت وزن(کیلوگرم)',
|
||||
keyboardType: TextInputType.number,
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
|
||||
SizedBox(
|
||||
height: 40,
|
||||
child: ObxValue((data) {
|
||||
return Row(
|
||||
children: [
|
||||
Radio(
|
||||
value: 1,
|
||||
groupValue: controller.acceptType.value,
|
||||
onChanged: (value) {
|
||||
controller.acceptType.value = value!;
|
||||
},
|
||||
),
|
||||
Text('با کد احراز', style: AppFonts.yekan14),
|
||||
|
||||
SizedBox(width: 12),
|
||||
Radio(
|
||||
value: 2,
|
||||
groupValue: controller.acceptType.value,
|
||||
onChanged: (value) {
|
||||
controller.acceptType.value = value!;
|
||||
},
|
||||
),
|
||||
Text('با کد احراز', style: AppFonts.yekan14),
|
||||
],
|
||||
);
|
||||
}, controller.acceptType),
|
||||
),
|
||||
|
||||
const SizedBox(height: 8),
|
||||
ObxValue(
|
||||
(data) => Visibility(
|
||||
visible: data.value == 1,
|
||||
child: RTextField(
|
||||
controller: controller.authenticationCodeController,
|
||||
label: 'کد احراز',
|
||||
keyboardType: TextInputType.number,
|
||||
),
|
||||
),
|
||||
controller.acceptType,
|
||||
),
|
||||
|
||||
RElevated(
|
||||
text: 'تایید',
|
||||
onPressed: () {
|
||||
controller.acceptEntried(resultModel.key!);
|
||||
Get.back();
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,33 +1,115 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/material.dart' show Text, EdgeInsets, Colors;
|
||||
import 'package:rasadyar_auth/data/models/local/user_local/user_local_model.dart';
|
||||
import 'package:rasadyar_auth/data/services/token_storage_service.dart';
|
||||
import 'package:rasadyar_auth/data/utils/safe_call.dart';
|
||||
import 'package:rasadyar_auth/presentation/routes/pages.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/inventory/inventory_model.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/kill_house_distribution_info/kill_house_distribution_info.dart';
|
||||
import 'package:rasadyar_chicken/data/repositories/chicken_repository.dart';
|
||||
import 'package:rasadyar_chicken/data/repositories/chicken_repository_imp.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
|
||||
enum ErrorLocationType { serviceDisabled, permissionDenied, none }
|
||||
|
||||
class RootLogic extends GetxController {
|
||||
RxInt currentIndex = 0.obs;
|
||||
List<Widget> pages = [
|
||||
Container(color: Colors.deepOrange,),
|
||||
Container(color: Colors.amberAccent,),
|
||||
Container(color: Colors.black,),
|
||||
];
|
||||
RxList<ErrorLocationType> errorLocationType = RxList();
|
||||
RxMap<int, dynamic> inventoryExpandedList = RxMap();
|
||||
var tokenService = Get.find<TokenStorageService>();
|
||||
late ChickenRepository chickenRepository;
|
||||
late DioRemote dioRemote;
|
||||
RxInt count = 5.obs;
|
||||
|
||||
|
||||
RxList<InventoryModel> inventoryList = RxList();
|
||||
Rxn<KillHouseDistributionInfo> killHouseDistributionInfo =
|
||||
Rxn<KillHouseDistributionInfo>();
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
super.onReady();
|
||||
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
dioRemote = DioRemote(baseUrl: tokenService.baseurl.value);
|
||||
dioRemote.init();
|
||||
chickenRepository = ChickenRepositoryImpl(dioRemote);
|
||||
getInventory();
|
||||
getKillHouseDistributionInfo();
|
||||
}
|
||||
|
||||
void changePage(int index) {
|
||||
currentIndex.value = index;
|
||||
|
||||
void toggleExpanded(int index) {
|
||||
if (inventoryExpandedList.keys.contains(index)) {
|
||||
inventoryExpandedList.remove(index);
|
||||
} else {
|
||||
inventoryExpandedList[index] = false;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
// TODO: implement onClose
|
||||
super.onClose();
|
||||
Future<void> getInventory() async {
|
||||
await safeCall<List<InventoryModel>?>(
|
||||
call: () async => await chickenRepository.getInventory(
|
||||
token: tokenService.accessToken.value!,
|
||||
),
|
||||
onSuccess: (result) {
|
||||
if (result != null) {
|
||||
iLog(result);
|
||||
inventoryList.clear();
|
||||
inventoryList.addAll(result);
|
||||
iLog(inventoryList);
|
||||
}
|
||||
},
|
||||
onError: (error, stackTrace) {
|
||||
switch (error.response?.statusCode) {
|
||||
case 401:
|
||||
_handleGeneric(error);
|
||||
break;
|
||||
case 403:
|
||||
_handleGeneric(error);
|
||||
break;
|
||||
default:
|
||||
_handleGeneric(error);
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> getKillHouseDistributionInfo() async {
|
||||
await safeCall<KillHouseDistributionInfo?>(
|
||||
call: () async => await chickenRepository.getIKillHouseDistributionInfo(
|
||||
token: tokenService.accessToken.value!,
|
||||
),
|
||||
onSuccess: (result) {
|
||||
if (result != null) {
|
||||
iLog(result);
|
||||
killHouseDistributionInfo.value = result;
|
||||
iLog(killHouseDistributionInfo.value);
|
||||
}
|
||||
},
|
||||
onError: (error, stackTrace) {},
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
void _handleGeneric(DioException error) {
|
||||
Get.showSnackbar(
|
||||
_errorSnackBar('اعتبار توکن شما منقضی شده است لطفا دوباره وارد شوید'
|
||||
),
|
||||
);
|
||||
tokenService.deleteTokens();
|
||||
Get.offAllNamed(AuthPaths.auth, arguments: Module.chicken );
|
||||
}
|
||||
GetSnackBar _errorSnackBar(String message) {
|
||||
return GetSnackBar(
|
||||
titleText: Text(
|
||||
'خطا',
|
||||
style: AppFonts.yekan14.copyWith(color: Colors.white),
|
||||
),
|
||||
messageText: Text(
|
||||
message,
|
||||
style: AppFonts.yekan12.copyWith(color: Colors.white),
|
||||
),
|
||||
backgroundColor: AppColor.error,
|
||||
margin: EdgeInsets.symmetric(horizontal: 12, vertical: 8),
|
||||
borderRadius: 12,
|
||||
duration: Duration(milliseconds: 3500),
|
||||
snackPosition: SnackPosition.TOP,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,82 +1,455 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_chicken/chicken.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/inventory/inventory_model.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/kill_house_distribution_info/kill_house_distribution_info.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
import 'logic.dart';
|
||||
|
||||
class RootPage extends GetView<RootLogic> {
|
||||
const RootPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: Stack(
|
||||
children: [
|
||||
ObxValue(
|
||||
(currentIndex) => IndexedStack(
|
||||
index: currentIndex.value,
|
||||
children: controller.pages,
|
||||
appBar: RAppBar(title: 'مدیریت انبار', centerTitle: true, hasBack: false),
|
||||
body: SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
inventoryWidget(),
|
||||
ObxValue(
|
||||
(data) => broadcastInformationWidget(data.value),
|
||||
controller.killHouseDistributionInfo,
|
||||
),
|
||||
controller.currentIndex,
|
||||
),
|
||||
|
||||
],
|
||||
),
|
||||
bottomNavigationBar: WaveBottomNavigation(
|
||||
items: [
|
||||
WaveBottomNavigationItem(title: 'خانه', icon: Assets.vec.mapSvg.svg(
|
||||
width: 32,
|
||||
height: 32,
|
||||
colorFilter: ColorFilter.mode(Colors.white, BlendMode.srcIn),
|
||||
)),
|
||||
WaveBottomNavigationItem(
|
||||
title: 'عملیات',
|
||||
icon: Assets.vec.userSvg.svg(
|
||||
width: 32,
|
||||
height: 32,
|
||||
colorFilter: ColorFilter.mode(Colors.white, BlendMode.srcIn),
|
||||
SizedBox(height: 20),
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
cardWidget(
|
||||
title: 'ورود به انبار',
|
||||
iconPath: Assets.icons.whareHouse.path,
|
||||
onTap: () {
|
||||
Get.toNamed(ChickenRoutes.enteringTheWarehouse);
|
||||
},
|
||||
),
|
||||
cardWidget(
|
||||
title: 'فروش داخل استان',
|
||||
iconPath: Assets.icons.inside.path,
|
||||
onTap: () {
|
||||
Get.toNamed(ChickenRoutes.salesWithinProvince);
|
||||
},
|
||||
),
|
||||
cardWidget(
|
||||
title: 'فروش خارج استان',
|
||||
iconPath: Assets.icons.outside.path,
|
||||
onTap: () {},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
WaveBottomNavigationItem(
|
||||
title: 'افزودن',
|
||||
icon: Assets.vec.addSvg.svg(
|
||||
width: 32,
|
||||
height: 32,
|
||||
colorFilter: ColorFilter.mode(Colors.white, BlendMode.srcIn),
|
||||
),
|
||||
),
|
||||
WaveBottomNavigationItem(
|
||||
title: 'آمار',
|
||||
icon: Assets.vec.diagramSvg.svg(width: 32,height: 32,colorFilter: ColorFilter.mode(Colors.white, BlendMode.srcIn),),
|
||||
),
|
||||
WaveBottomNavigationItem(
|
||||
title: 'تماس',
|
||||
icon: Assets.vec.callSvg.svg(
|
||||
width: 32,
|
||||
height: 32,
|
||||
colorFilter: ColorFilter.mode(Colors.white, BlendMode.srcIn),
|
||||
),
|
||||
),
|
||||
WaveBottomNavigationItem(
|
||||
title: 'مکان ',
|
||||
icon: Assets.vec.gpsSvg.svg(
|
||||
width: 32,
|
||||
height: 32,
|
||||
colorFilter: ColorFilter.mode(Colors.white, BlendMode.srcIn),
|
||||
),
|
||||
),
|
||||
WaveBottomNavigationItem(
|
||||
title: 'تاریخ',
|
||||
icon: Assets.vec.calendarSvg.svg(
|
||||
width: 32,
|
||||
height: 32,
|
||||
colorFilter: ColorFilter.mode(Colors.white, BlendMode.srcIn),
|
||||
),
|
||||
),
|
||||
],
|
||||
onPageChanged: (index) {
|
||||
controller.changePage(index);
|
||||
},
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget inventoryWidget() {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8.0),
|
||||
child: Column(
|
||||
children: [
|
||||
const SizedBox(height: 20),
|
||||
Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: Text(
|
||||
'موجودی انبار',
|
||||
style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 4),
|
||||
ObxValue(
|
||||
(data) => data.isEmpty
|
||||
? Container(
|
||||
margin: const EdgeInsets.symmetric(vertical: 2),
|
||||
height: 80,
|
||||
padding: EdgeInsets.all(6),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(color: AppColor.blueNormal, width: 1),
|
||||
),
|
||||
child: Center(child: CircularProgressIndicator()),
|
||||
)
|
||||
: ListView.separated(
|
||||
shrinkWrap: true,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
itemCount: controller.inventoryList.length,
|
||||
separatorBuilder: (context, index) =>
|
||||
const SizedBox(height: 8),
|
||||
itemBuilder: (context, index) {
|
||||
return ObxValue((expand) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
controller.toggleExpanded(index);
|
||||
},
|
||||
behavior: HitTestBehavior.opaque,
|
||||
child: AnimatedContainer(
|
||||
onEnd: () {
|
||||
controller.inventoryExpandedList[index] =
|
||||
!controller.inventoryExpandedList[index]!;
|
||||
},
|
||||
margin: const EdgeInsets.symmetric(vertical: 2),
|
||||
padding: EdgeInsets.all(6),
|
||||
curve: Curves.easeInOut,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(
|
||||
color: AppColor.blueNormal,
|
||||
width: 1,
|
||||
),
|
||||
),
|
||||
duration: const Duration(seconds: 1),
|
||||
height: expand.keys.contains(index) ? 250 : 80,
|
||||
child: inventoryItem(
|
||||
isExpanded:
|
||||
expand.keys.contains(index) && expand[index]!,
|
||||
index: index,
|
||||
model: controller.inventoryList[index],
|
||||
),
|
||||
),
|
||||
);
|
||||
}, controller.inventoryExpandedList);
|
||||
},
|
||||
),
|
||||
controller.inventoryList,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget inventoryItem({
|
||||
required bool isExpanded,
|
||||
required int index,
|
||||
required InventoryModel model,
|
||||
}) {
|
||||
return Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
spacing: 8,
|
||||
children: [
|
||||
buildRow('نام محصول', model.name ?? ''),
|
||||
Visibility(
|
||||
visible: isExpanded,
|
||||
child: Column(
|
||||
spacing: 8,
|
||||
children: [
|
||||
buildRow('وزن خریدهای دولتی داخل استان (کیلوگرم)', '0326598653'),
|
||||
buildRow(
|
||||
'وزن خریدهای آزاد داخل استان (کیلوگرم)',
|
||||
model.receiveFreeCarcassesWeight.toString(),
|
||||
),
|
||||
buildRow(
|
||||
'وزن خریدهای خارج استان (کیلوگرم)',
|
||||
model.freeBuyingCarcassesWeight.toString(),
|
||||
),
|
||||
buildRow(
|
||||
'کل ورودی به انبار (کیلوگرم)',
|
||||
model.totalFreeBarsCarcassesWeight.toString(),
|
||||
),
|
||||
buildRow(
|
||||
'کل فروش (کیلوگرم)',
|
||||
model.realAllocatedWeight.toString(),
|
||||
),
|
||||
buildRow(
|
||||
'مانده انبار (کیلوگرم)',
|
||||
model.totalRemainWeight.toString(),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget buildRow(String title, String value) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 4.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Flexible(
|
||||
flex: 2,
|
||||
child: Text(
|
||||
title,
|
||||
textAlign: TextAlign.right,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
),
|
||||
Flexible(
|
||||
flex: 1,
|
||||
child: Text(
|
||||
value,
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget broadcastInformationWidget(KillHouseDistributionInfo? model) {
|
||||
return Container(
|
||||
height: 140,
|
||||
margin: const EdgeInsets.all(8),
|
||||
padding: const EdgeInsets.all(12),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(color: AppColor.blueNormal, width: 1),
|
||||
),
|
||||
child: model != null
|
||||
? Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
spacing: 10,
|
||||
children: [
|
||||
Text(
|
||||
'اطلاعات ارسالی',
|
||||
textAlign: TextAlign.right,
|
||||
style: AppFonts.yekan16Bold.copyWith(
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
buildRow(
|
||||
'فروش و توزیع داخل استان (کیلوگرم)',
|
||||
model.stewardAllocationsWeight!.toInt().toString(),
|
||||
),
|
||||
buildRow(
|
||||
'فروش و توزیع خارج استان (کیلوگرم)',
|
||||
model.freeSalesWeight!.toInt().toString(),
|
||||
),
|
||||
],
|
||||
)
|
||||
: const Center(child: CircularProgressIndicator()),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Widget expandedContainer(bool isExpanded, VoidCallback onTap) {
|
||||
return AnimatedContainer(
|
||||
margin: EdgeInsets.symmetric(horizontal: 30, vertical: 10),
|
||||
curve: Curves.easeInOut,
|
||||
duration: Duration(seconds: 1),
|
||||
height: isExpanded ? 364 : 80,
|
||||
child: markerDetailsWidget(ontap: onTap),
|
||||
);
|
||||
}
|
||||
|
||||
Widget markerDetailsWidget({required VoidCallback ontap}) {
|
||||
return GestureDetector(
|
||||
onTap: ontap,
|
||||
behavior: HitTestBehavior.opaque,
|
||||
child: Container(
|
||||
clipBehavior: Clip.antiAlias,
|
||||
|
||||
padding: EdgeInsets.symmetric(horizontal: 0, vertical: 10),
|
||||
decoration: ShapeDecoration(
|
||||
color: Colors.white,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
|
||||
),
|
||||
child: Column(
|
||||
spacing: 15,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
spacing: 12,
|
||||
children: [
|
||||
vecWidgetWithOnTap(
|
||||
child: Assets.vec.editSvg.svg(),
|
||||
onTap: () {},
|
||||
width: 24,
|
||||
height: 24,
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
Text(
|
||||
'سوابق بازرسی من',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
vecWidgetWithOnTap(
|
||||
child: Assets.vec.trashSvg.svg(),
|
||||
width: 24,
|
||||
height: 24,
|
||||
color: AppColor.redNormal,
|
||||
onTap: () {},
|
||||
),
|
||||
],
|
||||
),
|
||||
Container(
|
||||
height: 32,
|
||||
clipBehavior: Clip.antiAlias,
|
||||
padding: EdgeInsets.symmetric(horizontal: 10, vertical: 4),
|
||||
decoration: ShapeDecoration(
|
||||
color: AppColor.blueLight,
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(width: 1, color: AppColor.blueLightHover),
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'تاریخ بازرسی',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'1403/12/12',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
'شماره همراه',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'0326598653',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
|
||||
children: [
|
||||
Text(
|
||||
'آخرین فعالیت',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
|
||||
Text(
|
||||
'1409/12/12',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
|
||||
children: [
|
||||
Text(
|
||||
'موجودی',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'5کیلوگرم',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
...List.generate(
|
||||
5,
|
||||
(index) => Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
|
||||
children: [
|
||||
Text(
|
||||
'فروش رفته',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'0 کیلوگرم',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget cardWidget({
|
||||
required String title,
|
||||
required String iconPath,
|
||||
required VoidCallback onTap,
|
||||
}) {
|
||||
return Container(
|
||||
width: Get.width / 4,
|
||||
height: 130,
|
||||
child: GestureDetector(
|
||||
onTap: onTap,
|
||||
child: Card(
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
side: BorderSide(width: 1, color: AppColor.blueNormal),
|
||||
),
|
||||
child: Padding(
|
||||
padding: EdgeInsets.all(16),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
SvgGenImage(iconPath).svg(width: 50, height: 50),
|
||||
SizedBox(height: 4),
|
||||
Text(
|
||||
title,
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,213 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_auth/data/utils/safe_call.dart';
|
||||
import 'package:rasadyar_chicken/data/models/request/conform_allocation/conform_allocation.dart';
|
||||
import 'package:rasadyar_chicken/data/models/request/submit_steward_allocation/submit_steward_allocation.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/allocated_made/allocated_made.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/guild/guild_model.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/guild_profile/guild_profile.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/roles_products/roles_products.dart';
|
||||
import 'package:rasadyar_chicken/presentation/pages/root/logic.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
class SalesWithinProvinceLogic extends GetxController {
|
||||
var rootLogic = Get.find<RootLogic>();
|
||||
Rxn<AllocatedMadeModel> allocatedMadeModel = Rxn<AllocatedMadeModel>();
|
||||
RxList<ProductModel> rolesProductsModel = RxList<ProductModel>();
|
||||
|
||||
RxList<GuildModel> guildsModel = <GuildModel>[].obs;
|
||||
|
||||
Rxn<ProductModel> selectedProductModel = Rxn<ProductModel>();
|
||||
Rxn<GuildModel> selectedGuildModel = Rxn<GuildModel>();
|
||||
Rxn<GuildProfile> guildProfile = Rxn<GuildProfile>();
|
||||
RxInt saleType = 1.obs;
|
||||
RxInt weight = 0.obs;
|
||||
RxInt pricePerKilo = 0.obs;
|
||||
RxInt totalCost = 0.obs;
|
||||
RxBool isValid = false.obs;
|
||||
final weightController = TextEditingController();
|
||||
final pricePerKiloController = TextEditingController();
|
||||
final totalCostController = TextEditingController();
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
rootLogic.getInventory();
|
||||
getAllocatedMade();
|
||||
getRolesProducts();
|
||||
getGuilds();
|
||||
getGuildProfile();
|
||||
ever(saleType, (callback) {
|
||||
getGuilds();
|
||||
});
|
||||
|
||||
weight.listen((num) {
|
||||
totalCost.value = num * pricePerKilo.value;
|
||||
});
|
||||
|
||||
pricePerKilo.listen((num) {
|
||||
totalCost.value = num * weight.value;
|
||||
});
|
||||
|
||||
totalCost.listen((data) {
|
||||
totalCostController.text = data.toString();
|
||||
|
||||
isValid.value =
|
||||
weight.value > 0 &&
|
||||
pricePerKilo.value > 0 &&
|
||||
totalCost.value > 0 &&
|
||||
selectedProductModel.value != null &&
|
||||
selectedGuildModel.value != null;
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> getAllocatedMade() async {
|
||||
safeCall(
|
||||
call: () async => await rootLogic.chickenRepository.getAllocatedMade(
|
||||
token: rootLogic.tokenService.accessToken.value!,
|
||||
page: 1,
|
||||
),
|
||||
onSuccess: (result) {
|
||||
if (result != null) {
|
||||
allocatedMadeModel.value = result;
|
||||
}
|
||||
},
|
||||
onError: (error, stacktrace) {},
|
||||
);
|
||||
}
|
||||
|
||||
void checkVerfication() {
|
||||
isValid.value =
|
||||
weight.value > 0 &&
|
||||
pricePerKilo.value > 0 &&
|
||||
totalCost.value > 0 &&
|
||||
selectedProductModel.value != null &&
|
||||
selectedGuildModel.value != null;
|
||||
}
|
||||
|
||||
void confirmAllocation(ConformAllocation allocation) {
|
||||
safeCall(
|
||||
call: () async => await rootLogic.chickenRepository.confirmAllocation(
|
||||
token: rootLogic.tokenService.accessToken.value!,
|
||||
allocation: allocation.toJson(),
|
||||
),
|
||||
onSuccess: (result) {
|
||||
getAllocatedMade();
|
||||
},
|
||||
onError: (error, stacktrace) {},
|
||||
);
|
||||
}
|
||||
|
||||
void denyAllocation(String token) {
|
||||
safeCall(
|
||||
call: () async => await rootLogic.chickenRepository.denyAllocation(
|
||||
token: rootLogic.tokenService.accessToken.value!,
|
||||
allocationToken: token,
|
||||
),
|
||||
onSuccess: (result) {
|
||||
getAllocatedMade();
|
||||
},
|
||||
onError: (error, stacktrace) {},
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> confirmAllAllocations() async {
|
||||
safeCall(
|
||||
call: () async => await rootLogic.chickenRepository.confirmAllAllocation(
|
||||
token: rootLogic.tokenService.accessToken.value!,
|
||||
allocationTokens:
|
||||
allocatedMadeModel.value?.results?.map((e) => e.key!).toList() ??
|
||||
[],
|
||||
),
|
||||
onSuccess: (result) {
|
||||
getAllocatedMade();
|
||||
},
|
||||
onError: (error, stacktrace) {},
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> getRolesProducts() async {
|
||||
safeCall(
|
||||
call: () async => await rootLogic.chickenRepository.getRolesProducts(
|
||||
token: rootLogic.tokenService.accessToken.value!,
|
||||
),
|
||||
onSuccess: (result) {
|
||||
if (result != null) {
|
||||
rolesProductsModel.value = result;
|
||||
}
|
||||
},
|
||||
onError: (error, stacktrace) {},
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> getGuilds() async {
|
||||
safeCall(
|
||||
call: () async => await rootLogic.chickenRepository.getGuilds(
|
||||
token: rootLogic.tokenService.accessToken.value!,
|
||||
isFree: saleType.value == 2 ? true : false,
|
||||
),
|
||||
onSuccess: (result) {
|
||||
if (result != null) {
|
||||
guildsModel.clear();
|
||||
guildsModel.addAll(result);
|
||||
}
|
||||
},
|
||||
onError: (error, stacktrace) {},
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> addSale() async {}
|
||||
|
||||
void setSelectedGuild(GuildModel value) {
|
||||
selectedGuildModel.value = value;
|
||||
update();
|
||||
}
|
||||
|
||||
void setSelectedProduct(ProductModel value) {
|
||||
selectedProductModel.value = value;
|
||||
update();
|
||||
}
|
||||
|
||||
Future<void> getGuildProfile() async {
|
||||
await safeCall(
|
||||
call: () async => await rootLogic.chickenRepository.getProfile(
|
||||
token: rootLogic.tokenService.accessToken.value!,
|
||||
),
|
||||
onError: (error, stackTrace) {},
|
||||
onSuccess: (result) {
|
||||
guildProfile.value = result;
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> submitAllocation() async {
|
||||
SubmitStewardAllocation stewardAllocation = SubmitStewardAllocation(
|
||||
approvedPriceStatus: false,
|
||||
allocationType:
|
||||
'${guildProfile.value?.steward == true ? "steward" : "guild"}-${selectedGuildModel.value?.steward == true ? "steward" : "guild"}',
|
||||
sellerType: guildProfile.value?.steward == true ? "Steward" : "Guild",
|
||||
buyerType: selectedGuildModel.value?.steward == true
|
||||
? "Steward"
|
||||
: "Guild",
|
||||
amount: pricePerKilo.value,
|
||||
totalAmount: totalCost.value,
|
||||
weightOfCarcasses: weight.value,
|
||||
guildKey: selectedGuildModel.value?.key,
|
||||
productKey: selectedProductModel.value?.key,
|
||||
date: DateTime.now().formattedGregorianDate,
|
||||
type: "manual",
|
||||
);
|
||||
|
||||
safeCall(
|
||||
call: () async =>
|
||||
await rootLogic.chickenRepository.postSubmitStewardAllocation(
|
||||
token: rootLogic.tokenService.accessToken.value!,
|
||||
request: stewardAllocation,
|
||||
),
|
||||
|
||||
onSuccess: (result) {
|
||||
getAllocatedMade();
|
||||
},
|
||||
onError: (error, stackTrace) {},
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,574 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_chicken/data/models/request/conform_allocation/conform_allocation.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/guild/guild_model.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/inventory/inventory_model.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/roles_products/roles_products.dart';
|
||||
import 'package:rasadyar_chicken/presentation/pages/entering_the_warehouse/string_utils.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
import 'logic.dart';
|
||||
|
||||
class SalesWithinProvincePage extends GetView<SalesWithinProvinceLogic> {
|
||||
SalesWithinProvincePage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: RAppBar(title: 'فروش در استان'),
|
||||
body: SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
inventoryWidget(),
|
||||
allocationsMade(),
|
||||
SizedBox(height: 20),
|
||||
RElevated(
|
||||
text: 'ثبت توزیع/ فروش',
|
||||
onPressed: () {
|
||||
showAddBottomSheet();
|
||||
},
|
||||
),
|
||||
SizedBox(height: 40),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget inventoryWidget() {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8.0),
|
||||
child: Column(
|
||||
children: [
|
||||
const SizedBox(height: 20),
|
||||
Align(
|
||||
alignment: Alignment.centerRight,
|
||||
child: Text(
|
||||
'موجودی انبار',
|
||||
style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 4),
|
||||
ObxValue(
|
||||
(data) => data.isEmpty
|
||||
? Container(
|
||||
margin: const EdgeInsets.symmetric(vertical: 2),
|
||||
height: 80,
|
||||
padding: EdgeInsets.all(6),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(color: AppColor.blueNormal, width: 1),
|
||||
),
|
||||
child: Center(child: CircularProgressIndicator()),
|
||||
)
|
||||
: ListView.separated(
|
||||
shrinkWrap: true,
|
||||
physics: const NeverScrollableScrollPhysics(),
|
||||
itemCount: controller.rootLogic.inventoryList.length,
|
||||
separatorBuilder: (context, index) =>
|
||||
const SizedBox(height: 8),
|
||||
itemBuilder: (context, index) {
|
||||
return ObxValue((expand) {
|
||||
return GestureDetector(
|
||||
onTap: () {
|
||||
controller.rootLogic.toggleExpanded(index);
|
||||
},
|
||||
behavior: HitTestBehavior.opaque,
|
||||
child: AnimatedContainer(
|
||||
onEnd: () {
|
||||
controller
|
||||
.rootLogic
|
||||
.inventoryExpandedList[index] = !controller
|
||||
.rootLogic
|
||||
.inventoryExpandedList[index]!;
|
||||
},
|
||||
margin: const EdgeInsets.symmetric(vertical: 2),
|
||||
padding: EdgeInsets.all(6),
|
||||
curve: Curves.easeInOut,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(
|
||||
color: AppColor.blueNormal,
|
||||
width: 1,
|
||||
),
|
||||
),
|
||||
duration: const Duration(seconds: 1),
|
||||
height: expand.keys.contains(index) ? 250 : 80,
|
||||
child: inventoryItem(
|
||||
isExpanded:
|
||||
expand.keys.contains(index) && expand[index]!,
|
||||
index: index,
|
||||
model: controller.rootLogic.inventoryList[index],
|
||||
),
|
||||
),
|
||||
);
|
||||
}, controller.rootLogic.inventoryExpandedList);
|
||||
},
|
||||
),
|
||||
controller.rootLogic.inventoryList,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget inventoryItem({
|
||||
required bool isExpanded,
|
||||
required int index,
|
||||
required InventoryModel model,
|
||||
}) {
|
||||
return Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
spacing: 8,
|
||||
children: [
|
||||
buildRow('نام محصول', model.name ?? ''),
|
||||
Visibility(
|
||||
visible: isExpanded,
|
||||
child: Column(
|
||||
spacing: 8,
|
||||
children: [
|
||||
buildRow('وزن خریدهای دولتی داخل استان (کیلوگرم)', '0326598653'),
|
||||
buildRow(
|
||||
'وزن خریدهای آزاد داخل استان (کیلوگرم)',
|
||||
model.receiveFreeCarcassesWeight.toString(),
|
||||
),
|
||||
buildRow(
|
||||
'وزن خریدهای خارج استان (کیلوگرم)',
|
||||
model.freeBuyingCarcassesWeight.toString(),
|
||||
),
|
||||
buildRow(
|
||||
'کل ورودی به انبار (کیلوگرم)',
|
||||
model.totalFreeBarsCarcassesWeight.toString(),
|
||||
),
|
||||
buildRow(
|
||||
'کل فروش (کیلوگرم)',
|
||||
model.realAllocatedWeight.toString(),
|
||||
),
|
||||
buildRow(
|
||||
'مانده انبار (کیلوگرم)',
|
||||
model.totalRemainWeight.toString(),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget buildRow(String title, String value) {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(vertical: 4.0),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Flexible(
|
||||
flex: 2,
|
||||
child: Text(
|
||||
title,
|
||||
textAlign: TextAlign.right,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
),
|
||||
Flexible(
|
||||
flex: 2,
|
||||
child: Text(
|
||||
value,
|
||||
textAlign: TextAlign.left,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget allocationsMade() {
|
||||
return Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8.0),
|
||||
child: Column(
|
||||
children: [
|
||||
const SizedBox(height: 20),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'تخصیصات صورت گرفته',
|
||||
style: AppFonts.yekan16Bold.copyWith(
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
),
|
||||
RElevated(
|
||||
text: 'تایید یکجا',
|
||||
height: 30,
|
||||
onPressed: () {
|
||||
controller.confirmAllAllocations();
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 4),
|
||||
ObxValue((data) {
|
||||
if (data.value == null) {
|
||||
return Container(
|
||||
height: 80,
|
||||
margin: const EdgeInsets.all(8),
|
||||
padding: const EdgeInsets.all(12),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(color: AppColor.blueNormal, width: 1),
|
||||
),
|
||||
child: Center(child: CircularProgressIndicator()),
|
||||
);
|
||||
} else if (data.value?.results?.isEmpty ?? true) {
|
||||
return Container(
|
||||
height: 80,
|
||||
margin: const EdgeInsets.all(8),
|
||||
padding: const EdgeInsets.all(12),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(color: AppColor.blueNormal, width: 1),
|
||||
),
|
||||
child: Center(child: Text('هیچ تخصیصات صورت نگرفته است ')),
|
||||
);
|
||||
} else {
|
||||
return Container(
|
||||
margin: const EdgeInsets.symmetric(vertical: 2),
|
||||
height: 700,
|
||||
padding: const EdgeInsets.all(6),
|
||||
child: ListView.separated(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
itemCount: data.value?.results?.length ?? 0,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
final result = data.value!.results![index];
|
||||
return Card(
|
||||
margin: const EdgeInsets.symmetric(vertical: 4.0),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
side: const BorderSide(
|
||||
color: AppColor.blueNormal,
|
||||
width: 1,
|
||||
),
|
||||
),
|
||||
child: Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
buildRow('ردیف', '${index + 1}'),
|
||||
buildRow(
|
||||
'تاریخ ثبت',
|
||||
result.date!.formattedJalaliDate ?? 'N/A',
|
||||
),
|
||||
buildRow(
|
||||
'نوع تخصیص',
|
||||
result.allocation_type?.faAllocationType ?? 'N/A',
|
||||
),
|
||||
buildRow(
|
||||
'مشخصات خریدار',
|
||||
'${result.to_guilds?.user?.fullname} - ${result.to_guilds?.guilds_name}' ??
|
||||
'N/A',
|
||||
),
|
||||
buildRow(
|
||||
'مشخصات فروشنده',
|
||||
result.steward?.user?.fullname ?? 'N/A',
|
||||
),
|
||||
buildRow(
|
||||
'نوع فروش',
|
||||
result.sell_type?.faItem ?? 'N/A',
|
||||
),
|
||||
buildRow(
|
||||
'قیمت هر کیلو',
|
||||
'${result.amount ?? 0} ریال ',
|
||||
),
|
||||
buildRow(
|
||||
'قیمت کل',
|
||||
'${result.total_amount ?? 0} ریال',
|
||||
),
|
||||
buildRow(
|
||||
'وزن تخصیصی',
|
||||
'${result.weight_of_carcasses?.toInt() ?? 0} کیلوگرم',
|
||||
),
|
||||
buildRow(
|
||||
'کداحراز',
|
||||
result.registration_code?.toString() ?? 'N/A',
|
||||
),
|
||||
buildRow(
|
||||
'وضعیت کد احراز',
|
||||
result.system_registration_code == true
|
||||
? "ارسال شده"
|
||||
: "ارسال نشده" ?? 'N/A',
|
||||
),
|
||||
buildRow(
|
||||
'افت وزن(کیلوگرم)',
|
||||
result.weight_loss_of_carcasses
|
||||
?.toInt()
|
||||
.toString() ??
|
||||
'N/A',
|
||||
),
|
||||
buildRow(
|
||||
'وضعیت',
|
||||
result.receiver_state?.faItem ?? 'N/A',
|
||||
),
|
||||
|
||||
Row(
|
||||
spacing: 10,
|
||||
children: [
|
||||
Expanded(
|
||||
child: RElevated(
|
||||
height: 40,
|
||||
text: 'تایید',
|
||||
onPressed: () {
|
||||
ConformAllocation confromation =
|
||||
ConformAllocation(
|
||||
allocation_key: result.key,
|
||||
number_of_carcasses:
|
||||
result.number_of_carcasses,
|
||||
weight_of_carcasses: result
|
||||
.weight_of_carcasses
|
||||
?.toInt(),
|
||||
amount: result.amount,
|
||||
total_amount: result.total_amount,
|
||||
);
|
||||
|
||||
controller.confirmAllocation(
|
||||
confromation,
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: RElevated(
|
||||
height: 40,
|
||||
backgroundColor: AppColor.error,
|
||||
text: 'رد',
|
||||
onPressed: () {
|
||||
controller.denyAllocation(
|
||||
result.key ?? '',
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
},
|
||||
separatorBuilder: (BuildContext context, int index) =>
|
||||
SizedBox(height: 8),
|
||||
),
|
||||
);
|
||||
}
|
||||
}, controller.allocatedMadeModel),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
void showAddBottomSheet() {
|
||||
Get.bottomSheet(
|
||||
SafeArea(
|
||||
child: BaseBottomSheet(
|
||||
height: 700,
|
||||
child: Padding(
|
||||
padding: EdgeInsets.only(
|
||||
left: 16,
|
||||
right: 16,
|
||||
top: 16,
|
||||
bottom: MediaQuery.of(Get.context!).viewInsets.bottom + 16,
|
||||
),
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: [
|
||||
Text(
|
||||
'ثبت توزیع/ فروش',
|
||||
style: AppFonts.yekan16Bold.copyWith(
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
RTextField(
|
||||
controller: TextEditingController(),
|
||||
label: 'تاریخ',
|
||||
enabled: false,
|
||||
initText: Jalali.now().formatCompactDate(),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
Material(
|
||||
type: MaterialType.transparency,
|
||||
child: productDropDown(),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
SizedBox(
|
||||
height: 40,
|
||||
child: ObxValue((data) {
|
||||
return Row(
|
||||
children: [
|
||||
Radio(
|
||||
value: 1,
|
||||
groupValue: controller.saleType.value,
|
||||
onChanged: (value) {
|
||||
controller.saleType.value = value!;
|
||||
},
|
||||
),
|
||||
Text('فروش اختصاصی', style: AppFonts.yekan14),
|
||||
SizedBox(width: 12),
|
||||
Radio(
|
||||
value: 2,
|
||||
groupValue: controller.saleType.value,
|
||||
onChanged: (value) {
|
||||
controller.saleType.value = value!;
|
||||
},
|
||||
),
|
||||
Text('فروش آزاد', style: AppFonts.yekan14),
|
||||
],
|
||||
);
|
||||
}, controller.saleType),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
|
||||
Material(
|
||||
type: MaterialType.transparency,
|
||||
child: guildsDropDown(),
|
||||
),
|
||||
|
||||
const SizedBox(height: 12),
|
||||
RTextField(
|
||||
controller: controller.weightController,
|
||||
keyboardType: TextInputType.number,
|
||||
onChanged: (p0) {
|
||||
controller.weight.value = int.tryParse(p0) ?? 0;
|
||||
},
|
||||
label: 'وزن لاشه',
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
RTextField(
|
||||
controller: controller.pricePerKiloController,
|
||||
onChanged: (p0) {
|
||||
controller.pricePerKilo.value = int.tryParse(p0) ?? 0;
|
||||
},
|
||||
keyboardType: TextInputType.number,
|
||||
label: 'قیمت هر کیلو',
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
ObxValue(
|
||||
(p0) => RTextField(
|
||||
enabled: false,
|
||||
keyboardType: TextInputType.number,
|
||||
initText: controller.totalCost.value.toString(),
|
||||
controller: controller.totalCostController,
|
||||
label: 'هزینه کل',
|
||||
),
|
||||
controller.totalCost,
|
||||
),
|
||||
const SizedBox(height: 20),
|
||||
ObxValue((data) {
|
||||
return RElevated(
|
||||
text: 'ثبت',
|
||||
onPressed: data.value
|
||||
? () {
|
||||
controller.submitAllocation();
|
||||
}
|
||||
: null,
|
||||
);
|
||||
}, controller.isValid),
|
||||
const SizedBox(height: 20),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
isScrollControlled: true,
|
||||
backgroundColor: Colors.transparent,
|
||||
);
|
||||
}
|
||||
|
||||
Widget guildsDropDown() {
|
||||
return ObxValue((p0) {
|
||||
return DropdownButtonFormField<GuildModel>(
|
||||
value: controller.selectedGuildModel.value,
|
||||
decoration: const InputDecoration(
|
||||
labelText: 'انتخاب مباشر/صنف',
|
||||
border: OutlineInputBorder(),
|
||||
),
|
||||
isExpanded: true,
|
||||
items: controller.guildsModel.map((guild) {
|
||||
return DropdownMenuItem<GuildModel>(
|
||||
value: guild,
|
||||
child: Text(
|
||||
'${guild.steward == true ? 'مباشر' : 'صنف'} ${guild.user?.fullname} (${guild.user?.mobile})',
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
onChanged: (value) {
|
||||
if (value != null) {
|
||||
controller.setSelectedGuild(value);
|
||||
controller.checkVerfication();
|
||||
}
|
||||
},
|
||||
);
|
||||
}, controller.guildsModel);
|
||||
/* return GetBuilder<SalesWithinProvinceLogic>(
|
||||
builder: (controller) {
|
||||
return DropdownButtonFormField<GuildModel>(
|
||||
value: controller.selectedGuildModel.value,
|
||||
decoration: const InputDecoration(
|
||||
labelText: 'انتخاب مباشر/صنف',
|
||||
border: OutlineInputBorder(),
|
||||
),
|
||||
isExpanded: true,
|
||||
items: controller.guildsModel.map((guild) {
|
||||
return DropdownMenuItem<GuildModel>(
|
||||
value: guild,
|
||||
child: Text(
|
||||
'${guild.steward == true ? 'مباشر' : 'صنف'} ${guild.user
|
||||
?.fullname} (${guild.user?.mobile})',
|
||||
),
|
||||
);
|
||||
}).toList(),
|
||||
onChanged: (value) {
|
||||
if (value != null) {
|
||||
controller.setSelectedGuild(value);
|
||||
}
|
||||
},
|
||||
);
|
||||
},
|
||||
);*/
|
||||
}
|
||||
|
||||
Widget productDropDown() {
|
||||
return GetBuilder<SalesWithinProvinceLogic>(
|
||||
builder: (controller) {
|
||||
return DropdownButtonFormField<ProductModel>(
|
||||
value: controller.selectedProductModel.value,
|
||||
decoration: const InputDecoration(
|
||||
labelText: 'انتخاب محصول',
|
||||
border: OutlineInputBorder(),
|
||||
),
|
||||
isExpanded: true,
|
||||
items: controller.rolesProductsModel.map((guild) {
|
||||
return DropdownMenuItem<ProductModel>(
|
||||
value: guild,
|
||||
child: Text('${guild.name}'),
|
||||
);
|
||||
}).toList(),
|
||||
onChanged: (value) {
|
||||
if (value != null) {
|
||||
controller.setSelectedProduct(value);
|
||||
controller.checkVerfication();
|
||||
}
|
||||
},
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,10 @@
|
||||
import 'package:rasadyar_auth/auth.dart';
|
||||
import 'package:rasadyar_chicken/presentation/pages/entering_the_warehouse/logic.dart';
|
||||
import 'package:rasadyar_chicken/presentation/pages/entering_the_warehouse/view.dart';
|
||||
import 'package:rasadyar_chicken/presentation/pages/root/logic.dart';
|
||||
import 'package:rasadyar_chicken/presentation/pages/root/view.dart';
|
||||
import 'package:rasadyar_chicken/presentation/pages/sales_within_province/logic.dart';
|
||||
import 'package:rasadyar_chicken/presentation/pages/sales_within_province/view.dart';
|
||||
import 'package:rasadyar_chicken/presentation/routes/routes.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
@@ -11,7 +16,27 @@ sealed class ChickenPages {
|
||||
name: ChickenRoutes.init,
|
||||
page: () => RootPage(),
|
||||
middlewares: [AuthMiddleware()],
|
||||
binding: BindingsBuilder(() {}),
|
||||
binding: BindingsBuilder(() {
|
||||
Get.put(RootLogic());
|
||||
}),
|
||||
),
|
||||
|
||||
GetPage(
|
||||
name: ChickenRoutes.enteringTheWarehouse,
|
||||
page: () => EnteringTheWarehousePage(),
|
||||
middlewares: [AuthMiddleware()],
|
||||
binding: BindingsBuilder(() {
|
||||
Get.put(EnteringTheWarehouseLogic());
|
||||
Get.put(RootLogic());
|
||||
}),
|
||||
), GetPage(
|
||||
name: ChickenRoutes.salesWithinProvince,
|
||||
page: () => SalesWithinProvincePage(),
|
||||
middlewares: [AuthMiddleware()],
|
||||
binding: BindingsBuilder(() {
|
||||
Get.put(SalesWithinProvinceLogic());
|
||||
Get.put(RootLogic());
|
||||
}),
|
||||
),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
sealed class ChickenRoutes {
|
||||
ChickenRoutes._();
|
||||
static const _base = '/init';
|
||||
static const init = '$_base/init';
|
||||
|
||||
static const init = '/chicken/init';
|
||||
static const enteringTheWarehouse = '$_base/enteringTheWarehouse';
|
||||
static const salesWithinProvince = '$_base/SalesWithinProvincePage';
|
||||
|
||||
}
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
import 'package:chicken/chicken.dart';
|
||||
import 'package:test/test.dart';
|
||||
|
||||
void main() {
|
||||
group('A group of tests', () {
|
||||
final awesome = Awesome();
|
||||
|
||||
setUp(() {
|
||||
// Additional setup goes here.
|
||||
});
|
||||
|
||||
test('First Test', () {
|
||||
expect(awesome.isAwesome, isTrue);
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -44,3 +44,4 @@ export 'package:dio/dio.dart' show DioException;
|
||||
//utils
|
||||
export 'utils/logger_utils.dart';
|
||||
export 'utils/safe_call_utils.dart';
|
||||
export 'utils/date_time_utils.dart';
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:flutter/foundation.dart';
|
||||
import 'package:pretty_dio_logger/pretty_dio_logger.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
import 'package:rasadyar_core/infrastructure/remote/interfaces/i_form_data.dart';
|
||||
|
||||
@@ -14,30 +12,42 @@ class DioRemote implements IHttpClient {
|
||||
|
||||
@override
|
||||
Future<void> init() async {
|
||||
final dio = Dio(BaseOptions(baseUrl: baseUrl??''));
|
||||
final dio = Dio(BaseOptions(baseUrl: baseUrl ?? ''));
|
||||
if (kDebugMode) {
|
||||
dio.interceptors.add(PrettyDioLogger(
|
||||
requestHeader: true,
|
||||
responseHeader: true,
|
||||
requestBody: true
|
||||
));
|
||||
dio.interceptors.add(
|
||||
PrettyDioLogger(
|
||||
requestHeader: true,
|
||||
responseHeader: true,
|
||||
requestBody: true,
|
||||
),
|
||||
);
|
||||
}
|
||||
_dio = dio;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<DioResponse<T>> get<T>(
|
||||
String path, {
|
||||
Map<String, dynamic>? queryParameters,
|
||||
Map<String, String>? headers,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
}) async {
|
||||
String path, {
|
||||
Map<String, dynamic>? queryParameters,
|
||||
Map<String, String>? headers,
|
||||
ProgressCallback? onReceiveProgress,
|
||||
T Function(Map<String, dynamic> json)? fromJson,
|
||||
T Function(List<dynamic> json)? fromJsonList,
|
||||
}) async {
|
||||
final response = await _dio.get(
|
||||
path,
|
||||
queryParameters: queryParameters,
|
||||
options: Options(headers: headers),
|
||||
onReceiveProgress: onReceiveProgress,
|
||||
);
|
||||
if (fromJsonList != null && response.data is List) {
|
||||
response.data = fromJsonList(response.data);
|
||||
return DioResponse<T>(response);
|
||||
}
|
||||
if (fromJson != null && response.data is Map<String, dynamic>) {
|
||||
response.data = fromJson(response.data);
|
||||
return DioResponse<T>(response);
|
||||
}
|
||||
return DioResponse<T>(response);
|
||||
}
|
||||
|
||||
@@ -62,13 +72,14 @@ class DioRemote implements IHttpClient {
|
||||
|
||||
if (fromJson != null) {
|
||||
final rawData = response.data;
|
||||
final parsedData =
|
||||
rawData is Map<String, dynamic> ? fromJson(rawData) : null;
|
||||
final parsedData = rawData is Map<String, dynamic>
|
||||
? fromJson(rawData)
|
||||
: null;
|
||||
response.data = parsedData;
|
||||
return DioResponse<T>(response);
|
||||
}
|
||||
|
||||
return DioResponse<T>(response );
|
||||
return DioResponse<T>(response);
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@@ -57,6 +57,9 @@ class $AssetsIconsGen {
|
||||
/// File path: assets/icons/information.svg
|
||||
SvgGenImage get information => const SvgGenImage('assets/icons/information.svg');
|
||||
|
||||
/// File path: assets/icons/inside.svg
|
||||
SvgGenImage get inside => const SvgGenImage('assets/icons/inside.svg');
|
||||
|
||||
/// File path: assets/icons/inspection.svg
|
||||
SvgGenImage get inspection => const SvgGenImage('assets/icons/inspection.svg');
|
||||
|
||||
@@ -78,6 +81,9 @@ class $AssetsIconsGen {
|
||||
/// File path: assets/icons/message_add.svg
|
||||
SvgGenImage get messageAdd => const SvgGenImage('assets/icons/message_add.svg');
|
||||
|
||||
/// File path: assets/icons/outside.svg
|
||||
SvgGenImage get outside => const SvgGenImage('assets/icons/outside.svg');
|
||||
|
||||
/// File path: assets/icons/pdf_download.svg
|
||||
SvgGenImage get pdfDownload => const SvgGenImage('assets/icons/pdf_download.svg');
|
||||
|
||||
@@ -129,6 +135,9 @@ class $AssetsIconsGen {
|
||||
/// File path: assets/icons/virtual.svg
|
||||
SvgGenImage get virtual => const SvgGenImage('assets/icons/virtual.svg');
|
||||
|
||||
/// File path: assets/icons/whare_house.svg
|
||||
SvgGenImage get whareHouse => const SvgGenImage('assets/icons/whare_house.svg');
|
||||
|
||||
/// List of all assets
|
||||
List<SvgGenImage> get values => [
|
||||
add,
|
||||
@@ -145,6 +154,7 @@ class $AssetsIconsGen {
|
||||
filter,
|
||||
gps,
|
||||
information,
|
||||
inside,
|
||||
inspection,
|
||||
key,
|
||||
liveStock,
|
||||
@@ -152,6 +162,7 @@ class $AssetsIconsGen {
|
||||
map,
|
||||
mapMarker,
|
||||
messageAdd,
|
||||
outside,
|
||||
pdfDownload,
|
||||
pictureFrame,
|
||||
placeHolder,
|
||||
@@ -169,6 +180,7 @@ class $AssetsIconsGen {
|
||||
user,
|
||||
userSquare,
|
||||
virtual,
|
||||
whareHouse,
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,6 @@
|
||||
class FontFamily {
|
||||
FontFamily._();
|
||||
|
||||
/// Font family: yekan
|
||||
static const String yekan = 'yekan';
|
||||
/// Font family: iranyekanregularfanum
|
||||
static const String iranyekanregularfanum = 'iranyekanregularfanum';
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
extension XDataTime on DateTime {
|
||||
String get formattedGregorianDate {
|
||||
|
||||
return "$year/${month.toString().padLeft(2, '0')}/${day.toString().padLeft(2, '0')}";
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
extension ListExtensions<T> on List<T> {
|
||||
void toggle(T item) {
|
||||
if (contains(item)) {
|
||||
if (length > 1) {
|
||||
|
||||
remove(item);
|
||||
}
|
||||
|
||||
} else {
|
||||
add(item);
|
||||
}
|
||||
|
||||
@@ -1,2 +1,3 @@
|
||||
export 'color_utils.dart';
|
||||
export 'list_extensions.dart';
|
||||
export 'list_extensions.dart';
|
||||
export 'data_time_utils.dart';
|
||||
10
packages/core/lib/utils/date_time_utils.dart
Normal file
10
packages/core/lib/utils/date_time_utils.dart
Normal file
@@ -0,0 +1,10 @@
|
||||
import 'package:persian_datetime_picker/persian_datetime_picker.dart';
|
||||
|
||||
extension xDateTime on String{
|
||||
get toDateTime => DateTime.parse(this);
|
||||
get formattedJalaliDate{
|
||||
final dateTime = DateTime.parse(this);
|
||||
final jalaliDate = Jalali.fromDateTime(dateTime);
|
||||
return "${jalaliDate.year}/${jalaliDate.month.toString().padLeft(2, '0')}/${jalaliDate.day.toString().padLeft(2, '0')}";
|
||||
}
|
||||
}
|
||||
@@ -60,6 +60,9 @@ flutter:
|
||||
|
||||
assets:
|
||||
- assets/icons/
|
||||
- assets/icons/inside.svg
|
||||
- assets/icons/outside.svg
|
||||
- assets/icons/whare_house.svg
|
||||
- assets/images/
|
||||
- assets/logos/
|
||||
- assets/vec/
|
||||
|
||||
Reference in New Issue
Block a user