Merge branch with resolved conflicts - restructured features and added new modules
This commit is contained in:
3
packages/chicken/lib/features/city_jahad/city_jahad.dart
Normal file
3
packages/chicken/lib/features/city_jahad/city_jahad.dart
Normal file
@@ -0,0 +1,3 @@
|
||||
export 'data/di/city_jahad_di.dart';
|
||||
export 'presentation/routes/routes.dart';
|
||||
export 'presentation/routes/pages.dart';
|
||||
@@ -0,0 +1,15 @@
|
||||
import 'package:rasadyar_chicken/features/poultry_science/data/model/response/poultry_science_report/poultry_science_report.dart';
|
||||
import 'package:rasadyar_chicken/features/poultry_science/data/model/request/submit_inspection/submit_inspection_response.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
abstract class CityJahadRemoteDataSource {
|
||||
Future<PaginationModel<PoultryScienceReport>?> getSubmitInspectionList({
|
||||
required String token,
|
||||
Map<String, dynamic>? queryParameters,
|
||||
});
|
||||
|
||||
Future<void> submitInspection({
|
||||
required String token,
|
||||
required SubmitInspectionResponse request,
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
import 'package:rasadyar_chicken/features/poultry_science/data/model/response/poultry_science_report/poultry_science_report.dart';
|
||||
import 'package:rasadyar_chicken/features/poultry_science/data/model/request/submit_inspection/submit_inspection_response.dart';
|
||||
import 'package:rasadyar_chicken/features/city_jahad/data/datasources/remote/city_jahad_remote_data_source.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
class CityJahadRemoteDataSourceImpl implements CityJahadRemoteDataSource {
|
||||
final DioRemote _httpClient;
|
||||
|
||||
CityJahadRemoteDataSourceImpl(this._httpClient);
|
||||
|
||||
@override
|
||||
Future<PaginationModel<PoultryScienceReport>?> getSubmitInspectionList({
|
||||
required String token,
|
||||
Map<String, dynamic>? queryParameters,
|
||||
}) async {
|
||||
var res = await _httpClient.get(
|
||||
'/poultry_science_report/',
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
queryParameters: queryParameters,
|
||||
fromJson: (json) => PaginationModel<PoultryScienceReport>.fromJson(
|
||||
json,
|
||||
(json) => PoultryScienceReport.fromJson(json as Map<String, dynamic>),
|
||||
),
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> submitInspection({
|
||||
required String token,
|
||||
required SubmitInspectionResponse request,
|
||||
}) async {
|
||||
await _httpClient.post(
|
||||
'/poultry_science_report/',
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
data: request.toJson(),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
import 'package:rasadyar_chicken/features/city_jahad/data/datasources/remote/city_jahad_remote_data_source.dart';
|
||||
import 'package:rasadyar_chicken/features/city_jahad/data/datasources/remote/city_jahad_remote_data_source_impl.dart';
|
||||
import 'package:rasadyar_chicken/features/city_jahad/data/repositories/city_jahad_repository.dart';
|
||||
import 'package:rasadyar_chicken/features/city_jahad/data/repositories/city_jahad_repository_impl.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
/// Setup dependency injection for city_jahad feature
|
||||
Future<void> setupCityJahadDI(GetIt di, DioRemote dioRemote) async {
|
||||
di.registerLazySingleton<CityJahadRemoteDataSource>(
|
||||
() => CityJahadRemoteDataSourceImpl(dioRemote),
|
||||
);
|
||||
|
||||
di.registerLazySingleton<CityJahadRepository>(
|
||||
() => CityJahadRepositoryImpl(di.get<CityJahadRemoteDataSource>()),
|
||||
);
|
||||
}
|
||||
|
||||
/// Re-register city_jahad dependencies (used when base URL changes)
|
||||
Future<void> reRegisterCityJahadDI(GetIt di, DioRemote dioRemote) async {
|
||||
await reRegister(di, () => CityJahadRemoteDataSourceImpl(dioRemote));
|
||||
await reRegister(
|
||||
di,
|
||||
() => CityJahadRepositoryImpl(di.get<CityJahadRemoteDataSource>()),
|
||||
);
|
||||
}
|
||||
|
||||
/// Helper function to re-register a dependency
|
||||
Future<void> reRegister<T extends Object>(
|
||||
GetIt di,
|
||||
T Function() factory,
|
||||
) async {
|
||||
if (di.isRegistered<T>()) {
|
||||
await di.unregister<T>();
|
||||
}
|
||||
di.registerLazySingleton<T>(factory);
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
import 'package:rasadyar_chicken/features/poultry_science/data/model/response/poultry_science_report/poultry_science_report.dart';
|
||||
import 'package:rasadyar_chicken/features/poultry_science/data/model/request/submit_inspection/submit_inspection_response.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
abstract class CityJahadRepository {
|
||||
Future<PaginationModel<PoultryScienceReport>?> getSubmitInspectionList({
|
||||
required String token,
|
||||
Map<String, dynamic>? queryParameters,
|
||||
});
|
||||
|
||||
Future<void> submitInspection({
|
||||
required String token,
|
||||
required SubmitInspectionResponse request,
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
import 'package:rasadyar_chicken/features/poultry_science/data/model/response/poultry_science_report/poultry_science_report.dart';
|
||||
import 'package:rasadyar_chicken/features/poultry_science/data/model/request/submit_inspection/submit_inspection_response.dart';
|
||||
import 'package:rasadyar_chicken/features/city_jahad/data/datasources/remote/city_jahad_remote_data_source.dart';
|
||||
import 'package:rasadyar_chicken/features/city_jahad/data/repositories/city_jahad_repository.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
class CityJahadRepositoryImpl implements CityJahadRepository {
|
||||
final CityJahadRemoteDataSource _remote;
|
||||
|
||||
CityJahadRepositoryImpl(this._remote);
|
||||
|
||||
@override
|
||||
Future<PaginationModel<PoultryScienceReport>?> getSubmitInspectionList({
|
||||
required String token,
|
||||
Map<String, dynamic>? queryParameters,
|
||||
}) async {
|
||||
return await _remote.getSubmitInspectionList(
|
||||
token: token,
|
||||
queryParameters: queryParameters,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> submitInspection({
|
||||
required String token,
|
||||
required SubmitInspectionResponse request,
|
||||
}) async {
|
||||
return await _remote.submitInspection(token: token, request: request);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
import 'package:rasadyar_chicken/data/di/chicken_di.dart';
|
||||
import 'package:rasadyar_chicken/features/poultry_science/data/model/response/hatching/hatching_models.dart';
|
||||
import 'package:rasadyar_chicken/features/poultry_science/data/repositories/poultry_science_repository.dart';
|
||||
import 'package:rasadyar_chicken/features/city_jahad/presentation/pages/root/logic.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
class ActiveHatchingLogic extends GetxController {
|
||||
CityJahadRootLogic rootLogic = Get.find<CityJahadRootLogic>();
|
||||
BaseLogic baseLogic = Get.find<BaseLogic>();
|
||||
late PoultryScienceRepository poultryScienceRepository;
|
||||
Rx<Resource<PaginationModel<HatchingModel>>> activeHatchingList =
|
||||
Resource<PaginationModel<HatchingModel>>.loading().obs;
|
||||
|
||||
final RxBool isLoadingMoreList = false.obs;
|
||||
RxInt currentPage = 1.obs;
|
||||
RxInt expandedIndex = RxInt(-1);
|
||||
List<String> routesName = ['اقدام', 'جوجه ریزی فعال'];
|
||||
|
||||
Rx<Jalali> fromDateFilter = Jalali.now().obs;
|
||||
Rx<Jalali> toDateFilter = Jalali.now().obs;
|
||||
RxnString searchedValue = RxnString();
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
poultryScienceRepository = diChicken.get<PoultryScienceRepository>();
|
||||
}
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
super.onReady();
|
||||
getHatchingList();
|
||||
}
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
super.onClose();
|
||||
baseLogic.clearSearch();
|
||||
}
|
||||
|
||||
Future<void> getHatchingList([bool isLoadingMore = false]) async {
|
||||
if (isLoadingMore) {
|
||||
isLoadingMoreList.value = true;
|
||||
} else {
|
||||
activeHatchingList.value =
|
||||
Resource<PaginationModel<HatchingModel>>.loading();
|
||||
}
|
||||
|
||||
if (searchedValue.value != null &&
|
||||
searchedValue.value!.trim().isNotEmpty &&
|
||||
currentPage.value > 1) {
|
||||
currentPage.value = 1;
|
||||
}
|
||||
|
||||
safeCall(
|
||||
call: () async => await poultryScienceRepository.getHatchingPoultry(
|
||||
token: rootLogic.tokenService.accessToken.value!,
|
||||
queryParameters: buildQueryParams(
|
||||
queryParams: {'type': 'hatching'},
|
||||
role: 'CityJahad',
|
||||
pageSize: 50,
|
||||
page: currentPage.value,
|
||||
),
|
||||
),
|
||||
onSuccess: (res) {
|
||||
if ((res?.count ?? 0) == 0) {
|
||||
activeHatchingList.value =
|
||||
Resource<PaginationModel<HatchingModel>>.empty();
|
||||
} else {
|
||||
activeHatchingList.value =
|
||||
Resource<PaginationModel<HatchingModel>>.success(
|
||||
PaginationModel<HatchingModel>(
|
||||
count: res?.count ?? 0,
|
||||
next: res?.next,
|
||||
previous: res?.previous,
|
||||
results: [
|
||||
...(activeHatchingList.value.data?.results ?? []),
|
||||
...(res?.results ?? []),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
void toggleExpanded(int index) {
|
||||
expandedIndex.value = expandedIndex.value == index ? -1 : index;
|
||||
}
|
||||
|
||||
Future<void> onRefresh() async {
|
||||
currentPage.value = 1;
|
||||
await getHatchingList();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,239 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_chicken/features/poultry_science/data/model/response/hatching/hatching_models.dart';
|
||||
import 'package:rasadyar_chicken/features/city_jahad/presentation/pages/active_hatching/logic.dart';
|
||||
import 'package:rasadyar_chicken/features/poultry_science/presentation/widgets/submit_inspection_bottom_sheet/create_inspection_bottom_sheet.dart';
|
||||
import 'package:rasadyar_chicken/features/poultry_science/presentation/widgets/submit_inspection_bottom_sheet/create_inspection_bottom_sheet_logic.dart';
|
||||
import 'package:rasadyar_chicken/presentation/utils/nested_keys_utils.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
class ActiveHatchingPage extends GetView<ActiveHatchingLogic> {
|
||||
const ActiveHatchingPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ChickenBasePage(
|
||||
hasSearch: true,
|
||||
hasFilter: false,
|
||||
backId: cityJahadActionKey,
|
||||
routes: controller.routesName,
|
||||
onSearchChanged: (data) {
|
||||
controller.searchedValue.value = data;
|
||||
controller.getHatchingList();
|
||||
},
|
||||
child: hatchingWidget(),
|
||||
/*widgets: [
|
||||
hatchingWidget()
|
||||
],*/
|
||||
);
|
||||
}
|
||||
|
||||
Widget hatchingWidget() {
|
||||
return ObxValue((data) {
|
||||
return RPaginatedListView(
|
||||
listType: ListType.separated,
|
||||
resource: data.value,
|
||||
hasMore: data.value.data?.next != null,
|
||||
padding: EdgeInsets.fromLTRB(8, 8, 8, 80),
|
||||
itemBuilder: (context, index) {
|
||||
var item = data.value.data!.results![index];
|
||||
return ObxValue((val) {
|
||||
return ExpandableListItem2(
|
||||
selected: val.value.isEqual(index),
|
||||
onTap: () => controller.toggleExpanded(index),
|
||||
index: index,
|
||||
child: itemListWidget(item),
|
||||
secondChild: itemListExpandedWidget(item),
|
||||
labelColor: AppColor.blueLight,
|
||||
labelIcon: Assets.vec.activeFramSvg.path,
|
||||
);
|
||||
}, controller.expandedIndex);
|
||||
},
|
||||
itemCount: data.value.data?.results?.length ?? 0,
|
||||
separatorBuilder: (context, index) => SizedBox(height: 8.h),
|
||||
onLoadMore: () async => controller.getHatchingList(true),
|
||||
);
|
||||
}, controller.activeHatchingList);
|
||||
}
|
||||
|
||||
Container itemListExpandedWidget(HatchingModel item) {
|
||||
return Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 8),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: Column(
|
||||
spacing: 8,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
item.poultry?.user?.fullname ?? 'N/A',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan16.copyWith(color: AppColor.greenDark),
|
||||
),
|
||||
Spacer(),
|
||||
|
||||
Visibility(
|
||||
child: Text(
|
||||
item.violation == true ? 'پیگیری' : 'عادی',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan10.copyWith(color: AppColor.redDark),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Container(
|
||||
height: 32,
|
||||
padding: EdgeInsets.symmetric(horizontal: 8),
|
||||
decoration: ShapeDecoration(
|
||||
color: AppColor.blueLight,
|
||||
shape: RoundedRectangleBorder(
|
||||
side: BorderSide(width: 1, color: AppColor.blueLightHover),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
),
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Text(
|
||||
'نژاد:${item.breed?.first.breed ?? 'N/A'}',
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.textColor),
|
||||
),
|
||||
Text(
|
||||
' سن${item.age} (روز)',
|
||||
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
Text(
|
||||
' دوره جوجه ریزی:${item.period}',
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.textColor),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
buildRow(
|
||||
title: 'شماره مجوز جوجه ریزی',
|
||||
value: item.licenceNumber ?? 'N/A',
|
||||
),
|
||||
buildUnitRow(
|
||||
title: 'حجم جوجه ریزی',
|
||||
value: item.quantity.separatedByCommaFa,
|
||||
unit: '(قطعه)',
|
||||
),
|
||||
buildUnitRow(
|
||||
title: 'مانده در سالن',
|
||||
value: item.leftOver.separatedByCommaFa,
|
||||
unit: '(قطعه)',
|
||||
),
|
||||
buildUnitRow(
|
||||
title: 'تلفات',
|
||||
value: item.losses.separatedByCommaFa,
|
||||
unit: '(قطعه)',
|
||||
),
|
||||
buildRow(
|
||||
title: 'دامپزشک فارم',
|
||||
value:
|
||||
'${item.vetFarm?.vetFarmFullName}(${item.vetFarm?.vetFarmMobile})',
|
||||
),
|
||||
buildRow(
|
||||
title: 'شرح بازرسی',
|
||||
value: item.reportInfo?.image == false
|
||||
? 'ارسال تصویر جوجه ریزی فارم '
|
||||
: 'تکمیل شده',
|
||||
titleStyle: AppFonts.yekan14.copyWith(
|
||||
color: (item.reportInfo?.image ?? false)
|
||||
? AppColor.greenNormal
|
||||
: AppColor.redDark,
|
||||
),
|
||||
valueStyle: AppFonts.yekan14.copyWith(
|
||||
color: (item.reportInfo?.image ?? false)
|
||||
? AppColor.greenNormal
|
||||
: AppColor.redDark,
|
||||
),
|
||||
),
|
||||
|
||||
RElevated(
|
||||
height: 40.h,
|
||||
isFullWidth: true,
|
||||
onPressed: () {
|
||||
Get.find<CreateInspectionBottomSheetLogic>().setHatchingModel(
|
||||
item,
|
||||
);
|
||||
Get.bottomSheet(
|
||||
CreateInspectionBottomSheet(),
|
||||
isScrollControlled: true,
|
||||
ignoreSafeArea: false,
|
||||
).then((value) {
|
||||
if (Get.isRegistered<CreateInspectionBottomSheetLogic>()) {
|
||||
Get.find<CreateInspectionBottomSheetLogic>().clearForm();
|
||||
}
|
||||
});
|
||||
},
|
||||
child: Text('ثبت بازرسی'),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget itemListWidget(HatchingModel item) {
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||
children: [
|
||||
SizedBox(width: 20),
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
spacing: 3,
|
||||
children: [
|
||||
Text(
|
||||
item.poultry?.user?.fullname ?? 'N/A',
|
||||
textAlign: TextAlign.start,
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
Text(
|
||||
item.poultry?.user?.mobile ?? 'N/A',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.bgDark),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 3,
|
||||
child: Column(
|
||||
spacing: 3,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Text(
|
||||
item.poultry?.unitName ?? 'N/A',
|
||||
textAlign: TextAlign.start,
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.bgDark),
|
||||
),
|
||||
Text(
|
||||
item.poultry?.licenceNumber ?? 'N/A',
|
||||
textAlign: TextAlign.left,
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Assets.vec.scanSvg.svg(
|
||||
width: 32.w,
|
||||
height: 32.h,
|
||||
colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
import 'package:rasadyar_chicken/features/city_jahad/presentation/routes/routes.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
class CityJahadActionItem {
|
||||
final String title;
|
||||
final String route;
|
||||
final String icon;
|
||||
|
||||
CityJahadActionItem({
|
||||
required this.title,
|
||||
required this.route,
|
||||
required this.icon,
|
||||
});
|
||||
}
|
||||
|
||||
class CityJahadHomeLogic extends GetxController {
|
||||
RxList<CityJahadActionItem> items = [
|
||||
CityJahadActionItem(
|
||||
title: "جوجه ریزی فعال",
|
||||
route: CityJahadRoutes.activeHatchingCityJahad,
|
||||
icon: Assets.vec.activeFramSvg.path,
|
||||
),
|
||||
CityJahadActionItem(
|
||||
title: "بازرسی مزارع طیور",
|
||||
route: CityJahadRoutes.newInspectionCityJahad,
|
||||
icon: Assets.vec.activeFramSvg.path,
|
||||
),
|
||||
].obs;
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_chicken/presentation/utils/nested_keys_utils.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
import 'logic.dart';
|
||||
|
||||
class CityJahadHomePage extends GetView<CityJahadHomeLogic> {
|
||||
CityJahadHomePage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ChickenBasePage(
|
||||
isBase: true,
|
||||
hasNews: true,
|
||||
hasNotification: true,
|
||||
child: gridWidget(),
|
||||
);
|
||||
}
|
||||
|
||||
Widget gridWidget() {
|
||||
return ObxValue((data) {
|
||||
return GridView.builder(
|
||||
physics: BouncingScrollPhysics(),
|
||||
padding: EdgeInsets.symmetric(vertical: 18.h, horizontal: 32.w),
|
||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 2,
|
||||
mainAxisSpacing: 24.h,
|
||||
crossAxisSpacing: 24.w,
|
||||
),
|
||||
itemCount: data.length,
|
||||
hitTestBehavior: HitTestBehavior.opaque,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
var item = data[index];
|
||||
return GlassMorphismCardIcon(
|
||||
title: item.title,
|
||||
vecIcon: item.icon,
|
||||
onTap: () async {
|
||||
Get.toNamed(item.route, id: cityJahadActionKey);
|
||||
},
|
||||
);
|
||||
},
|
||||
);
|
||||
}, controller.items);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,160 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_chicken/features/city_jahad/presentation/pages/root/logic.dart';
|
||||
import 'package:rasadyar_chicken/features/poultry_science/data/model/response/poultry_science_report/poultry_science_report.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/base_page/logic.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
class NewInspectionLogic extends GetxController {
|
||||
BaseLogic baseLogic = Get.find<BaseLogic>();
|
||||
|
||||
Rx<Resource<PaginationModel<PoultryScienceReport>>> submitInspectionList =
|
||||
Resource<PaginationModel<PoultryScienceReport>>.loading().obs;
|
||||
|
||||
CityJahadRootLogic rootLogic = Get.find<CityJahadRootLogic>();
|
||||
|
||||
final RxBool isLoadingMoreAllocationsMade = false.obs;
|
||||
RxInt currentPage = 1.obs;
|
||||
RxInt expandedIndex = RxInt(-1);
|
||||
RxList<XFile> pickedImages = <XFile>[].obs;
|
||||
final List<MultipartFile> _multiPartPickedImages = <MultipartFile>[];
|
||||
|
||||
RxBool isOnUpload = false.obs;
|
||||
|
||||
RxDouble presentUpload = 0.0.obs;
|
||||
RxList<String> routesName = RxList();
|
||||
RxInt selectedSegmentIndex = 0.obs;
|
||||
|
||||
RxnString searchedValue = RxnString();
|
||||
Rx<Jalali> fromDateFilter = Jalali.now().obs;
|
||||
Rx<Jalali> toDateFilter = Jalali.now().obs;
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
|
||||
routesName.value = ['اقدام'].toList();
|
||||
|
||||
ever(selectedSegmentIndex, (callback) {
|
||||
routesName.removeLast();
|
||||
routesName.add(callback == 0 ? 'بازرسی' : 'بایگانی');
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
super.onReady();
|
||||
|
||||
getReport();
|
||||
}
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
super.onClose();
|
||||
baseLogic.clearSearch();
|
||||
}
|
||||
|
||||
Future<void> getReport([bool isLoadingMore = false]) async {
|
||||
if (isLoadingMore) {
|
||||
isLoadingMoreAllocationsMade.value = true;
|
||||
} else {
|
||||
submitInspectionList.value =
|
||||
Resource<PaginationModel<PoultryScienceReport>>.loading();
|
||||
}
|
||||
|
||||
if (searchedValue.value != null &&
|
||||
searchedValue.value!.trim().isNotEmpty &&
|
||||
currentPage.value > 1) {
|
||||
currentPage.value = 1;
|
||||
}
|
||||
|
||||
safeCall(
|
||||
call: () async =>
|
||||
await rootLogic.cityJahadRepository.getSubmitInspectionList(
|
||||
token: rootLogic.tokenService.accessToken.value!,
|
||||
queryParameters: buildQueryParams(
|
||||
role: 'CityJahad',
|
||||
pageSize: 50,
|
||||
search: 'filter',
|
||||
|
||||
page: currentPage.value,
|
||||
),
|
||||
),
|
||||
onSuccess: (res) {
|
||||
if ((res?.count ?? 0) == 0) {
|
||||
submitInspectionList.value =
|
||||
Resource<PaginationModel<PoultryScienceReport>>.empty();
|
||||
} else {
|
||||
submitInspectionList.value =
|
||||
Resource<PaginationModel<PoultryScienceReport>>.success(
|
||||
PaginationModel<PoultryScienceReport>(
|
||||
count: res?.count ?? 0,
|
||||
next: res?.next,
|
||||
previous: res?.previous,
|
||||
results: [
|
||||
...(submitInspectionList.value.data?.results ?? []),
|
||||
...(res?.results ?? []),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> pickImages() async {
|
||||
determineCurrentPosition();
|
||||
var tmp = await pickCameraImage();
|
||||
if (tmp?.path != null && pickedImages.length < 7) {
|
||||
pickedImages.add(tmp!);
|
||||
}
|
||||
}
|
||||
|
||||
void removeImage(int index) {
|
||||
pickedImages.removeAt(index);
|
||||
}
|
||||
|
||||
void closeBottomSheet() {
|
||||
Get.back();
|
||||
}
|
||||
|
||||
double calculateUploadProgress({required int sent, required int total}) {
|
||||
if (total != 0) {
|
||||
double progress = (sent * 100 / total) / 100;
|
||||
return progress;
|
||||
} else {
|
||||
return 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
void toggleExpanded(int index) {
|
||||
expandedIndex.value = expandedIndex.value == index ? -1 : index;
|
||||
}
|
||||
|
||||
void setSearchValue(String? data) {
|
||||
dLog('Search Value: $data');
|
||||
searchedValue.value = data?.trim();
|
||||
getReport();
|
||||
}
|
||||
|
||||
Future<void> onRefresh() async {
|
||||
currentPage.value = 1;
|
||||
await getReport();
|
||||
}
|
||||
|
||||
String getStatus(PoultryScienceReport item) {
|
||||
final status = item.reportInformation?.inspectionStatus ?? item.state;
|
||||
if (status == null || status.isEmpty) {
|
||||
return 'در حال بررسی';
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
Color getStatusColor(PoultryScienceReport item) {
|
||||
final status = item.reportInformation?.inspectionStatus ?? item.state;
|
||||
if (status == null || status.isEmpty) {
|
||||
return AppColor.yellowNormal;
|
||||
}
|
||||
// میتوانید منطق رنگ را بر اساس inspectionStatus تنظیم کنید
|
||||
return AppColor.greenNormal;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,84 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:rasadyar_chicken/data/di/chicken_di.dart';
|
||||
import 'package:rasadyar_chicken/features/city_jahad/data/repositories/city_jahad_repository.dart';
|
||||
import 'package:rasadyar_chicken/features/city_jahad/presentation/routes/pages.dart';
|
||||
import 'package:rasadyar_chicken/features/city_jahad/presentation/routes/routes.dart';
|
||||
import 'package:rasadyar_chicken/features/city_jahad/presentation/pages/home/view.dart';
|
||||
import 'package:rasadyar_chicken/features/common/presentation/page/profile/view.dart';
|
||||
import 'package:rasadyar_chicken/presentation/utils/nested_keys_utils.dart';
|
||||
import 'package:rasadyar_chicken/presentation/utils/utils.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
enum ErrorLocationType { serviceDisabled, permissionDenied, none }
|
||||
|
||||
class CityJahadRootLogic extends GetxController {
|
||||
var tokenService = Get.find<TokenStorageService>();
|
||||
|
||||
late CityJahadRepository cityJahadRepository;
|
||||
|
||||
RxList<ErrorLocationType> errorLocationType = RxList();
|
||||
RxMap<int, dynamic> homeExpandedList = RxMap();
|
||||
DateTime? _lastBackPressed;
|
||||
|
||||
RxInt currentPage = 0.obs;
|
||||
|
||||
final pages = [
|
||||
Navigator(
|
||||
key: Get.nestedKey(cityJahadActionKey),
|
||||
onGenerateRoute: (settings) {
|
||||
final page = CityJahadPages.pages.firstWhere(
|
||||
(e) => e.name == settings.name,
|
||||
orElse: () => CityJahadPages.pages.firstWhere(
|
||||
(e) => e.name == CityJahadRoutes.homeCityJahad,
|
||||
),
|
||||
);
|
||||
|
||||
return buildRouteFromGetPage(page);
|
||||
},
|
||||
),
|
||||
|
||||
ProfilePage(),
|
||||
];
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
cityJahadRepository = diChicken.get<CityJahadRepository>();
|
||||
}
|
||||
|
||||
void toggleExpanded(int index) {
|
||||
if (homeExpandedList.keys.contains(index)) {
|
||||
homeExpandedList.remove(index);
|
||||
} else {
|
||||
homeExpandedList[index] = false;
|
||||
}
|
||||
}
|
||||
|
||||
void rootErrorHandler(DioException error) {
|
||||
handleGeneric(error, () {
|
||||
tokenService.deleteModuleTokens(Module.chicken);
|
||||
});
|
||||
}
|
||||
|
||||
void changePage(int index) {
|
||||
currentPage.value = index;
|
||||
}
|
||||
|
||||
void popBackTaped() async {
|
||||
final now = DateTime.now();
|
||||
if (_lastBackPressed == null ||
|
||||
now.difference(_lastBackPressed!) > Duration(seconds: 2)) {
|
||||
_lastBackPressed = now;
|
||||
Get.snackbar(
|
||||
'خروج از برنامه',
|
||||
'برای خروج دوباره بازگشت را بزنید',
|
||||
snackPosition: SnackPosition.TOP,
|
||||
duration: Duration(seconds: 2),
|
||||
backgroundColor: AppColor.warning,
|
||||
);
|
||||
} else {
|
||||
await SystemNavigator.pop();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_chicken/presentation/utils/nested_keys_utils.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
import 'logic.dart';
|
||||
|
||||
class CityJahadRootPage extends GetView<CityJahadRootLogic> {
|
||||
const CityJahadRootPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ChickenBasePage(
|
||||
isFullScreen: true,
|
||||
onPopScopTaped: controller.popBackTaped,
|
||||
child: ObxValue((data) {
|
||||
return Stack(
|
||||
children: [
|
||||
IndexedStack(children: controller.pages, index: data.value),
|
||||
Positioned(
|
||||
right: 0,
|
||||
left: 0,
|
||||
bottom: 0,
|
||||
child: RBottomNavigation(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||
items: [
|
||||
|
||||
RBottomNavigationItem(
|
||||
label: 'خانه',
|
||||
icon: Assets.vec.homeSvg.path,
|
||||
isSelected: controller.currentPage.value == 0,
|
||||
onTap: () {
|
||||
Get.nestedKey(
|
||||
cityJahadActionKey,
|
||||
)?.currentState?.popUntil((route) => route.isFirst);
|
||||
controller.changePage(0);
|
||||
},
|
||||
),
|
||||
RBottomNavigationItem(
|
||||
label: 'پروفایل',
|
||||
icon: Assets.vec.profileCircleSvg.path,
|
||||
isSelected: controller.currentPage.value == 1,
|
||||
onTap: () {
|
||||
Get.nestedKey(
|
||||
cityJahadActionKey,
|
||||
)?.currentState?.popUntil((route) => route.isFirst);
|
||||
controller.changePage(1);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}, controller.currentPage),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
import 'package:rasadyar_chicken/features/city_jahad/presentation/pages/home/logic.dart';
|
||||
import 'package:rasadyar_chicken/features/city_jahad/presentation/pages/home/view.dart';
|
||||
import 'package:rasadyar_chicken/features/city_jahad/presentation/pages/root/logic.dart';
|
||||
import 'package:rasadyar_chicken/features/city_jahad/presentation/pages/root/view.dart';
|
||||
import 'package:rasadyar_chicken/features/city_jahad/presentation/pages/active_hatching/logic.dart';
|
||||
import 'package:rasadyar_chicken/features/city_jahad/presentation/pages/active_hatching/view.dart';
|
||||
import 'package:rasadyar_chicken/features/city_jahad/presentation/pages/new_inspection/logic.dart';
|
||||
import 'package:rasadyar_chicken/features/city_jahad/presentation/pages/new_inspection/view.dart';
|
||||
import 'package:rasadyar_chicken/features/city_jahad/presentation/routes/routes.dart';
|
||||
import 'package:rasadyar_chicken/features/poultry_science/presentation/widgets/submit_inspection_bottom_sheet/create_inspection_bottom_sheet_logic.dart';
|
||||
import 'package:rasadyar_chicken/presentation/routes/global_binding.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/base_page/logic.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
class CityJahadPages {
|
||||
CityJahadPages._();
|
||||
|
||||
static List<GetPage> get pages => [
|
||||
GetPage(
|
||||
name: CityJahadRoutes.initCityJahad,
|
||||
page: () => CityJahadRootPage(),
|
||||
middlewares: [AuthMiddleware()],
|
||||
bindings: [
|
||||
GlobalBinding(),
|
||||
BindingsBuilder(() {
|
||||
Get.lazyPut(() => ChickenBaseLogic(), fenix: true);
|
||||
Get.lazyPut(() => CityJahadRootLogic());
|
||||
Get.lazyPut(() => CityJahadHomeLogic());
|
||||
}),
|
||||
],
|
||||
),
|
||||
GetPage(
|
||||
name: CityJahadRoutes.homeCityJahad,
|
||||
page: () => CityJahadHomePage(),
|
||||
middlewares: [AuthMiddleware()],
|
||||
binding: BindingsBuilder(() {
|
||||
Get.put(CityJahadHomeLogic());
|
||||
Get.lazyPut(() => ChickenBaseLogic());
|
||||
}),
|
||||
),
|
||||
|
||||
GetPage(
|
||||
name: CityJahadRoutes.activeHatchingCityJahad,
|
||||
page: () => ActiveHatchingPage(),
|
||||
middlewares: [AuthMiddleware()],
|
||||
bindings: [
|
||||
GlobalBinding(),
|
||||
BindingsBuilder(() {
|
||||
Get.lazyPut(() => ActiveHatchingLogic());
|
||||
Get.lazyPut(() => CreateInspectionBottomSheetLogic());
|
||||
}),
|
||||
],
|
||||
),
|
||||
GetPage(
|
||||
name: CityJahadRoutes.newInspectionCityJahad,
|
||||
page: () => NewInspectionPage(),
|
||||
middlewares: [AuthMiddleware()],
|
||||
bindings: [
|
||||
GlobalBinding(),
|
||||
BindingsBuilder(() {
|
||||
Get.lazyPut(() => NewInspectionLogic());
|
||||
}),
|
||||
],
|
||||
),
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
sealed class CityJahadRoutes {
|
||||
CityJahadRoutes._();
|
||||
|
||||
static const _base = '/chicken/cityJahad';
|
||||
static const initCityJahad = '$_base/';
|
||||
static const homeCityJahad = '$_base/home';
|
||||
static const actionCityJahad = '$_base/action';
|
||||
static const activeHatchingCityJahad = '$_base/activeHatching';
|
||||
static const newInspectionCityJahad = '$_base/newInspection';
|
||||
}
|
||||
@@ -4,10 +4,11 @@ import 'dart:io';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_chicken/data/common/dio_error_handler.dart';
|
||||
import 'package:rasadyar_chicken/data/di/chicken_di.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/user_info/user_info_model.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/user_profile_model/user_profile_model.dart';
|
||||
import 'package:rasadyar_chicken/data/repositories/auth/auth_repository.dart';
|
||||
import 'package:rasadyar_chicken/presentation/routes/routes.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/user_info/user_info_model.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/user_profile_model/user_profile_model.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/repositories/auth/auth_repository.dart';
|
||||
import 'package:rasadyar_chicken/features/common/presentation/routes/routes.dart';
|
||||
import 'package:rasadyar_chicken/features/steward/presentation/routes/routes.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/captcha/logic.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
@@ -28,7 +29,8 @@ class AuthLogic extends GetxController with GetTickerProviderStateMixin {
|
||||
Rx<GlobalKey<FormState>> formKeySentOtp = GlobalKey<FormState>().obs;
|
||||
Rx<TextEditingController> usernameController = TextEditingController().obs;
|
||||
Rx<TextEditingController> passwordController = TextEditingController().obs;
|
||||
Rx<TextEditingController> phoneOtpNumberController = TextEditingController().obs;
|
||||
Rx<TextEditingController> phoneOtpNumberController =
|
||||
TextEditingController().obs;
|
||||
Rx<TextEditingController> otpCodeController = TextEditingController().obs;
|
||||
|
||||
var captchaController = Get.find<CaptchaWidgetLogic>();
|
||||
@@ -56,12 +58,18 @@ class AuthLogic extends GetxController with GetTickerProviderStateMixin {
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
_textAnimationController =
|
||||
AnimationController(vsync: this, duration: const Duration(milliseconds: 1200))
|
||||
AnimationController(
|
||||
vsync: this,
|
||||
duration: const Duration(milliseconds: 1200),
|
||||
)
|
||||
..repeat(reverse: true, count: 2).whenComplete(() {
|
||||
showCard.value = true;
|
||||
});
|
||||
|
||||
textAnimation = CurvedAnimation(parent: _textAnimationController, curve: Curves.easeInOut);
|
||||
textAnimation = CurvedAnimation(
|
||||
parent: _textAnimationController,
|
||||
curve: Curves.easeInOut,
|
||||
);
|
||||
|
||||
initUserPassData();
|
||||
getDeviceModel();
|
||||
@@ -98,7 +106,8 @@ class AuthLogic extends GetxController with GetTickerProviderStateMixin {
|
||||
}
|
||||
|
||||
bool _isFormValid() {
|
||||
final isCaptchaValid = captchaController.formKey.currentState?.validate() ?? false;
|
||||
final isCaptchaValid =
|
||||
captchaController.formKey.currentState?.validate() ?? false;
|
||||
final isFormValid = formKey.currentState?.validate() ?? false;
|
||||
return isCaptchaValid && isFormValid;
|
||||
}
|
||||
@@ -117,13 +126,33 @@ class AuthLogic extends GetxController with GetTickerProviderStateMixin {
|
||||
onSuccess: (result) async {
|
||||
await gService.saveSelectedModule(_module);
|
||||
await tokenStorageService.saveModule(_module);
|
||||
await tokenStorageService.saveAccessToken(_module, result?.accessToken ?? '');
|
||||
await tokenStorageService.saveRefreshToken(_module, result?.accessToken ?? '');
|
||||
await tokenStorageService.saveAccessToken(
|
||||
_module,
|
||||
result?.accessToken ?? '',
|
||||
);
|
||||
await tokenStorageService.saveRefreshToken(
|
||||
_module,
|
||||
result?.accessToken ?? '',
|
||||
);
|
||||
var tmpRoles = result?.role?.where((element) {
|
||||
final allowedRoles = {'poultryscience', 'steward', 'killhouse'};
|
||||
final allowedRoles = {
|
||||
'poultryscience',
|
||||
'steward',
|
||||
'killhouse',
|
||||
'provinceinspector',
|
||||
'cityjahad',
|
||||
'jahad',
|
||||
'vetfarm',
|
||||
'provincesupervisor',
|
||||
'superadmin',
|
||||
};
|
||||
|
||||
final lowerElement = element.toString().toLowerCase().trim();
|
||||
return allowedRoles.contains(lowerElement);
|
||||
}).toList();
|
||||
if (tmpRoles?.length==1) {
|
||||
await tokenStorageService.saveRoles(_module, tmpRoles ?? []);
|
||||
}
|
||||
|
||||
await tokenStorageService.saveRoles(_module, tmpRoles ?? []);
|
||||
if (rememberMe.value) {
|
||||
@@ -142,11 +171,15 @@ class AuthLogic extends GetxController with GetTickerProviderStateMixin {
|
||||
},
|
||||
);
|
||||
|
||||
if (tmpRoles!.length > 1) {
|
||||
Get.offAndToNamed(ChickenRoutes.role);
|
||||
|
||||
Get.offAndToNamed(CommonRoutes.role);
|
||||
|
||||
|
||||
/* if (tmpRoles!.length > 1) {
|
||||
Get.offAndToNamed(CommonRoutes.role);
|
||||
} else {
|
||||
Get.offAllNamed(ChickenRoutes.initSteward);
|
||||
}
|
||||
Get.offAllNamed(StewardRoutes.initSteward);
|
||||
} */
|
||||
},
|
||||
onError: (error, stackTrace) {
|
||||
if (error is DioException) {
|
||||
@@ -183,7 +216,9 @@ class AuthLogic extends GetxController with GetTickerProviderStateMixin {
|
||||
}
|
||||
|
||||
void initUserPassData() {
|
||||
UserLocalModel? userLocalModel = tokenStorageService.getUserLocal(Module.chicken);
|
||||
UserLocalModel? userLocalModel = tokenStorageService.getUserLocal(
|
||||
Module.chicken,
|
||||
);
|
||||
if (userLocalModel?.username != null && userLocalModel?.password != null) {
|
||||
usernameController.value.text = userLocalModel?.username ?? '';
|
||||
passwordController.value.text = userLocalModel?.password ?? '';
|
||||
@@ -196,18 +231,14 @@ class AuthLogic extends GetxController with GetTickerProviderStateMixin {
|
||||
|
||||
if (Platform.isAndroid) {
|
||||
final info = await deviceInfo.androidInfo;
|
||||
print('Device: ${info.manufacturer} ${info.model}');
|
||||
print('Android version: ${info.version.release}');
|
||||
|
||||
deviceName.value =
|
||||
'Device:${info.manufacturer} Model:${info.model} version ${info.version.release}';
|
||||
} else if (Platform.isIOS) {
|
||||
final info = await deviceInfo.iosInfo;
|
||||
print('Device: ${info.utsname.machine} (${info.name})');
|
||||
print('System version: ${info.systemVersion}');
|
||||
|
||||
deviceName.value =
|
||||
'Device:${info.utsname.machine} Model:${info.model} version ${info.systemVersion}';
|
||||
} else {
|
||||
print('Unsupported platform');
|
||||
}
|
||||
} else {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,12 +43,16 @@ class AuthPage extends GetView<AuthLogic> {
|
||||
Text(
|
||||
'به سامانه رصدطیور خوش آمدید!',
|
||||
textAlign: TextAlign.right,
|
||||
style: AppFonts.yekan25Bold.copyWith(color: AppColor.darkGreyDarkActive),
|
||||
style: AppFonts.yekan25Bold.copyWith(
|
||||
color: AppColor.darkGreyDarkActive,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'سامانه رصد و پایش زنجیره تامین، تولید و توزیع کالا های اساسی',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan16.copyWith(color: AppColor.darkGreyDarkActive),
|
||||
style: AppFonts.yekan16.copyWith(
|
||||
color: AppColor.darkGreyDarkActive,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -80,7 +84,9 @@ class AuthPage extends GetView<AuthLogic> {
|
||||
vecPath: Assets.vec.rasadToyorSvg.path,
|
||||
width: 85.w,
|
||||
height: 85.h,
|
||||
titleStyle: AppFonts.yekan20Bold.copyWith(color: Color(0xFF4665AF)),
|
||||
titleStyle: AppFonts.yekan20Bold.copyWith(
|
||||
color: Color(0xFF4665AF),
|
||||
),
|
||||
title: 'رصدطیور',
|
||||
),
|
||||
SizedBox(height: 20.h),
|
||||
@@ -91,7 +97,9 @@ class AuthPage extends GetView<AuthLogic> {
|
||||
children: [
|
||||
TextSpan(
|
||||
text: 'مطالعه بیانیه ',
|
||||
style: AppFonts.yekan16.copyWith(color: AppColor.darkGreyDark),
|
||||
style: AppFonts.yekan16.copyWith(
|
||||
color: AppColor.darkGreyDark,
|
||||
),
|
||||
),
|
||||
TextSpan(
|
||||
recognizer: TapGestureRecognizer()
|
||||
@@ -104,7 +112,9 @@ class AuthPage extends GetView<AuthLogic> {
|
||||
);
|
||||
},
|
||||
text: 'حریم خصوصی',
|
||||
style: AppFonts.yekan16.copyWith(color: AppColor.blueNormal),
|
||||
style: AppFonts.yekan16.copyWith(
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -128,6 +138,7 @@ class AuthPage extends GetView<AuthLogic> {
|
||||
child: Column(
|
||||
children: [
|
||||
RTextField(
|
||||
height: 40.h,
|
||||
label: 'نام کاربری',
|
||||
maxLength: 11,
|
||||
maxLines: 1,
|
||||
@@ -150,7 +161,8 @@ class AuthPage extends GetView<AuthLogic> {
|
||||
padding: const EdgeInsets.fromLTRB(0, 8, 6, 8),
|
||||
child: Assets.vec.callSvg.svg(width: 12, height: 12),
|
||||
),
|
||||
suffixIcon: controller.usernameController.value.text.trim().isNotEmpty
|
||||
suffixIcon:
|
||||
controller.usernameController.value.text.trim().isNotEmpty
|
||||
? clearButton(() {
|
||||
controller.usernameController.value.clear();
|
||||
controller.usernameController.refresh();
|
||||
@@ -165,7 +177,9 @@ class AuthPage extends GetView<AuthLogic> {
|
||||
return null;
|
||||
},
|
||||
style: AppFonts.yekan13,
|
||||
errorStyle: AppFonts.yekan13.copyWith(color: AppColor.redNormal),
|
||||
errorStyle: AppFonts.yekan13.copyWith(
|
||||
color: AppColor.redNormal,
|
||||
),
|
||||
labelStyle: AppFonts.yekan13,
|
||||
boxConstraints: const BoxConstraints(
|
||||
maxHeight: 40,
|
||||
@@ -177,6 +191,7 @@ class AuthPage extends GetView<AuthLogic> {
|
||||
const SizedBox(height: 26),
|
||||
ObxValue(
|
||||
(passwordController) => RTextField(
|
||||
height: 40.h,
|
||||
label: 'رمز عبور',
|
||||
filled: false,
|
||||
obscure: true,
|
||||
@@ -199,7 +214,9 @@ class AuthPage extends GetView<AuthLogic> {
|
||||
return null;
|
||||
},
|
||||
style: AppFonts.yekan13,
|
||||
errorStyle: AppFonts.yekan13.copyWith(color: AppColor.redNormal),
|
||||
errorStyle: AppFonts.yekan13.copyWith(
|
||||
color: AppColor.redNormal,
|
||||
),
|
||||
labelStyle: AppFonts.yekan13,
|
||||
prefixIcon: Padding(
|
||||
padding: const EdgeInsets.fromLTRB(0, 8, 8, 8),
|
||||
@@ -226,19 +243,26 @@ class AuthPage extends GetView<AuthLogic> {
|
||||
ObxValue((data) {
|
||||
return Checkbox(
|
||||
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||
visualDensity: VisualDensity(horizontal: -4, vertical: 4),
|
||||
visualDensity: VisualDensity(
|
||||
horizontal: -4,
|
||||
vertical: 4,
|
||||
),
|
||||
tristate: true,
|
||||
value: data.value,
|
||||
onChanged: (value) {
|
||||
data.value = value ?? false;
|
||||
},
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(4)),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
),
|
||||
activeColor: AppColor.blueNormal,
|
||||
);
|
||||
}, controller.rememberMe),
|
||||
Text(
|
||||
'مرا به خاطر بسپار',
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDark),
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDark,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -283,11 +307,16 @@ class AuthPage extends GetView<AuthLogic> {
|
||||
children: [
|
||||
Text(
|
||||
'بيانيه حريم خصوصی',
|
||||
style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal),
|
||||
style: AppFonts.yekan16Bold.copyWith(
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'اطلاعات مربوط به هر شخص، حریم خصوصی وی محسوب میشود. حفاظت و حراست از اطلاعات شخصی در سامانه رصد یار، نه تنها موجب حفظ امنیت کاربران میشود، بلکه باعث اعتماد بیشتر و مشارکت آنها در فعالیتهای جاری میگردد. هدف از این بیانیه، آگاه ساختن شما درباره ی نوع و نحوه ی استفاده از اطلاعاتی است که در هنگام استفاده از سامانه رصد یار ، از جانب شما دریافت میگردد. شرکت هوشمند سازان خود را ملزم به رعایت حریم خصوصی همه شهروندان و کاربران سامانه دانسته و آن دسته از اطلاعات کاربران را که فقط به منظور ارائه خدمات کفایت میکند، دریافت کرده و از انتشار آن یا در اختیار قرار دادن آن به دیگران خودداری مینماید.',
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.bgDark, height: 1.8),
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.bgDark,
|
||||
height: 1.8,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -307,7 +336,9 @@ class AuthPage extends GetView<AuthLogic> {
|
||||
children: [
|
||||
Text(
|
||||
'چگونگی جمع آوری و استفاده از اطلاعات کاربران',
|
||||
style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal),
|
||||
style: AppFonts.yekan16Bold.copyWith(
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'''الف: اطلاعاتی که شما خود در اختيار این سامانه قرار میدهيد، شامل موارد زيرهستند:
|
||||
@@ -319,7 +350,10 @@ class AuthPage extends GetView<AuthLogic> {
|
||||
⦁ تعداد بازدیدهای روزانه در درگاه.
|
||||
⦁ هدف ما از دریافت این اطلاعات استفاده از آنها در تحلیل عملکرد کاربران درگاه می باشد تا بتوانیم در خدمت رسانی بهتر عمل کنیم.
|
||||
''',
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.bgDark, height: 1.8),
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.bgDark,
|
||||
height: 1.8,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -339,11 +373,16 @@ class AuthPage extends GetView<AuthLogic> {
|
||||
children: [
|
||||
Text(
|
||||
'امنیت اطلاعات',
|
||||
style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal),
|
||||
style: AppFonts.yekan16Bold.copyWith(
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'متعهدیم که امنیت اطلاعات شما را تضمین نماییم و برای جلوگیری از هر نوع دسترسی غیرمجاز و افشای اطلاعات شما از همه شیوههای لازم استفاده میکنیم تا امنیت اطلاعاتی را که به صورت آنلاین گردآوری میکنیم، حفظ شود. لازم به ذکر است در سامانه ما، ممکن است به سایت های دیگری لینک شوید، وقتی که شما از طریق این لینکها از سامانه ما خارج میشوید، توجه داشته باشید که ما بر دیگر سایت ها کنترل نداریم و سازمان تعهدی بر حفظ حریم شخصی آنان در سایت مقصد نخواهد داشت و مراجعه کنندگان میبایست به بیانیه حریم شخصی آن سایت ها مراجعه نمایند.',
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.bgDark, height: 1.8),
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.bgDark,
|
||||
height: 1.8,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
2
packages/chicken/lib/features/common/common.dart
Normal file
2
packages/chicken/lib/features/common/common.dart
Normal file
@@ -0,0 +1,2 @@
|
||||
export 'presentation/routes/routes.dart';
|
||||
export 'presentation/routes/pages.dart';
|
||||
@@ -0,0 +1,8 @@
|
||||
import 'package:rasadyar_chicken/features/common/data/model/local/widely_used_local_model.dart';
|
||||
|
||||
abstract class ChickenLocalDataSource {
|
||||
Future<void> openBox();
|
||||
Future<void> initWidleyUsed();
|
||||
|
||||
WidelyUsedLocalModel? getAllWidely();
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
import 'package:rasadyar_chicken/features/common/data/model/local/widely_used_local_model.dart';
|
||||
import 'package:rasadyar_chicken/features/steward/presentation/routes/routes.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
import 'chicken_local.dart';
|
||||
|
||||
class ChickenLocalDataSourceImp implements ChickenLocalDataSource {
|
||||
HiveLocalStorage local = diCore.get<HiveLocalStorage>();
|
||||
final String boxName = 'Chicken_Widley_Box';
|
||||
|
||||
@override
|
||||
Future<void> openBox() async {
|
||||
await local.openBox<WidelyUsedLocalModel>(boxName);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> initWidleyUsed() async {
|
||||
/* List<WidelyUsedLocalItem> tmpList = [
|
||||
WidelyUsedLocalItem(
|
||||
index: 0,
|
||||
pathId: 0,
|
||||
title: 'خرید داخل استان',
|
||||
color: AppColor.greenLightActive.toARGB32(),
|
||||
iconColor: AppColor.greenNormal.toARGB32(),
|
||||
iconPath: Assets.vec.cubeSearchSvg.path,
|
||||
path: StewardRoutes.buysInProvinceSteward,
|
||||
),
|
||||
WidelyUsedLocalItem(
|
||||
index: 1,
|
||||
pathId: 1,
|
||||
title: 'فروش داخل استان',
|
||||
color: AppColor.blueLightActive.toARGB32(),
|
||||
iconColor: AppColor.blueNormal.toARGB32(),
|
||||
iconPath: Assets.vec.cubeSvg.path,
|
||||
path: StewardRoutes.salesInProvinceSteward,
|
||||
),
|
||||
|
||||
WidelyUsedLocalItem(
|
||||
index: 2,
|
||||
title: 'قطعهبندی',
|
||||
color: AppColor.blueLightActive.toARGB32(),
|
||||
iconColor: AppColor.blueNormal.toARGB32(),
|
||||
iconPath: Assets.vec.cubeRotateSvg.path,
|
||||
path: StewardRoutes.buysInProvinceSteward,
|
||||
),
|
||||
]; */
|
||||
}
|
||||
|
||||
@override
|
||||
WidelyUsedLocalModel? getAllWidely() {
|
||||
var res = local.readBox<WidelyUsedLocalModel>(boxName: boxName);
|
||||
return res?.isNotEmpty == true ? res!.first : null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/user_info/user_info_model.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/user_profile_model/user_profile_model.dart';
|
||||
|
||||
abstract class AuthRemoteDataSource {
|
||||
Future<UserProfileModel?> login({required Map<String, dynamic> authRequest});
|
||||
|
||||
Future<void> logout();
|
||||
|
||||
Future<bool> hasAuthenticated();
|
||||
|
||||
Future<UserInfoModel?> getUserInfo(String phoneNumber);
|
||||
|
||||
|
||||
Future<void> stewardAppLogin({required String token, Map<String, dynamic>? queryParameters});
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/user_info/user_info_model.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/user_profile_model/user_profile_model.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
import 'auth_remote.dart';
|
||||
|
||||
class AuthRemoteDataSourceImp extends AuthRemoteDataSource {
|
||||
final DioRemote _httpClient;
|
||||
final String _BASE_URL = 'auth/api/v1/';
|
||||
|
||||
AuthRemoteDataSourceImp(this._httpClient);
|
||||
|
||||
@override
|
||||
Future<UserProfileModel?> login({
|
||||
required Map<String, dynamic> authRequest,
|
||||
}) async {
|
||||
var res = await _httpClient.post<UserProfileModel?>(
|
||||
'/api/login/',
|
||||
data: authRequest,
|
||||
fromJson: UserProfileModel.fromJson,
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> logout() {
|
||||
// TODO: implement logout
|
||||
throw UnimplementedError();
|
||||
}
|
||||
|
||||
@override
|
||||
Future<bool> hasAuthenticated() async {
|
||||
final response = await _httpClient.get<bool>(
|
||||
'$_BASE_URL/login/',
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
);
|
||||
|
||||
return response.data ?? false;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<UserInfoModel?> getUserInfo(String phoneNumber) async {
|
||||
var res = await _httpClient.post<UserInfoModel?>(
|
||||
'https://userbackend.rasadyar.com/api/send_otp/',
|
||||
data: {"mobile": phoneNumber, "state": ""},
|
||||
fromJson: UserInfoModel.fromJson,
|
||||
headers: {'Content-Type': 'application/json'},
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> stewardAppLogin({
|
||||
required String token,
|
||||
Map<String, dynamic>? queryParameters,
|
||||
}) async {
|
||||
await _httpClient.post(
|
||||
'/steward-app-login/',
|
||||
data: queryParameters,
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Authorization': 'Bearer $token',
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,75 @@
|
||||
import 'package:rasadyar_chicken/features/common/data/model/request/change_password/change_password_request_model.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/bar_information/bar_information.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/broadcast_price/broadcast_price.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/guild/guild_model.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/guild_profile/guild_profile.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/inventory/inventory_model.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/iran_province_city/iran_province_city_model.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/kill_house_distribution_info/kill_house_distribution_info.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/roles_products/roles_products.dart';
|
||||
import 'package:rasadyar_chicken/features/steward/data/model/response/segmentation_model/segmentation_model.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/user_profile/user_profile.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
abstract class CommonRemoteDatasource {
|
||||
Future<List<InventoryModel>?> getInventory({
|
||||
required String token,
|
||||
CancelToken? cancelToken,
|
||||
});
|
||||
|
||||
Future<KillHouseDistributionInfo?> getKillHouseDistributionInfo({
|
||||
required String token,
|
||||
});
|
||||
|
||||
Future<BarInformation?> getGeneralBarInformation({
|
||||
required String token,
|
||||
Map<String, dynamic>? queryParameters,
|
||||
});
|
||||
|
||||
Future<List<ProductModel>?> getRolesProducts({required String token});
|
||||
|
||||
Future<List<GuildModel>?> getGuilds({
|
||||
required String token,
|
||||
Map<String, dynamic>? queryParameters,
|
||||
});
|
||||
|
||||
Future<GuildProfile?> getProfile({required String token});
|
||||
|
||||
Future<List<IranProvinceCityModel>?> getProvince({CancelToken? cancelToken});
|
||||
|
||||
Future<List<IranProvinceCityModel>?> getCity({required String provinceName});
|
||||
|
||||
Future<UserProfile?> getUserProfile({required String token});
|
||||
|
||||
Future<void> updateUserProfile({
|
||||
required String token,
|
||||
required UserProfile userProfile,
|
||||
});
|
||||
|
||||
Future<void> updatePassword({
|
||||
required String token,
|
||||
required ChangePasswordRequestModel model,
|
||||
});
|
||||
|
||||
Future<PaginationModel<SegmentationModel>?> getSegmentation({
|
||||
required String token,
|
||||
Map<String, dynamic>? queryParameters,
|
||||
});
|
||||
|
||||
Future<void> createSegmentation({
|
||||
required String token,
|
||||
required SegmentationModel model,
|
||||
});
|
||||
|
||||
Future<void> editSegmentation({
|
||||
required String token,
|
||||
required SegmentationModel model,
|
||||
});
|
||||
|
||||
Future<SegmentationModel?> deleteSegmentation({
|
||||
required String token,
|
||||
required String key,
|
||||
});
|
||||
|
||||
Future<BroadcastPrice?> getBroadcastPrice({required String token});
|
||||
}
|
||||
@@ -0,0 +1,238 @@
|
||||
import 'package:rasadyar_chicken/features/common/data/model/request/change_password/change_password_request_model.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/bar_information/bar_information.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/broadcast_price/broadcast_price.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/guild/guild_model.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/guild_profile/guild_profile.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/inventory/inventory_model.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/iran_province_city/iran_province_city_model.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/kill_house_distribution_info/kill_house_distribution_info.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/roles_products/roles_products.dart';
|
||||
import 'package:rasadyar_chicken/features/steward/data/model/response/segmentation_model/segmentation_model.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/user_profile/user_profile.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
import 'common_remote.dart';
|
||||
|
||||
class CommonRemoteDatasourceImp implements CommonRemoteDatasource {
|
||||
final DioRemote _httpClient;
|
||||
|
||||
CommonRemoteDatasourceImp(this._httpClient);
|
||||
|
||||
@override
|
||||
Future<List<InventoryModel>?> getInventory({
|
||||
required String token,
|
||||
CancelToken? cancelToken,
|
||||
}) 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?> getKillHouseDistributionInfo({
|
||||
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,
|
||||
Map<String, dynamic>? queryParameters,
|
||||
}) async {
|
||||
var res = await _httpClient.get(
|
||||
'/bars_for_kill_house_dashboard/',
|
||||
queryParameters: queryParameters,
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
fromJson: BarInformation.fromJson,
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
@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,
|
||||
Map<String, dynamic>? queryParameters,
|
||||
}) async {
|
||||
var res = await _httpClient.get(
|
||||
'/guilds/',
|
||||
queryParameters: queryParameters,
|
||||
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<List<IranProvinceCityModel>?> getCity({
|
||||
required String provinceName,
|
||||
}) async {
|
||||
var res = await _httpClient.get(
|
||||
'/iran_city/',
|
||||
queryParameters: {'name': provinceName},
|
||||
fromJsonList: (json) => json
|
||||
.map(
|
||||
(item) =>
|
||||
IranProvinceCityModel.fromJson(item as Map<String, dynamic>),
|
||||
)
|
||||
.toList(),
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<IranProvinceCityModel>?> getProvince({
|
||||
CancelToken? cancelToken,
|
||||
}) async {
|
||||
var res = await _httpClient.get(
|
||||
'/iran_province/',
|
||||
fromJsonList: (json) => json
|
||||
.map(
|
||||
(item) =>
|
||||
IranProvinceCityModel.fromJson(item as Map<String, dynamic>),
|
||||
)
|
||||
.toList(),
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<UserProfile?> getUserProfile({required String token}) async {
|
||||
var res = await _httpClient.get(
|
||||
'/system_user_profile/?self-profile',
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
fromJson: (json) => UserProfile.fromJson(json),
|
||||
);
|
||||
|
||||
return res.data;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> updateUserProfile({
|
||||
required String token,
|
||||
required UserProfile userProfile,
|
||||
}) async {
|
||||
await _httpClient.put(
|
||||
'/system_user_profile/0/',
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
data: userProfile.toJson()..removeWhere((key, value) => value == null),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> updatePassword({
|
||||
required String token,
|
||||
required ChangePasswordRequestModel model,
|
||||
}) async {
|
||||
await _httpClient.post(
|
||||
'/api/change_password/',
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
data: model.toJson()..removeWhere((key, value) => value == null),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<PaginationModel<SegmentationModel>?> getSegmentation({
|
||||
required String token,
|
||||
Map<String, dynamic>? queryParameters,
|
||||
}) async {
|
||||
var res = await _httpClient.get(
|
||||
'/app-segmentation/',
|
||||
queryParameters: queryParameters,
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
fromJson: (json) => PaginationModel<SegmentationModel>.fromJson(
|
||||
json,
|
||||
(json) => SegmentationModel.fromJson(json as Map<String, dynamic>),
|
||||
),
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> createSegmentation({
|
||||
required String token,
|
||||
required SegmentationModel model,
|
||||
}) async {
|
||||
await _httpClient.post(
|
||||
'/app-segmentation/',
|
||||
data: model.toJson()..removeWhere((key, value) => value == null),
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> editSegmentation({
|
||||
required String token,
|
||||
required SegmentationModel model,
|
||||
}) async {
|
||||
await _httpClient.put(
|
||||
'/app-segmentation/0/',
|
||||
data: model.toJson()..removeWhere((key, value) => value == null),
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<SegmentationModel?> deleteSegmentation({
|
||||
required String token,
|
||||
required String key,
|
||||
}) async {
|
||||
var res = await _httpClient.delete<SegmentationModel?>(
|
||||
'/app-segmentation/0/',
|
||||
queryParameters: {'key': key},
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
fromJson: (json) => SegmentationModel.fromJson(json),
|
||||
);
|
||||
|
||||
return res.data;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<BroadcastPrice?> getBroadcastPrice({required String token}) async {
|
||||
var res = await _httpClient.get(
|
||||
'/broadcast-price/',
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
|
||||
fromJson: (json) => BroadcastPrice.fromJson(json),
|
||||
);
|
||||
|
||||
return res.data;
|
||||
}
|
||||
}
|
||||
66
packages/chicken/lib/features/common/data/di/common_di.dart
Normal file
66
packages/chicken/lib/features/common/data/di/common_di.dart
Normal file
@@ -0,0 +1,66 @@
|
||||
import 'package:rasadyar_chicken/features/common/data/datasources/local/chicken_local.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/datasources/local/chicken_local_imp.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/datasources/remote/auth/auth_remote.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/datasources/remote/auth/auth_remote_imp.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/datasources/remote/common/common_remote.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/datasources/remote/common/common_remote_imp.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/repositories/auth/auth_repository.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/repositories/auth/auth_repository_imp.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/repositories/common/common_repository.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/repositories/common/common_repository_imp.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
/// Setup dependency injection for common feature
|
||||
Future<void> setupCommonDI(GetIt di, DioRemote dioRemote) async {
|
||||
di.registerLazySingleton<AuthRemoteDataSource>(
|
||||
() => AuthRemoteDataSourceImp(dioRemote),
|
||||
);
|
||||
|
||||
di.registerLazySingleton<AuthRepository>(
|
||||
() => AuthRepositoryImpl(di.get<AuthRemoteDataSource>()),
|
||||
);
|
||||
|
||||
di.registerLazySingleton<CommonRemoteDatasource>(
|
||||
() => CommonRemoteDatasourceImp(dioRemote),
|
||||
);
|
||||
|
||||
di.registerLazySingleton<ChickenLocalDataSource>(
|
||||
() => ChickenLocalDataSourceImp(),
|
||||
);
|
||||
|
||||
di.registerLazySingleton<CommonRepository>(
|
||||
() => CommonRepositoryImp(
|
||||
remote: di.get<CommonRemoteDatasource>(),
|
||||
local: di.get<ChickenLocalDataSource>(),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/// Re-register common dependencies (used when base URL changes)
|
||||
Future<void> reRegisterCommonDI(GetIt di, DioRemote dioRemote) async {
|
||||
await reRegister(di, () => AuthRemoteDataSourceImp(dioRemote));
|
||||
await reRegister(
|
||||
di,
|
||||
() => AuthRepositoryImpl(di.get<AuthRemoteDataSource>()),
|
||||
);
|
||||
await reRegister(di, () => CommonRemoteDatasourceImp(dioRemote));
|
||||
await reRegister(di, () => ChickenLocalDataSourceImp());
|
||||
await reRegister(
|
||||
di,
|
||||
() => CommonRepositoryImp(
|
||||
remote: di.get<CommonRemoteDatasource>(),
|
||||
local: di.get<ChickenLocalDataSource>(),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
/// Helper function to re-register a dependency
|
||||
Future<void> reRegister<T extends Object>(
|
||||
GetIt di,
|
||||
T Function() factory,
|
||||
) async {
|
||||
if (di.isRegistered<T>()) {
|
||||
await di.unregister<T>();
|
||||
}
|
||||
di.registerLazySingleton<T>(factory);
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
part 'widely_used_local_model.g.dart';
|
||||
|
||||
@HiveType(typeId: chickenWidelyUsedLocalModelTypeId)
|
||||
class WidelyUsedLocalModel extends HiveObject {
|
||||
@HiveField(0)
|
||||
bool? hasInit;
|
||||
|
||||
@HiveField(1)
|
||||
List<WidelyUsedLocalItem>? items;
|
||||
|
||||
WidelyUsedLocalModel({this.hasInit, this.items});
|
||||
|
||||
WidelyUsedLocalModel copyWith({bool? hasInit, List<WidelyUsedLocalItem>? items}) {
|
||||
return WidelyUsedLocalModel(hasInit: hasInit ?? this.hasInit, items: items ?? this.items);
|
||||
}
|
||||
}
|
||||
|
||||
@HiveType(typeId: chickenWidelyUsedLocalItemTypeId)
|
||||
class WidelyUsedLocalItem extends HiveObject {
|
||||
@HiveField(0)
|
||||
String? title;
|
||||
|
||||
@HiveField(1)
|
||||
String? iconPath;
|
||||
|
||||
@HiveField(2)
|
||||
int? iconColor;
|
||||
|
||||
@HiveField(3)
|
||||
int? color;
|
||||
|
||||
@HiveField(4)
|
||||
String? path;
|
||||
|
||||
@HiveField(5)
|
||||
int? pathId;
|
||||
|
||||
@HiveField(6)
|
||||
int? index;
|
||||
|
||||
WidelyUsedLocalItem({
|
||||
this.title,
|
||||
this.iconPath,
|
||||
this.iconColor,
|
||||
this.color,
|
||||
this.path,
|
||||
this.pathId,
|
||||
this.index,
|
||||
});
|
||||
|
||||
WidelyUsedLocalItem copyWith({
|
||||
String? title,
|
||||
String? iconPath,
|
||||
int? iconColor,
|
||||
int? color,
|
||||
int? pathId,
|
||||
int? index,
|
||||
String? path,
|
||||
}) {
|
||||
return WidelyUsedLocalItem(
|
||||
title: title ?? this.title,
|
||||
iconPath: iconPath ?? this.iconPath,
|
||||
iconColor: iconColor ?? this.iconColor,
|
||||
color: color ?? this.color,
|
||||
path: path ?? this.path,
|
||||
pathId: pathId ?? this.pathId,
|
||||
index: index ?? this.index,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,96 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'widely_used_local_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// TypeAdapterGenerator
|
||||
// **************************************************************************
|
||||
|
||||
class WidelyUsedLocalModelAdapter extends TypeAdapter<WidelyUsedLocalModel> {
|
||||
@override
|
||||
final typeId = 4;
|
||||
|
||||
@override
|
||||
WidelyUsedLocalModel read(BinaryReader reader) {
|
||||
final numOfFields = reader.readByte();
|
||||
final fields = <int, dynamic>{
|
||||
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
||||
};
|
||||
return WidelyUsedLocalModel(
|
||||
hasInit: fields[0] as bool?,
|
||||
items: (fields[1] as List?)?.cast<WidelyUsedLocalItem>(),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void write(BinaryWriter writer, WidelyUsedLocalModel obj) {
|
||||
writer
|
||||
..writeByte(2)
|
||||
..writeByte(0)
|
||||
..write(obj.hasInit)
|
||||
..writeByte(1)
|
||||
..write(obj.items);
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => typeId.hashCode;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
identical(this, other) ||
|
||||
other is WidelyUsedLocalModelAdapter &&
|
||||
runtimeType == other.runtimeType &&
|
||||
typeId == other.typeId;
|
||||
}
|
||||
|
||||
class WidelyUsedLocalItemAdapter extends TypeAdapter<WidelyUsedLocalItem> {
|
||||
@override
|
||||
final typeId = 5;
|
||||
|
||||
@override
|
||||
WidelyUsedLocalItem read(BinaryReader reader) {
|
||||
final numOfFields = reader.readByte();
|
||||
final fields = <int, dynamic>{
|
||||
for (int i = 0; i < numOfFields; i++) reader.readByte(): reader.read(),
|
||||
};
|
||||
return WidelyUsedLocalItem(
|
||||
title: fields[0] as String?,
|
||||
iconPath: fields[1] as String?,
|
||||
iconColor: (fields[2] as num?)?.toInt(),
|
||||
color: (fields[3] as num?)?.toInt(),
|
||||
path: fields[4] as String?,
|
||||
pathId: (fields[5] as num?)?.toInt(),
|
||||
index: (fields[6] as num?)?.toInt(),
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
void write(BinaryWriter writer, WidelyUsedLocalItem obj) {
|
||||
writer
|
||||
..writeByte(7)
|
||||
..writeByte(0)
|
||||
..write(obj.title)
|
||||
..writeByte(1)
|
||||
..write(obj.iconPath)
|
||||
..writeByte(2)
|
||||
..write(obj.iconColor)
|
||||
..writeByte(3)
|
||||
..write(obj.color)
|
||||
..writeByte(4)
|
||||
..write(obj.path)
|
||||
..writeByte(5)
|
||||
..write(obj.pathId)
|
||||
..writeByte(6)
|
||||
..write(obj.index);
|
||||
}
|
||||
|
||||
@override
|
||||
int get hashCode => typeId.hashCode;
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) =>
|
||||
identical(this, other) ||
|
||||
other is WidelyUsedLocalItemAdapter &&
|
||||
runtimeType == other.runtimeType &&
|
||||
typeId == other.typeId;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'change_password_request_model.freezed.dart';
|
||||
part 'change_password_request_model.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class ChangePasswordRequestModel with _$ChangePasswordRequestModel {
|
||||
const factory ChangePasswordRequestModel({
|
||||
String? username,
|
||||
String? password,
|
||||
}) = _ChangePasswordRequestModel;
|
||||
|
||||
factory ChangePasswordRequestModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$ChangePasswordRequestModelFromJson(json);
|
||||
}
|
||||
@@ -0,0 +1,280 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// coverage:ignore-file
|
||||
// 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 'change_password_request_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
/// @nodoc
|
||||
mixin _$ChangePasswordRequestModel {
|
||||
|
||||
String? get username; String? get password;
|
||||
/// Create a copy of ChangePasswordRequestModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$ChangePasswordRequestModelCopyWith<ChangePasswordRequestModel> get copyWith => _$ChangePasswordRequestModelCopyWithImpl<ChangePasswordRequestModel>(this as ChangePasswordRequestModel, _$identity);
|
||||
|
||||
/// Serializes this ChangePasswordRequestModel to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is ChangePasswordRequestModel&&(identical(other.username, username) || other.username == username)&&(identical(other.password, password) || other.password == password));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,username,password);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ChangePasswordRequestModel(username: $username, password: $password)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $ChangePasswordRequestModelCopyWith<$Res> {
|
||||
factory $ChangePasswordRequestModelCopyWith(ChangePasswordRequestModel value, $Res Function(ChangePasswordRequestModel) _then) = _$ChangePasswordRequestModelCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
String? username, String? password
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$ChangePasswordRequestModelCopyWithImpl<$Res>
|
||||
implements $ChangePasswordRequestModelCopyWith<$Res> {
|
||||
_$ChangePasswordRequestModelCopyWithImpl(this._self, this._then);
|
||||
|
||||
final ChangePasswordRequestModel _self;
|
||||
final $Res Function(ChangePasswordRequestModel) _then;
|
||||
|
||||
/// Create a copy of ChangePasswordRequestModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? username = freezed,Object? password = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
username: freezed == username ? _self.username : username // ignore: cast_nullable_to_non_nullable
|
||||
as String?,password: freezed == password ? _self.password : password // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [ChangePasswordRequestModel].
|
||||
extension ChangePasswordRequestModelPatterns on ChangePasswordRequestModel {
|
||||
/// A variant of `map` that fallback to returning `orElse`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _ChangePasswordRequestModel value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _ChangePasswordRequestModel() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// Callbacks receives the raw object, upcasted.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case final Subclass2 value:
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _ChangePasswordRequestModel value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _ChangePasswordRequestModel():
|
||||
return $default(_that);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `map` that fallback to returning `null`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _ChangePasswordRequestModel value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _ChangePasswordRequestModel() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to an `orElse` callback.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String? username, String? password)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _ChangePasswordRequestModel() when $default != null:
|
||||
return $default(_that.username,_that.password);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// As opposed to `map`, this offers destructuring.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case Subclass2(:final field2):
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String? username, String? password) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _ChangePasswordRequestModel():
|
||||
return $default(_that.username,_that.password);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to returning `null`
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String? username, String? password)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _ChangePasswordRequestModel() when $default != null:
|
||||
return $default(_that.username,_that.password);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
|
||||
class _ChangePasswordRequestModel implements ChangePasswordRequestModel {
|
||||
const _ChangePasswordRequestModel({this.username, this.password});
|
||||
factory _ChangePasswordRequestModel.fromJson(Map<String, dynamic> json) => _$ChangePasswordRequestModelFromJson(json);
|
||||
|
||||
@override final String? username;
|
||||
@override final String? password;
|
||||
|
||||
/// Create a copy of ChangePasswordRequestModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$ChangePasswordRequestModelCopyWith<_ChangePasswordRequestModel> get copyWith => __$ChangePasswordRequestModelCopyWithImpl<_ChangePasswordRequestModel>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$ChangePasswordRequestModelToJson(this, );
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _ChangePasswordRequestModel&&(identical(other.username, username) || other.username == username)&&(identical(other.password, password) || other.password == password));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,username,password);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'ChangePasswordRequestModel(username: $username, password: $password)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$ChangePasswordRequestModelCopyWith<$Res> implements $ChangePasswordRequestModelCopyWith<$Res> {
|
||||
factory _$ChangePasswordRequestModelCopyWith(_ChangePasswordRequestModel value, $Res Function(_ChangePasswordRequestModel) _then) = __$ChangePasswordRequestModelCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
String? username, String? password
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$ChangePasswordRequestModelCopyWithImpl<$Res>
|
||||
implements _$ChangePasswordRequestModelCopyWith<$Res> {
|
||||
__$ChangePasswordRequestModelCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _ChangePasswordRequestModel _self;
|
||||
final $Res Function(_ChangePasswordRequestModel) _then;
|
||||
|
||||
/// Create a copy of ChangePasswordRequestModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? username = freezed,Object? password = freezed,}) {
|
||||
return _then(_ChangePasswordRequestModel(
|
||||
username: freezed == username ? _self.username : username // ignore: cast_nullable_to_non_nullable
|
||||
as String?,password: freezed == password ? _self.password : password // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// dart format on
|
||||
@@ -0,0 +1,21 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'change_password_request_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_ChangePasswordRequestModel _$ChangePasswordRequestModelFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _ChangePasswordRequestModel(
|
||||
username: json['username'] as String?,
|
||||
password: json['password'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$ChangePasswordRequestModelToJson(
|
||||
_ChangePasswordRequestModel instance,
|
||||
) => <String, dynamic>{
|
||||
'username': instance.username,
|
||||
'password': instance.password,
|
||||
};
|
||||
@@ -0,0 +1,34 @@
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
part 'login_request_model.freezed.dart';
|
||||
part 'login_request_model.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class LoginRequestModel with _$LoginRequestModel {
|
||||
const factory LoginRequestModel({
|
||||
String? username,
|
||||
String? password,
|
||||
String? captchaCode,
|
||||
String? captchaKey,
|
||||
}) = _LoginRequestModel;
|
||||
|
||||
factory LoginRequestModel.createWithCaptcha({
|
||||
required String username,
|
||||
required String password,
|
||||
required String captchaCode,
|
||||
required String captchaKey,
|
||||
}) {
|
||||
return LoginRequestModel(
|
||||
username: username,
|
||||
password: password,
|
||||
captchaCode: captchaCode,
|
||||
captchaKey: 'rest_captcha_$captchaKey.0',
|
||||
);
|
||||
}
|
||||
|
||||
factory LoginRequestModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$LoginRequestModelFromJson(json);
|
||||
|
||||
const LoginRequestModel._();
|
||||
|
||||
}
|
||||
@@ -0,0 +1,286 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// coverage:ignore-file
|
||||
// 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 'login_request_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
/// @nodoc
|
||||
mixin _$LoginRequestModel {
|
||||
|
||||
String? get username; String? get password; String? get captchaCode; String? get captchaKey;
|
||||
/// Create a copy of LoginRequestModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$LoginRequestModelCopyWith<LoginRequestModel> get copyWith => _$LoginRequestModelCopyWithImpl<LoginRequestModel>(this as LoginRequestModel, _$identity);
|
||||
|
||||
/// Serializes this LoginRequestModel to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is LoginRequestModel&&(identical(other.username, username) || other.username == username)&&(identical(other.password, password) || other.password == password)&&(identical(other.captchaCode, captchaCode) || other.captchaCode == captchaCode)&&(identical(other.captchaKey, captchaKey) || other.captchaKey == captchaKey));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,username,password,captchaCode,captchaKey);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'LoginRequestModel(username: $username, password: $password, captchaCode: $captchaCode, captchaKey: $captchaKey)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $LoginRequestModelCopyWith<$Res> {
|
||||
factory $LoginRequestModelCopyWith(LoginRequestModel value, $Res Function(LoginRequestModel) _then) = _$LoginRequestModelCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
String? username, String? password, String? captchaCode, String? captchaKey
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$LoginRequestModelCopyWithImpl<$Res>
|
||||
implements $LoginRequestModelCopyWith<$Res> {
|
||||
_$LoginRequestModelCopyWithImpl(this._self, this._then);
|
||||
|
||||
final LoginRequestModel _self;
|
||||
final $Res Function(LoginRequestModel) _then;
|
||||
|
||||
/// Create a copy of LoginRequestModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? username = freezed,Object? password = freezed,Object? captchaCode = freezed,Object? captchaKey = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
username: freezed == username ? _self.username : username // ignore: cast_nullable_to_non_nullable
|
||||
as String?,password: freezed == password ? _self.password : password // ignore: cast_nullable_to_non_nullable
|
||||
as String?,captchaCode: freezed == captchaCode ? _self.captchaCode : captchaCode // ignore: cast_nullable_to_non_nullable
|
||||
as String?,captchaKey: freezed == captchaKey ? _self.captchaKey : captchaKey // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [LoginRequestModel].
|
||||
extension LoginRequestModelPatterns on LoginRequestModel {
|
||||
/// A variant of `map` that fallback to returning `orElse`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _LoginRequestModel value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _LoginRequestModel() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// Callbacks receives the raw object, upcasted.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case final Subclass2 value:
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _LoginRequestModel value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _LoginRequestModel():
|
||||
return $default(_that);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `map` that fallback to returning `null`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _LoginRequestModel value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _LoginRequestModel() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to an `orElse` callback.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String? username, String? password, String? captchaCode, String? captchaKey)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _LoginRequestModel() when $default != null:
|
||||
return $default(_that.username,_that.password,_that.captchaCode,_that.captchaKey);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// As opposed to `map`, this offers destructuring.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case Subclass2(:final field2):
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String? username, String? password, String? captchaCode, String? captchaKey) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _LoginRequestModel():
|
||||
return $default(_that.username,_that.password,_that.captchaCode,_that.captchaKey);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to returning `null`
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String? username, String? password, String? captchaCode, String? captchaKey)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _LoginRequestModel() when $default != null:
|
||||
return $default(_that.username,_that.password,_that.captchaCode,_that.captchaKey);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
|
||||
class _LoginRequestModel extends LoginRequestModel {
|
||||
const _LoginRequestModel({this.username, this.password, this.captchaCode, this.captchaKey}): super._();
|
||||
factory _LoginRequestModel.fromJson(Map<String, dynamic> json) => _$LoginRequestModelFromJson(json);
|
||||
|
||||
@override final String? username;
|
||||
@override final String? password;
|
||||
@override final String? captchaCode;
|
||||
@override final String? captchaKey;
|
||||
|
||||
/// Create a copy of LoginRequestModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$LoginRequestModelCopyWith<_LoginRequestModel> get copyWith => __$LoginRequestModelCopyWithImpl<_LoginRequestModel>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$LoginRequestModelToJson(this, );
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _LoginRequestModel&&(identical(other.username, username) || other.username == username)&&(identical(other.password, password) || other.password == password)&&(identical(other.captchaCode, captchaCode) || other.captchaCode == captchaCode)&&(identical(other.captchaKey, captchaKey) || other.captchaKey == captchaKey));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,username,password,captchaCode,captchaKey);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'LoginRequestModel(username: $username, password: $password, captchaCode: $captchaCode, captchaKey: $captchaKey)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$LoginRequestModelCopyWith<$Res> implements $LoginRequestModelCopyWith<$Res> {
|
||||
factory _$LoginRequestModelCopyWith(_LoginRequestModel value, $Res Function(_LoginRequestModel) _then) = __$LoginRequestModelCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
String? username, String? password, String? captchaCode, String? captchaKey
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$LoginRequestModelCopyWithImpl<$Res>
|
||||
implements _$LoginRequestModelCopyWith<$Res> {
|
||||
__$LoginRequestModelCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _LoginRequestModel _self;
|
||||
final $Res Function(_LoginRequestModel) _then;
|
||||
|
||||
/// Create a copy of LoginRequestModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? username = freezed,Object? password = freezed,Object? captchaCode = freezed,Object? captchaKey = freezed,}) {
|
||||
return _then(_LoginRequestModel(
|
||||
username: freezed == username ? _self.username : username // ignore: cast_nullable_to_non_nullable
|
||||
as String?,password: freezed == password ? _self.password : password // ignore: cast_nullable_to_non_nullable
|
||||
as String?,captchaCode: freezed == captchaCode ? _self.captchaCode : captchaCode // ignore: cast_nullable_to_non_nullable
|
||||
as String?,captchaKey: freezed == captchaKey ? _self.captchaKey : captchaKey // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// dart format on
|
||||
@@ -0,0 +1,23 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'login_request_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_LoginRequestModel _$LoginRequestModelFromJson(Map<String, dynamic> json) =>
|
||||
_LoginRequestModel(
|
||||
username: json['username'] as String?,
|
||||
password: json['password'] as String?,
|
||||
captchaCode: json['captcha_code'] as String?,
|
||||
captchaKey: json['captcha_key'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$LoginRequestModelToJson(_LoginRequestModel instance) =>
|
||||
<String, dynamic>{
|
||||
'username': instance.username,
|
||||
'password': instance.password,
|
||||
'captcha_code': instance.captchaCode,
|
||||
'captcha_key': instance.captchaKey,
|
||||
};
|
||||
@@ -0,0 +1,29 @@
|
||||
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'submit_kill_house_free_bar.freezed.dart';
|
||||
part 'submit_kill_house_free_bar.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class SubmitKillHouseFreeBar with _$SubmitKillHouseFreeBar {
|
||||
const factory SubmitKillHouseFreeBar({
|
||||
String? driverName,
|
||||
String? driverMobile,
|
||||
String? poultryName,
|
||||
String? poultryMobile,
|
||||
String? province,
|
||||
String? city,
|
||||
String? barClearanceCode,
|
||||
String? barImage,
|
||||
String? killerKey,
|
||||
String? date,
|
||||
String? buyType,
|
||||
String? productKey,
|
||||
String? car,
|
||||
String? numberOfCarcasses,
|
||||
String? weightOfCarcasses,
|
||||
}) = _SubmitKillHouseFreeBar;
|
||||
|
||||
factory SubmitKillHouseFreeBar.fromJson(Map<String, dynamic> json) =>
|
||||
_$SubmitKillHouseFreeBarFromJson(json);
|
||||
}
|
||||
@@ -0,0 +1,319 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// coverage:ignore-file
|
||||
// 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_kill_house_free_bar.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
/// @nodoc
|
||||
mixin _$SubmitKillHouseFreeBar {
|
||||
|
||||
String? get driverName; String? get driverMobile; String? get poultryName; String? get poultryMobile; String? get province; String? get city; String? get barClearanceCode; String? get barImage; String? get killerKey; String? get date; String? get buyType; String? get productKey; String? get car; String? get numberOfCarcasses; String? get weightOfCarcasses;
|
||||
/// Create a copy of SubmitKillHouseFreeBar
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$SubmitKillHouseFreeBarCopyWith<SubmitKillHouseFreeBar> get copyWith => _$SubmitKillHouseFreeBarCopyWithImpl<SubmitKillHouseFreeBar>(this as SubmitKillHouseFreeBar, _$identity);
|
||||
|
||||
/// Serializes this SubmitKillHouseFreeBar to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is SubmitKillHouseFreeBar&&(identical(other.driverName, driverName) || other.driverName == driverName)&&(identical(other.driverMobile, driverMobile) || other.driverMobile == driverMobile)&&(identical(other.poultryName, poultryName) || other.poultryName == poultryName)&&(identical(other.poultryMobile, poultryMobile) || other.poultryMobile == poultryMobile)&&(identical(other.province, province) || other.province == province)&&(identical(other.city, city) || other.city == city)&&(identical(other.barClearanceCode, barClearanceCode) || other.barClearanceCode == barClearanceCode)&&(identical(other.barImage, barImage) || other.barImage == barImage)&&(identical(other.killerKey, killerKey) || other.killerKey == killerKey)&&(identical(other.date, date) || other.date == date)&&(identical(other.buyType, buyType) || other.buyType == buyType)&&(identical(other.productKey, productKey) || other.productKey == productKey)&&(identical(other.car, car) || other.car == car)&&(identical(other.numberOfCarcasses, numberOfCarcasses) || other.numberOfCarcasses == numberOfCarcasses)&&(identical(other.weightOfCarcasses, weightOfCarcasses) || other.weightOfCarcasses == weightOfCarcasses));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,driverName,driverMobile,poultryName,poultryMobile,province,city,barClearanceCode,barImage,killerKey,date,buyType,productKey,car,numberOfCarcasses,weightOfCarcasses);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'SubmitKillHouseFreeBar(driverName: $driverName, driverMobile: $driverMobile, poultryName: $poultryName, poultryMobile: $poultryMobile, province: $province, city: $city, barClearanceCode: $barClearanceCode, barImage: $barImage, killerKey: $killerKey, date: $date, buyType: $buyType, productKey: $productKey, car: $car, numberOfCarcasses: $numberOfCarcasses, weightOfCarcasses: $weightOfCarcasses)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $SubmitKillHouseFreeBarCopyWith<$Res> {
|
||||
factory $SubmitKillHouseFreeBarCopyWith(SubmitKillHouseFreeBar value, $Res Function(SubmitKillHouseFreeBar) _then) = _$SubmitKillHouseFreeBarCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
String? driverName, String? driverMobile, String? poultryName, String? poultryMobile, String? province, String? city, String? barClearanceCode, String? barImage, String? killerKey, String? date, String? buyType, String? productKey, String? car, String? numberOfCarcasses, String? weightOfCarcasses
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$SubmitKillHouseFreeBarCopyWithImpl<$Res>
|
||||
implements $SubmitKillHouseFreeBarCopyWith<$Res> {
|
||||
_$SubmitKillHouseFreeBarCopyWithImpl(this._self, this._then);
|
||||
|
||||
final SubmitKillHouseFreeBar _self;
|
||||
final $Res Function(SubmitKillHouseFreeBar) _then;
|
||||
|
||||
/// Create a copy of SubmitKillHouseFreeBar
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? driverName = freezed,Object? driverMobile = freezed,Object? poultryName = freezed,Object? poultryMobile = freezed,Object? province = freezed,Object? city = freezed,Object? barClearanceCode = freezed,Object? barImage = freezed,Object? killerKey = freezed,Object? date = freezed,Object? buyType = freezed,Object? productKey = freezed,Object? car = freezed,Object? numberOfCarcasses = freezed,Object? weightOfCarcasses = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
driverName: freezed == driverName ? _self.driverName : driverName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,driverMobile: freezed == driverMobile ? _self.driverMobile : driverMobile // ignore: cast_nullable_to_non_nullable
|
||||
as String?,poultryName: freezed == poultryName ? _self.poultryName : poultryName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,poultryMobile: freezed == poultryMobile ? _self.poultryMobile : poultryMobile // ignore: cast_nullable_to_non_nullable
|
||||
as String?,province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable
|
||||
as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable
|
||||
as String?,barClearanceCode: freezed == barClearanceCode ? _self.barClearanceCode : barClearanceCode // ignore: cast_nullable_to_non_nullable
|
||||
as String?,barImage: freezed == barImage ? _self.barImage : barImage // ignore: cast_nullable_to_non_nullable
|
||||
as String?,killerKey: freezed == killerKey ? _self.killerKey : killerKey // ignore: cast_nullable_to_non_nullable
|
||||
as String?,date: freezed == date ? _self.date : date // ignore: cast_nullable_to_non_nullable
|
||||
as String?,buyType: freezed == buyType ? _self.buyType : buyType // ignore: cast_nullable_to_non_nullable
|
||||
as String?,productKey: freezed == productKey ? _self.productKey : productKey // ignore: cast_nullable_to_non_nullable
|
||||
as String?,car: freezed == car ? _self.car : car // ignore: cast_nullable_to_non_nullable
|
||||
as String?,numberOfCarcasses: freezed == numberOfCarcasses ? _self.numberOfCarcasses : numberOfCarcasses // ignore: cast_nullable_to_non_nullable
|
||||
as String?,weightOfCarcasses: freezed == weightOfCarcasses ? _self.weightOfCarcasses : weightOfCarcasses // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [SubmitKillHouseFreeBar].
|
||||
extension SubmitKillHouseFreeBarPatterns on SubmitKillHouseFreeBar {
|
||||
/// A variant of `map` that fallback to returning `orElse`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _SubmitKillHouseFreeBar value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _SubmitKillHouseFreeBar() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// Callbacks receives the raw object, upcasted.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case final Subclass2 value:
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _SubmitKillHouseFreeBar value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _SubmitKillHouseFreeBar():
|
||||
return $default(_that);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `map` that fallback to returning `null`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _SubmitKillHouseFreeBar value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _SubmitKillHouseFreeBar() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to an `orElse` callback.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String? driverName, String? driverMobile, String? poultryName, String? poultryMobile, String? province, String? city, String? barClearanceCode, String? barImage, String? killerKey, String? date, String? buyType, String? productKey, String? car, String? numberOfCarcasses, String? weightOfCarcasses)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _SubmitKillHouseFreeBar() when $default != null:
|
||||
return $default(_that.driverName,_that.driverMobile,_that.poultryName,_that.poultryMobile,_that.province,_that.city,_that.barClearanceCode,_that.barImage,_that.killerKey,_that.date,_that.buyType,_that.productKey,_that.car,_that.numberOfCarcasses,_that.weightOfCarcasses);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// As opposed to `map`, this offers destructuring.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case Subclass2(:final field2):
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String? driverName, String? driverMobile, String? poultryName, String? poultryMobile, String? province, String? city, String? barClearanceCode, String? barImage, String? killerKey, String? date, String? buyType, String? productKey, String? car, String? numberOfCarcasses, String? weightOfCarcasses) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _SubmitKillHouseFreeBar():
|
||||
return $default(_that.driverName,_that.driverMobile,_that.poultryName,_that.poultryMobile,_that.province,_that.city,_that.barClearanceCode,_that.barImage,_that.killerKey,_that.date,_that.buyType,_that.productKey,_that.car,_that.numberOfCarcasses,_that.weightOfCarcasses);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to returning `null`
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String? driverName, String? driverMobile, String? poultryName, String? poultryMobile, String? province, String? city, String? barClearanceCode, String? barImage, String? killerKey, String? date, String? buyType, String? productKey, String? car, String? numberOfCarcasses, String? weightOfCarcasses)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _SubmitKillHouseFreeBar() when $default != null:
|
||||
return $default(_that.driverName,_that.driverMobile,_that.poultryName,_that.poultryMobile,_that.province,_that.city,_that.barClearanceCode,_that.barImage,_that.killerKey,_that.date,_that.buyType,_that.productKey,_that.car,_that.numberOfCarcasses,_that.weightOfCarcasses);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
|
||||
class _SubmitKillHouseFreeBar implements SubmitKillHouseFreeBar {
|
||||
const _SubmitKillHouseFreeBar({this.driverName, this.driverMobile, this.poultryName, this.poultryMobile, this.province, this.city, this.barClearanceCode, this.barImage, this.killerKey, this.date, this.buyType, this.productKey, this.car, this.numberOfCarcasses, this.weightOfCarcasses});
|
||||
factory _SubmitKillHouseFreeBar.fromJson(Map<String, dynamic> json) => _$SubmitKillHouseFreeBarFromJson(json);
|
||||
|
||||
@override final String? driverName;
|
||||
@override final String? driverMobile;
|
||||
@override final String? poultryName;
|
||||
@override final String? poultryMobile;
|
||||
@override final String? province;
|
||||
@override final String? city;
|
||||
@override final String? barClearanceCode;
|
||||
@override final String? barImage;
|
||||
@override final String? killerKey;
|
||||
@override final String? date;
|
||||
@override final String? buyType;
|
||||
@override final String? productKey;
|
||||
@override final String? car;
|
||||
@override final String? numberOfCarcasses;
|
||||
@override final String? weightOfCarcasses;
|
||||
|
||||
/// Create a copy of SubmitKillHouseFreeBar
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$SubmitKillHouseFreeBarCopyWith<_SubmitKillHouseFreeBar> get copyWith => __$SubmitKillHouseFreeBarCopyWithImpl<_SubmitKillHouseFreeBar>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$SubmitKillHouseFreeBarToJson(this, );
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _SubmitKillHouseFreeBar&&(identical(other.driverName, driverName) || other.driverName == driverName)&&(identical(other.driverMobile, driverMobile) || other.driverMobile == driverMobile)&&(identical(other.poultryName, poultryName) || other.poultryName == poultryName)&&(identical(other.poultryMobile, poultryMobile) || other.poultryMobile == poultryMobile)&&(identical(other.province, province) || other.province == province)&&(identical(other.city, city) || other.city == city)&&(identical(other.barClearanceCode, barClearanceCode) || other.barClearanceCode == barClearanceCode)&&(identical(other.barImage, barImage) || other.barImage == barImage)&&(identical(other.killerKey, killerKey) || other.killerKey == killerKey)&&(identical(other.date, date) || other.date == date)&&(identical(other.buyType, buyType) || other.buyType == buyType)&&(identical(other.productKey, productKey) || other.productKey == productKey)&&(identical(other.car, car) || other.car == car)&&(identical(other.numberOfCarcasses, numberOfCarcasses) || other.numberOfCarcasses == numberOfCarcasses)&&(identical(other.weightOfCarcasses, weightOfCarcasses) || other.weightOfCarcasses == weightOfCarcasses));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,driverName,driverMobile,poultryName,poultryMobile,province,city,barClearanceCode,barImage,killerKey,date,buyType,productKey,car,numberOfCarcasses,weightOfCarcasses);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'SubmitKillHouseFreeBar(driverName: $driverName, driverMobile: $driverMobile, poultryName: $poultryName, poultryMobile: $poultryMobile, province: $province, city: $city, barClearanceCode: $barClearanceCode, barImage: $barImage, killerKey: $killerKey, date: $date, buyType: $buyType, productKey: $productKey, car: $car, numberOfCarcasses: $numberOfCarcasses, weightOfCarcasses: $weightOfCarcasses)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$SubmitKillHouseFreeBarCopyWith<$Res> implements $SubmitKillHouseFreeBarCopyWith<$Res> {
|
||||
factory _$SubmitKillHouseFreeBarCopyWith(_SubmitKillHouseFreeBar value, $Res Function(_SubmitKillHouseFreeBar) _then) = __$SubmitKillHouseFreeBarCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
String? driverName, String? driverMobile, String? poultryName, String? poultryMobile, String? province, String? city, String? barClearanceCode, String? barImage, String? killerKey, String? date, String? buyType, String? productKey, String? car, String? numberOfCarcasses, String? weightOfCarcasses
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$SubmitKillHouseFreeBarCopyWithImpl<$Res>
|
||||
implements _$SubmitKillHouseFreeBarCopyWith<$Res> {
|
||||
__$SubmitKillHouseFreeBarCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _SubmitKillHouseFreeBar _self;
|
||||
final $Res Function(_SubmitKillHouseFreeBar) _then;
|
||||
|
||||
/// Create a copy of SubmitKillHouseFreeBar
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? driverName = freezed,Object? driverMobile = freezed,Object? poultryName = freezed,Object? poultryMobile = freezed,Object? province = freezed,Object? city = freezed,Object? barClearanceCode = freezed,Object? barImage = freezed,Object? killerKey = freezed,Object? date = freezed,Object? buyType = freezed,Object? productKey = freezed,Object? car = freezed,Object? numberOfCarcasses = freezed,Object? weightOfCarcasses = freezed,}) {
|
||||
return _then(_SubmitKillHouseFreeBar(
|
||||
driverName: freezed == driverName ? _self.driverName : driverName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,driverMobile: freezed == driverMobile ? _self.driverMobile : driverMobile // ignore: cast_nullable_to_non_nullable
|
||||
as String?,poultryName: freezed == poultryName ? _self.poultryName : poultryName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,poultryMobile: freezed == poultryMobile ? _self.poultryMobile : poultryMobile // ignore: cast_nullable_to_non_nullable
|
||||
as String?,province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable
|
||||
as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable
|
||||
as String?,barClearanceCode: freezed == barClearanceCode ? _self.barClearanceCode : barClearanceCode // ignore: cast_nullable_to_non_nullable
|
||||
as String?,barImage: freezed == barImage ? _self.barImage : barImage // ignore: cast_nullable_to_non_nullable
|
||||
as String?,killerKey: freezed == killerKey ? _self.killerKey : killerKey // ignore: cast_nullable_to_non_nullable
|
||||
as String?,date: freezed == date ? _self.date : date // ignore: cast_nullable_to_non_nullable
|
||||
as String?,buyType: freezed == buyType ? _self.buyType : buyType // ignore: cast_nullable_to_non_nullable
|
||||
as String?,productKey: freezed == productKey ? _self.productKey : productKey // ignore: cast_nullable_to_non_nullable
|
||||
as String?,car: freezed == car ? _self.car : car // ignore: cast_nullable_to_non_nullable
|
||||
as String?,numberOfCarcasses: freezed == numberOfCarcasses ? _self.numberOfCarcasses : numberOfCarcasses // ignore: cast_nullable_to_non_nullable
|
||||
as String?,weightOfCarcasses: freezed == weightOfCarcasses ? _self.weightOfCarcasses : weightOfCarcasses // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// dart format on
|
||||
@@ -0,0 +1,47 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'submit_kill_house_free_bar.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_SubmitKillHouseFreeBar _$SubmitKillHouseFreeBarFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _SubmitKillHouseFreeBar(
|
||||
driverName: json['driver_name'] as String?,
|
||||
driverMobile: json['driver_mobile'] as String?,
|
||||
poultryName: json['poultry_name'] as String?,
|
||||
poultryMobile: json['poultry_mobile'] as String?,
|
||||
province: json['province'] as String?,
|
||||
city: json['city'] as String?,
|
||||
barClearanceCode: json['bar_clearance_code'] as String?,
|
||||
barImage: json['bar_image'] as String?,
|
||||
killerKey: json['killer_key'] as String?,
|
||||
date: json['date'] as String?,
|
||||
buyType: json['buy_type'] as String?,
|
||||
productKey: json['product_key'] as String?,
|
||||
car: json['car'] as String?,
|
||||
numberOfCarcasses: json['number_of_carcasses'] as String?,
|
||||
weightOfCarcasses: json['weight_of_carcasses'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$SubmitKillHouseFreeBarToJson(
|
||||
_SubmitKillHouseFreeBar instance,
|
||||
) => <String, dynamic>{
|
||||
'driver_name': instance.driverName,
|
||||
'driver_mobile': instance.driverMobile,
|
||||
'poultry_name': instance.poultryName,
|
||||
'poultry_mobile': instance.poultryMobile,
|
||||
'province': instance.province,
|
||||
'city': instance.city,
|
||||
'bar_clearance_code': instance.barClearanceCode,
|
||||
'bar_image': instance.barImage,
|
||||
'killer_key': instance.killerKey,
|
||||
'date': instance.date,
|
||||
'buy_type': instance.buyType,
|
||||
'product_key': instance.productKey,
|
||||
'car': instance.car,
|
||||
'number_of_carcasses': instance.numberOfCarcasses,
|
||||
'weight_of_carcasses': instance.weightOfCarcasses,
|
||||
};
|
||||
@@ -0,0 +1,29 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'auth_response_model.freezed.dart';
|
||||
part 'auth_response_model.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class AuthResponseModel with _$AuthResponseModel {
|
||||
const factory AuthResponseModel({
|
||||
String? accessToken,
|
||||
String? expiresIn,
|
||||
String? scope,
|
||||
String? expireTime,
|
||||
String? mobile,
|
||||
String? fullname,
|
||||
String? firstname,
|
||||
String? lastname,
|
||||
String? city,
|
||||
String? province,
|
||||
String? nationalCode,
|
||||
String? nationalId,
|
||||
String? birthday,
|
||||
String? image,
|
||||
int? baseOrder,
|
||||
List<String>? role,
|
||||
}) = _AuthResponseModel;
|
||||
|
||||
factory AuthResponseModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$AuthResponseModelFromJson(json);
|
||||
}
|
||||
@@ -0,0 +1,330 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// coverage:ignore-file
|
||||
// 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 'auth_response_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
/// @nodoc
|
||||
mixin _$AuthResponseModel {
|
||||
|
||||
String? get accessToken; String? get expiresIn; String? get scope; String? get expireTime; String? get mobile; String? get fullname; String? get firstname; String? get lastname; String? get city; String? get province; String? get nationalCode; String? get nationalId; String? get birthday; String? get image; int? get baseOrder; List<String>? get role;
|
||||
/// Create a copy of AuthResponseModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$AuthResponseModelCopyWith<AuthResponseModel> get copyWith => _$AuthResponseModelCopyWithImpl<AuthResponseModel>(this as AuthResponseModel, _$identity);
|
||||
|
||||
/// Serializes this AuthResponseModel to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is AuthResponseModel&&(identical(other.accessToken, accessToken) || other.accessToken == accessToken)&&(identical(other.expiresIn, expiresIn) || other.expiresIn == expiresIn)&&(identical(other.scope, scope) || other.scope == scope)&&(identical(other.expireTime, expireTime) || other.expireTime == expireTime)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.fullname, fullname) || other.fullname == fullname)&&(identical(other.firstname, firstname) || other.firstname == firstname)&&(identical(other.lastname, lastname) || other.lastname == lastname)&&(identical(other.city, city) || other.city == city)&&(identical(other.province, province) || other.province == province)&&(identical(other.nationalCode, nationalCode) || other.nationalCode == nationalCode)&&(identical(other.nationalId, nationalId) || other.nationalId == nationalId)&&(identical(other.birthday, birthday) || other.birthday == birthday)&&(identical(other.image, image) || other.image == image)&&(identical(other.baseOrder, baseOrder) || other.baseOrder == baseOrder)&&const DeepCollectionEquality().equals(other.role, role));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,accessToken,expiresIn,scope,expireTime,mobile,fullname,firstname,lastname,city,province,nationalCode,nationalId,birthday,image,baseOrder,const DeepCollectionEquality().hash(role));
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'AuthResponseModel(accessToken: $accessToken, expiresIn: $expiresIn, scope: $scope, expireTime: $expireTime, mobile: $mobile, fullname: $fullname, firstname: $firstname, lastname: $lastname, city: $city, province: $province, nationalCode: $nationalCode, nationalId: $nationalId, birthday: $birthday, image: $image, baseOrder: $baseOrder, role: $role)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $AuthResponseModelCopyWith<$Res> {
|
||||
factory $AuthResponseModelCopyWith(AuthResponseModel value, $Res Function(AuthResponseModel) _then) = _$AuthResponseModelCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
String? accessToken, String? expiresIn, String? scope, String? expireTime, String? mobile, String? fullname, String? firstname, String? lastname, String? city, String? province, String? nationalCode, String? nationalId, String? birthday, String? image, int? baseOrder, List<String>? role
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$AuthResponseModelCopyWithImpl<$Res>
|
||||
implements $AuthResponseModelCopyWith<$Res> {
|
||||
_$AuthResponseModelCopyWithImpl(this._self, this._then);
|
||||
|
||||
final AuthResponseModel _self;
|
||||
final $Res Function(AuthResponseModel) _then;
|
||||
|
||||
/// Create a copy of AuthResponseModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? accessToken = freezed,Object? expiresIn = freezed,Object? scope = freezed,Object? expireTime = freezed,Object? mobile = freezed,Object? fullname = freezed,Object? firstname = freezed,Object? lastname = freezed,Object? city = freezed,Object? province = freezed,Object? nationalCode = freezed,Object? nationalId = freezed,Object? birthday = freezed,Object? image = freezed,Object? baseOrder = freezed,Object? role = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
accessToken: freezed == accessToken ? _self.accessToken : accessToken // ignore: cast_nullable_to_non_nullable
|
||||
as String?,expiresIn: freezed == expiresIn ? _self.expiresIn : expiresIn // ignore: cast_nullable_to_non_nullable
|
||||
as String?,scope: freezed == scope ? _self.scope : scope // ignore: cast_nullable_to_non_nullable
|
||||
as String?,expireTime: freezed == expireTime ? _self.expireTime : expireTime // ignore: cast_nullable_to_non_nullable
|
||||
as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable
|
||||
as String?,fullname: freezed == fullname ? _self.fullname : fullname // ignore: cast_nullable_to_non_nullable
|
||||
as String?,firstname: freezed == firstname ? _self.firstname : firstname // ignore: cast_nullable_to_non_nullable
|
||||
as String?,lastname: freezed == lastname ? _self.lastname : lastname // ignore: cast_nullable_to_non_nullable
|
||||
as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable
|
||||
as String?,province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable
|
||||
as String?,nationalCode: freezed == nationalCode ? _self.nationalCode : nationalCode // ignore: cast_nullable_to_non_nullable
|
||||
as String?,nationalId: freezed == nationalId ? _self.nationalId : nationalId // ignore: cast_nullable_to_non_nullable
|
||||
as String?,birthday: freezed == birthday ? _self.birthday : birthday // ignore: cast_nullable_to_non_nullable
|
||||
as String?,image: freezed == image ? _self.image : image // ignore: cast_nullable_to_non_nullable
|
||||
as String?,baseOrder: freezed == baseOrder ? _self.baseOrder : baseOrder // ignore: cast_nullable_to_non_nullable
|
||||
as int?,role: freezed == role ? _self.role : role // ignore: cast_nullable_to_non_nullable
|
||||
as List<String>?,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [AuthResponseModel].
|
||||
extension AuthResponseModelPatterns on AuthResponseModel {
|
||||
/// A variant of `map` that fallback to returning `orElse`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _AuthResponseModel value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _AuthResponseModel() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// Callbacks receives the raw object, upcasted.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case final Subclass2 value:
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _AuthResponseModel value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _AuthResponseModel():
|
||||
return $default(_that);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `map` that fallback to returning `null`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _AuthResponseModel value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _AuthResponseModel() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to an `orElse` callback.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String? accessToken, String? expiresIn, String? scope, String? expireTime, String? mobile, String? fullname, String? firstname, String? lastname, String? city, String? province, String? nationalCode, String? nationalId, String? birthday, String? image, int? baseOrder, List<String>? role)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _AuthResponseModel() when $default != null:
|
||||
return $default(_that.accessToken,_that.expiresIn,_that.scope,_that.expireTime,_that.mobile,_that.fullname,_that.firstname,_that.lastname,_that.city,_that.province,_that.nationalCode,_that.nationalId,_that.birthday,_that.image,_that.baseOrder,_that.role);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// As opposed to `map`, this offers destructuring.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case Subclass2(:final field2):
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String? accessToken, String? expiresIn, String? scope, String? expireTime, String? mobile, String? fullname, String? firstname, String? lastname, String? city, String? province, String? nationalCode, String? nationalId, String? birthday, String? image, int? baseOrder, List<String>? role) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _AuthResponseModel():
|
||||
return $default(_that.accessToken,_that.expiresIn,_that.scope,_that.expireTime,_that.mobile,_that.fullname,_that.firstname,_that.lastname,_that.city,_that.province,_that.nationalCode,_that.nationalId,_that.birthday,_that.image,_that.baseOrder,_that.role);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to returning `null`
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String? accessToken, String? expiresIn, String? scope, String? expireTime, String? mobile, String? fullname, String? firstname, String? lastname, String? city, String? province, String? nationalCode, String? nationalId, String? birthday, String? image, int? baseOrder, List<String>? role)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _AuthResponseModel() when $default != null:
|
||||
return $default(_that.accessToken,_that.expiresIn,_that.scope,_that.expireTime,_that.mobile,_that.fullname,_that.firstname,_that.lastname,_that.city,_that.province,_that.nationalCode,_that.nationalId,_that.birthday,_that.image,_that.baseOrder,_that.role);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
|
||||
class _AuthResponseModel implements AuthResponseModel {
|
||||
const _AuthResponseModel({this.accessToken, this.expiresIn, this.scope, this.expireTime, this.mobile, this.fullname, this.firstname, this.lastname, this.city, this.province, this.nationalCode, this.nationalId, this.birthday, this.image, this.baseOrder, final List<String>? role}): _role = role;
|
||||
factory _AuthResponseModel.fromJson(Map<String, dynamic> json) => _$AuthResponseModelFromJson(json);
|
||||
|
||||
@override final String? accessToken;
|
||||
@override final String? expiresIn;
|
||||
@override final String? scope;
|
||||
@override final String? expireTime;
|
||||
@override final String? mobile;
|
||||
@override final String? fullname;
|
||||
@override final String? firstname;
|
||||
@override final String? lastname;
|
||||
@override final String? city;
|
||||
@override final String? province;
|
||||
@override final String? nationalCode;
|
||||
@override final String? nationalId;
|
||||
@override final String? birthday;
|
||||
@override final String? image;
|
||||
@override final int? baseOrder;
|
||||
final List<String>? _role;
|
||||
@override List<String>? get role {
|
||||
final value = _role;
|
||||
if (value == null) return null;
|
||||
if (_role is EqualUnmodifiableListView) return _role;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(value);
|
||||
}
|
||||
|
||||
|
||||
/// Create a copy of AuthResponseModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$AuthResponseModelCopyWith<_AuthResponseModel> get copyWith => __$AuthResponseModelCopyWithImpl<_AuthResponseModel>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$AuthResponseModelToJson(this, );
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _AuthResponseModel&&(identical(other.accessToken, accessToken) || other.accessToken == accessToken)&&(identical(other.expiresIn, expiresIn) || other.expiresIn == expiresIn)&&(identical(other.scope, scope) || other.scope == scope)&&(identical(other.expireTime, expireTime) || other.expireTime == expireTime)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.fullname, fullname) || other.fullname == fullname)&&(identical(other.firstname, firstname) || other.firstname == firstname)&&(identical(other.lastname, lastname) || other.lastname == lastname)&&(identical(other.city, city) || other.city == city)&&(identical(other.province, province) || other.province == province)&&(identical(other.nationalCode, nationalCode) || other.nationalCode == nationalCode)&&(identical(other.nationalId, nationalId) || other.nationalId == nationalId)&&(identical(other.birthday, birthday) || other.birthday == birthday)&&(identical(other.image, image) || other.image == image)&&(identical(other.baseOrder, baseOrder) || other.baseOrder == baseOrder)&&const DeepCollectionEquality().equals(other._role, _role));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,accessToken,expiresIn,scope,expireTime,mobile,fullname,firstname,lastname,city,province,nationalCode,nationalId,birthday,image,baseOrder,const DeepCollectionEquality().hash(_role));
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'AuthResponseModel(accessToken: $accessToken, expiresIn: $expiresIn, scope: $scope, expireTime: $expireTime, mobile: $mobile, fullname: $fullname, firstname: $firstname, lastname: $lastname, city: $city, province: $province, nationalCode: $nationalCode, nationalId: $nationalId, birthday: $birthday, image: $image, baseOrder: $baseOrder, role: $role)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$AuthResponseModelCopyWith<$Res> implements $AuthResponseModelCopyWith<$Res> {
|
||||
factory _$AuthResponseModelCopyWith(_AuthResponseModel value, $Res Function(_AuthResponseModel) _then) = __$AuthResponseModelCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
String? accessToken, String? expiresIn, String? scope, String? expireTime, String? mobile, String? fullname, String? firstname, String? lastname, String? city, String? province, String? nationalCode, String? nationalId, String? birthday, String? image, int? baseOrder, List<String>? role
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$AuthResponseModelCopyWithImpl<$Res>
|
||||
implements _$AuthResponseModelCopyWith<$Res> {
|
||||
__$AuthResponseModelCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _AuthResponseModel _self;
|
||||
final $Res Function(_AuthResponseModel) _then;
|
||||
|
||||
/// Create a copy of AuthResponseModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? accessToken = freezed,Object? expiresIn = freezed,Object? scope = freezed,Object? expireTime = freezed,Object? mobile = freezed,Object? fullname = freezed,Object? firstname = freezed,Object? lastname = freezed,Object? city = freezed,Object? province = freezed,Object? nationalCode = freezed,Object? nationalId = freezed,Object? birthday = freezed,Object? image = freezed,Object? baseOrder = freezed,Object? role = freezed,}) {
|
||||
return _then(_AuthResponseModel(
|
||||
accessToken: freezed == accessToken ? _self.accessToken : accessToken // ignore: cast_nullable_to_non_nullable
|
||||
as String?,expiresIn: freezed == expiresIn ? _self.expiresIn : expiresIn // ignore: cast_nullable_to_non_nullable
|
||||
as String?,scope: freezed == scope ? _self.scope : scope // ignore: cast_nullable_to_non_nullable
|
||||
as String?,expireTime: freezed == expireTime ? _self.expireTime : expireTime // ignore: cast_nullable_to_non_nullable
|
||||
as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable
|
||||
as String?,fullname: freezed == fullname ? _self.fullname : fullname // ignore: cast_nullable_to_non_nullable
|
||||
as String?,firstname: freezed == firstname ? _self.firstname : firstname // ignore: cast_nullable_to_non_nullable
|
||||
as String?,lastname: freezed == lastname ? _self.lastname : lastname // ignore: cast_nullable_to_non_nullable
|
||||
as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable
|
||||
as String?,province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable
|
||||
as String?,nationalCode: freezed == nationalCode ? _self.nationalCode : nationalCode // ignore: cast_nullable_to_non_nullable
|
||||
as String?,nationalId: freezed == nationalId ? _self.nationalId : nationalId // ignore: cast_nullable_to_non_nullable
|
||||
as String?,birthday: freezed == birthday ? _self.birthday : birthday // ignore: cast_nullable_to_non_nullable
|
||||
as String?,image: freezed == image ? _self.image : image // ignore: cast_nullable_to_non_nullable
|
||||
as String?,baseOrder: freezed == baseOrder ? _self.baseOrder : baseOrder // ignore: cast_nullable_to_non_nullable
|
||||
as int?,role: freezed == role ? _self._role : role // ignore: cast_nullable_to_non_nullable
|
||||
as List<String>?,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// dart format on
|
||||
@@ -0,0 +1,47 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'auth_response_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_AuthResponseModel _$AuthResponseModelFromJson(Map<String, dynamic> json) =>
|
||||
_AuthResponseModel(
|
||||
accessToken: json['access_token'] as String?,
|
||||
expiresIn: json['expires_in'] as String?,
|
||||
scope: json['scope'] as String?,
|
||||
expireTime: json['expire_time'] as String?,
|
||||
mobile: json['mobile'] as String?,
|
||||
fullname: json['fullname'] as String?,
|
||||
firstname: json['firstname'] as String?,
|
||||
lastname: json['lastname'] as String?,
|
||||
city: json['city'] as String?,
|
||||
province: json['province'] as String?,
|
||||
nationalCode: json['national_code'] as String?,
|
||||
nationalId: json['national_id'] as String?,
|
||||
birthday: json['birthday'] as String?,
|
||||
image: json['image'] as String?,
|
||||
baseOrder: (json['base_order'] as num?)?.toInt(),
|
||||
role: (json['role'] as List<dynamic>?)?.map((e) => e as String).toList(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$AuthResponseModelToJson(_AuthResponseModel instance) =>
|
||||
<String, dynamic>{
|
||||
'access_token': instance.accessToken,
|
||||
'expires_in': instance.expiresIn,
|
||||
'scope': instance.scope,
|
||||
'expire_time': instance.expireTime,
|
||||
'mobile': instance.mobile,
|
||||
'fullname': instance.fullname,
|
||||
'firstname': instance.firstname,
|
||||
'lastname': instance.lastname,
|
||||
'city': instance.city,
|
||||
'province': instance.province,
|
||||
'national_code': instance.nationalCode,
|
||||
'national_id': instance.nationalId,
|
||||
'birthday': instance.birthday,
|
||||
'image': instance.image,
|
||||
'base_order': instance.baseOrder,
|
||||
'role': instance.role,
|
||||
};
|
||||
@@ -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,310 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// coverage:ignore-file
|
||||
// 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?,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [BarInformation].
|
||||
extension BarInformationPatterns on BarInformation {
|
||||
/// A variant of `map` that fallback to returning `orElse`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _BarInformation value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _BarInformation() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// Callbacks receives the raw object, upcasted.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case final Subclass2 value:
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _BarInformation value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _BarInformation():
|
||||
return $default(_that);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `map` that fallback to returning `null`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _BarInformation value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _BarInformation() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to an `orElse` callback.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( int? totalBars, int? totalBarsQuantity, double? totalBarsWeight, int? totalEnteredBars, int? totalEnteredBarsQuantity, double? totalEnteredBarsWeight, int? totalNotEnteredBars, int? totalNotEnteredBarsQuantity, double? totalNotEnteredKillHouseRequestsWeight, int? totalRejectedBars, int? totalRejectedBarsQuantity, double? totalRejectedBarsWeight)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _BarInformation() when $default != null:
|
||||
return $default(_that.totalBars,_that.totalBarsQuantity,_that.totalBarsWeight,_that.totalEnteredBars,_that.totalEnteredBarsQuantity,_that.totalEnteredBarsWeight,_that.totalNotEnteredBars,_that.totalNotEnteredBarsQuantity,_that.totalNotEnteredKillHouseRequestsWeight,_that.totalRejectedBars,_that.totalRejectedBarsQuantity,_that.totalRejectedBarsWeight);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// As opposed to `map`, this offers destructuring.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case Subclass2(:final field2):
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( int? totalBars, int? totalBarsQuantity, double? totalBarsWeight, int? totalEnteredBars, int? totalEnteredBarsQuantity, double? totalEnteredBarsWeight, int? totalNotEnteredBars, int? totalNotEnteredBarsQuantity, double? totalNotEnteredKillHouseRequestsWeight, int? totalRejectedBars, int? totalRejectedBarsQuantity, double? totalRejectedBarsWeight) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _BarInformation():
|
||||
return $default(_that.totalBars,_that.totalBarsQuantity,_that.totalBarsWeight,_that.totalEnteredBars,_that.totalEnteredBarsQuantity,_that.totalEnteredBarsWeight,_that.totalNotEnteredBars,_that.totalNotEnteredBarsQuantity,_that.totalNotEnteredKillHouseRequestsWeight,_that.totalRejectedBars,_that.totalRejectedBarsQuantity,_that.totalRejectedBarsWeight);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to returning `null`
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( int? totalBars, int? totalBarsQuantity, double? totalBarsWeight, int? totalEnteredBars, int? totalEnteredBarsQuantity, double? totalEnteredBarsWeight, int? totalNotEnteredBars, int? totalNotEnteredBarsQuantity, double? totalNotEnteredKillHouseRequestsWeight, int? totalRejectedBars, int? totalRejectedBarsQuantity, double? totalRejectedBarsWeight)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _BarInformation() when $default != null:
|
||||
return $default(_that.totalBars,_that.totalBarsQuantity,_that.totalBarsWeight,_that.totalEnteredBars,_that.totalEnteredBarsQuantity,_that.totalEnteredBarsWeight,_that.totalNotEnteredBars,_that.totalNotEnteredBarsQuantity,_that.totalNotEnteredKillHouseRequestsWeight,_that.totalRejectedBars,_that.totalRejectedBarsQuantity,_that.totalRejectedBarsWeight);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @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,16 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'broadcast_price.freezed.dart';
|
||||
part 'broadcast_price.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class BroadcastPrice with _$BroadcastPrice {
|
||||
const factory BroadcastPrice({
|
||||
bool? active,
|
||||
int? killHousePrice,
|
||||
int? stewardPrice,
|
||||
int? guildPrice,
|
||||
}) = _BroadcastPrice;
|
||||
|
||||
factory BroadcastPrice.fromJson(Map<String, dynamic> json) => _$BroadcastPriceFromJson(json);
|
||||
}
|
||||
@@ -0,0 +1,286 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// coverage:ignore-file
|
||||
// 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 'broadcast_price.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
/// @nodoc
|
||||
mixin _$BroadcastPrice {
|
||||
|
||||
bool? get active; int? get killHousePrice; int? get stewardPrice; int? get guildPrice;
|
||||
/// Create a copy of BroadcastPrice
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$BroadcastPriceCopyWith<BroadcastPrice> get copyWith => _$BroadcastPriceCopyWithImpl<BroadcastPrice>(this as BroadcastPrice, _$identity);
|
||||
|
||||
/// Serializes this BroadcastPrice to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is BroadcastPrice&&(identical(other.active, active) || other.active == active)&&(identical(other.killHousePrice, killHousePrice) || other.killHousePrice == killHousePrice)&&(identical(other.stewardPrice, stewardPrice) || other.stewardPrice == stewardPrice)&&(identical(other.guildPrice, guildPrice) || other.guildPrice == guildPrice));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,active,killHousePrice,stewardPrice,guildPrice);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'BroadcastPrice(active: $active, killHousePrice: $killHousePrice, stewardPrice: $stewardPrice, guildPrice: $guildPrice)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $BroadcastPriceCopyWith<$Res> {
|
||||
factory $BroadcastPriceCopyWith(BroadcastPrice value, $Res Function(BroadcastPrice) _then) = _$BroadcastPriceCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
bool? active, int? killHousePrice, int? stewardPrice, int? guildPrice
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$BroadcastPriceCopyWithImpl<$Res>
|
||||
implements $BroadcastPriceCopyWith<$Res> {
|
||||
_$BroadcastPriceCopyWithImpl(this._self, this._then);
|
||||
|
||||
final BroadcastPrice _self;
|
||||
final $Res Function(BroadcastPrice) _then;
|
||||
|
||||
/// Create a copy of BroadcastPrice
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? active = freezed,Object? killHousePrice = freezed,Object? stewardPrice = freezed,Object? guildPrice = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
active: freezed == active ? _self.active : active // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,killHousePrice: freezed == killHousePrice ? _self.killHousePrice : killHousePrice // ignore: cast_nullable_to_non_nullable
|
||||
as int?,stewardPrice: freezed == stewardPrice ? _self.stewardPrice : stewardPrice // ignore: cast_nullable_to_non_nullable
|
||||
as int?,guildPrice: freezed == guildPrice ? _self.guildPrice : guildPrice // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [BroadcastPrice].
|
||||
extension BroadcastPricePatterns on BroadcastPrice {
|
||||
/// A variant of `map` that fallback to returning `orElse`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _BroadcastPrice value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _BroadcastPrice() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// Callbacks receives the raw object, upcasted.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case final Subclass2 value:
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _BroadcastPrice value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _BroadcastPrice():
|
||||
return $default(_that);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `map` that fallback to returning `null`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _BroadcastPrice value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _BroadcastPrice() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to an `orElse` callback.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( bool? active, int? killHousePrice, int? stewardPrice, int? guildPrice)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _BroadcastPrice() when $default != null:
|
||||
return $default(_that.active,_that.killHousePrice,_that.stewardPrice,_that.guildPrice);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// As opposed to `map`, this offers destructuring.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case Subclass2(:final field2):
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( bool? active, int? killHousePrice, int? stewardPrice, int? guildPrice) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _BroadcastPrice():
|
||||
return $default(_that.active,_that.killHousePrice,_that.stewardPrice,_that.guildPrice);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to returning `null`
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( bool? active, int? killHousePrice, int? stewardPrice, int? guildPrice)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _BroadcastPrice() when $default != null:
|
||||
return $default(_that.active,_that.killHousePrice,_that.stewardPrice,_that.guildPrice);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
|
||||
class _BroadcastPrice implements BroadcastPrice {
|
||||
const _BroadcastPrice({this.active, this.killHousePrice, this.stewardPrice, this.guildPrice});
|
||||
factory _BroadcastPrice.fromJson(Map<String, dynamic> json) => _$BroadcastPriceFromJson(json);
|
||||
|
||||
@override final bool? active;
|
||||
@override final int? killHousePrice;
|
||||
@override final int? stewardPrice;
|
||||
@override final int? guildPrice;
|
||||
|
||||
/// Create a copy of BroadcastPrice
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$BroadcastPriceCopyWith<_BroadcastPrice> get copyWith => __$BroadcastPriceCopyWithImpl<_BroadcastPrice>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$BroadcastPriceToJson(this, );
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _BroadcastPrice&&(identical(other.active, active) || other.active == active)&&(identical(other.killHousePrice, killHousePrice) || other.killHousePrice == killHousePrice)&&(identical(other.stewardPrice, stewardPrice) || other.stewardPrice == stewardPrice)&&(identical(other.guildPrice, guildPrice) || other.guildPrice == guildPrice));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,active,killHousePrice,stewardPrice,guildPrice);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'BroadcastPrice(active: $active, killHousePrice: $killHousePrice, stewardPrice: $stewardPrice, guildPrice: $guildPrice)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$BroadcastPriceCopyWith<$Res> implements $BroadcastPriceCopyWith<$Res> {
|
||||
factory _$BroadcastPriceCopyWith(_BroadcastPrice value, $Res Function(_BroadcastPrice) _then) = __$BroadcastPriceCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
bool? active, int? killHousePrice, int? stewardPrice, int? guildPrice
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$BroadcastPriceCopyWithImpl<$Res>
|
||||
implements _$BroadcastPriceCopyWith<$Res> {
|
||||
__$BroadcastPriceCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _BroadcastPrice _self;
|
||||
final $Res Function(_BroadcastPrice) _then;
|
||||
|
||||
/// Create a copy of BroadcastPrice
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? active = freezed,Object? killHousePrice = freezed,Object? stewardPrice = freezed,Object? guildPrice = freezed,}) {
|
||||
return _then(_BroadcastPrice(
|
||||
active: freezed == active ? _self.active : active // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,killHousePrice: freezed == killHousePrice ? _self.killHousePrice : killHousePrice // ignore: cast_nullable_to_non_nullable
|
||||
as int?,stewardPrice: freezed == stewardPrice ? _self.stewardPrice : stewardPrice // ignore: cast_nullable_to_non_nullable
|
||||
as int?,guildPrice: freezed == guildPrice ? _self.guildPrice : guildPrice // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// dart format on
|
||||
@@ -0,0 +1,23 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'broadcast_price.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_BroadcastPrice _$BroadcastPriceFromJson(Map<String, dynamic> json) =>
|
||||
_BroadcastPrice(
|
||||
active: json['active'] as bool?,
|
||||
killHousePrice: (json['kill_house_price'] as num?)?.toInt(),
|
||||
stewardPrice: (json['steward_price'] as num?)?.toInt(),
|
||||
guildPrice: (json['guild_price'] as num?)?.toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$BroadcastPriceToJson(_BroadcastPrice instance) =>
|
||||
<String, dynamic>{
|
||||
'active': instance.active,
|
||||
'kill_house_price': instance.killHousePrice,
|
||||
'steward_price': instance.stewardPrice,
|
||||
'guild_price': instance.guildPrice,
|
||||
};
|
||||
@@ -0,0 +1,17 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'captcha_response_model.freezed.dart';
|
||||
part 'captcha_response_model.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class CaptchaResponseModel with _$CaptchaResponseModel {
|
||||
const factory CaptchaResponseModel({
|
||||
String? captchaKey,
|
||||
String? captchaImage,
|
||||
String? imageType,
|
||||
String? imageDecode,
|
||||
}) = _CaptchaResponseModel;
|
||||
|
||||
factory CaptchaResponseModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$CaptchaResponseModelFromJson(json);
|
||||
}
|
||||
@@ -0,0 +1,286 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// coverage:ignore-file
|
||||
// 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 'captcha_response_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
/// @nodoc
|
||||
mixin _$CaptchaResponseModel {
|
||||
|
||||
String? get captchaKey; String? get captchaImage; String? get imageType; String? get imageDecode;
|
||||
/// Create a copy of CaptchaResponseModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$CaptchaResponseModelCopyWith<CaptchaResponseModel> get copyWith => _$CaptchaResponseModelCopyWithImpl<CaptchaResponseModel>(this as CaptchaResponseModel, _$identity);
|
||||
|
||||
/// Serializes this CaptchaResponseModel to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is CaptchaResponseModel&&(identical(other.captchaKey, captchaKey) || other.captchaKey == captchaKey)&&(identical(other.captchaImage, captchaImage) || other.captchaImage == captchaImage)&&(identical(other.imageType, imageType) || other.imageType == imageType)&&(identical(other.imageDecode, imageDecode) || other.imageDecode == imageDecode));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,captchaKey,captchaImage,imageType,imageDecode);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'CaptchaResponseModel(captchaKey: $captchaKey, captchaImage: $captchaImage, imageType: $imageType, imageDecode: $imageDecode)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $CaptchaResponseModelCopyWith<$Res> {
|
||||
factory $CaptchaResponseModelCopyWith(CaptchaResponseModel value, $Res Function(CaptchaResponseModel) _then) = _$CaptchaResponseModelCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
String? captchaKey, String? captchaImage, String? imageType, String? imageDecode
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$CaptchaResponseModelCopyWithImpl<$Res>
|
||||
implements $CaptchaResponseModelCopyWith<$Res> {
|
||||
_$CaptchaResponseModelCopyWithImpl(this._self, this._then);
|
||||
|
||||
final CaptchaResponseModel _self;
|
||||
final $Res Function(CaptchaResponseModel) _then;
|
||||
|
||||
/// Create a copy of CaptchaResponseModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? captchaKey = freezed,Object? captchaImage = freezed,Object? imageType = freezed,Object? imageDecode = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
captchaKey: freezed == captchaKey ? _self.captchaKey : captchaKey // ignore: cast_nullable_to_non_nullable
|
||||
as String?,captchaImage: freezed == captchaImage ? _self.captchaImage : captchaImage // ignore: cast_nullable_to_non_nullable
|
||||
as String?,imageType: freezed == imageType ? _self.imageType : imageType // ignore: cast_nullable_to_non_nullable
|
||||
as String?,imageDecode: freezed == imageDecode ? _self.imageDecode : imageDecode // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [CaptchaResponseModel].
|
||||
extension CaptchaResponseModelPatterns on CaptchaResponseModel {
|
||||
/// A variant of `map` that fallback to returning `orElse`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _CaptchaResponseModel value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _CaptchaResponseModel() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// Callbacks receives the raw object, upcasted.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case final Subclass2 value:
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _CaptchaResponseModel value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _CaptchaResponseModel():
|
||||
return $default(_that);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `map` that fallback to returning `null`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _CaptchaResponseModel value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _CaptchaResponseModel() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to an `orElse` callback.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String? captchaKey, String? captchaImage, String? imageType, String? imageDecode)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _CaptchaResponseModel() when $default != null:
|
||||
return $default(_that.captchaKey,_that.captchaImage,_that.imageType,_that.imageDecode);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// As opposed to `map`, this offers destructuring.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case Subclass2(:final field2):
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String? captchaKey, String? captchaImage, String? imageType, String? imageDecode) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _CaptchaResponseModel():
|
||||
return $default(_that.captchaKey,_that.captchaImage,_that.imageType,_that.imageDecode);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to returning `null`
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String? captchaKey, String? captchaImage, String? imageType, String? imageDecode)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _CaptchaResponseModel() when $default != null:
|
||||
return $default(_that.captchaKey,_that.captchaImage,_that.imageType,_that.imageDecode);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
|
||||
class _CaptchaResponseModel implements CaptchaResponseModel {
|
||||
const _CaptchaResponseModel({this.captchaKey, this.captchaImage, this.imageType, this.imageDecode});
|
||||
factory _CaptchaResponseModel.fromJson(Map<String, dynamic> json) => _$CaptchaResponseModelFromJson(json);
|
||||
|
||||
@override final String? captchaKey;
|
||||
@override final String? captchaImage;
|
||||
@override final String? imageType;
|
||||
@override final String? imageDecode;
|
||||
|
||||
/// Create a copy of CaptchaResponseModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$CaptchaResponseModelCopyWith<_CaptchaResponseModel> get copyWith => __$CaptchaResponseModelCopyWithImpl<_CaptchaResponseModel>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$CaptchaResponseModelToJson(this, );
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _CaptchaResponseModel&&(identical(other.captchaKey, captchaKey) || other.captchaKey == captchaKey)&&(identical(other.captchaImage, captchaImage) || other.captchaImage == captchaImage)&&(identical(other.imageType, imageType) || other.imageType == imageType)&&(identical(other.imageDecode, imageDecode) || other.imageDecode == imageDecode));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,captchaKey,captchaImage,imageType,imageDecode);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'CaptchaResponseModel(captchaKey: $captchaKey, captchaImage: $captchaImage, imageType: $imageType, imageDecode: $imageDecode)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$CaptchaResponseModelCopyWith<$Res> implements $CaptchaResponseModelCopyWith<$Res> {
|
||||
factory _$CaptchaResponseModelCopyWith(_CaptchaResponseModel value, $Res Function(_CaptchaResponseModel) _then) = __$CaptchaResponseModelCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
String? captchaKey, String? captchaImage, String? imageType, String? imageDecode
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$CaptchaResponseModelCopyWithImpl<$Res>
|
||||
implements _$CaptchaResponseModelCopyWith<$Res> {
|
||||
__$CaptchaResponseModelCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _CaptchaResponseModel _self;
|
||||
final $Res Function(_CaptchaResponseModel) _then;
|
||||
|
||||
/// Create a copy of CaptchaResponseModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? captchaKey = freezed,Object? captchaImage = freezed,Object? imageType = freezed,Object? imageDecode = freezed,}) {
|
||||
return _then(_CaptchaResponseModel(
|
||||
captchaKey: freezed == captchaKey ? _self.captchaKey : captchaKey // ignore: cast_nullable_to_non_nullable
|
||||
as String?,captchaImage: freezed == captchaImage ? _self.captchaImage : captchaImage // ignore: cast_nullable_to_non_nullable
|
||||
as String?,imageType: freezed == imageType ? _self.imageType : imageType // ignore: cast_nullable_to_non_nullable
|
||||
as String?,imageDecode: freezed == imageDecode ? _self.imageDecode : imageDecode // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// dart format on
|
||||
@@ -0,0 +1,25 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'captcha_response_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_CaptchaResponseModel _$CaptchaResponseModelFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _CaptchaResponseModel(
|
||||
captchaKey: json['captcha_key'] as String?,
|
||||
captchaImage: json['captcha_image'] as String?,
|
||||
imageType: json['image_type'] as String?,
|
||||
imageDecode: json['image_decode'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$CaptchaResponseModelToJson(
|
||||
_CaptchaResponseModel instance,
|
||||
) => <String, dynamic>{
|
||||
'captcha_key': instance.captchaKey,
|
||||
'captcha_image': instance.captchaImage,
|
||||
'image_type': instance.imageType,
|
||||
'image_decode': instance.imageDecode,
|
||||
};
|
||||
@@ -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,579 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// coverage:ignore-file
|
||||
// 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));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [GuildModel].
|
||||
extension GuildModelPatterns on GuildModel {
|
||||
/// A variant of `map` that fallback to returning `orElse`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _GuildModel value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _GuildModel() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// Callbacks receives the raw object, upcasted.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case final Subclass2 value:
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _GuildModel value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _GuildModel():
|
||||
return $default(_that);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `map` that fallback to returning `null`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _GuildModel value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _GuildModel() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to an `orElse` callback.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String? key, String? guildsName, bool? steward, User? user)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _GuildModel() when $default != null:
|
||||
return $default(_that.key,_that.guildsName,_that.steward,_that.user);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// As opposed to `map`, this offers destructuring.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case Subclass2(:final field2):
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String? key, String? guildsName, bool? steward, User? user) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _GuildModel():
|
||||
return $default(_that.key,_that.guildsName,_that.steward,_that.user);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to returning `null`
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String? key, String? guildsName, bool? steward, User? user)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _GuildModel() when $default != null:
|
||||
return $default(_that.key,_that.guildsName,_that.steward,_that.user);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @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?,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [User].
|
||||
extension UserPatterns on User {
|
||||
/// A variant of `map` that fallback to returning `orElse`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _User value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _User() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// Callbacks receives the raw object, upcasted.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case final Subclass2 value:
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _User value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _User():
|
||||
return $default(_that);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `map` that fallback to returning `null`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _User value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _User() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to an `orElse` callback.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String? fullname, String? mobile, String? city)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _User() when $default != null:
|
||||
return $default(_that.fullname,_that.mobile,_that.city);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// As opposed to `map`, this offers destructuring.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case Subclass2(:final field2):
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String? fullname, String? mobile, String? city) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _User():
|
||||
return $default(_that.fullname,_that.mobile,_that.city);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to returning `null`
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String? fullname, String? mobile, String? city)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _User() when $default != null:
|
||||
return $default(_that.fullname,_that.mobile,_that.city);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @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,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,16 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'iran_province_city_model.freezed.dart';
|
||||
part 'iran_province_city_model.g.dart';
|
||||
|
||||
|
||||
@freezed
|
||||
abstract class IranProvinceCityModel with _$IranProvinceCityModel {
|
||||
const factory IranProvinceCityModel({
|
||||
int? id,
|
||||
String? name,
|
||||
}) = _IranProvinceCityModel;
|
||||
|
||||
factory IranProvinceCityModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$IranProvinceCityModelFromJson(json);
|
||||
}
|
||||
@@ -0,0 +1,280 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// coverage:ignore-file
|
||||
// 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 'iran_province_city_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
/// @nodoc
|
||||
mixin _$IranProvinceCityModel {
|
||||
|
||||
int? get id; String? get name;
|
||||
/// Create a copy of IranProvinceCityModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$IranProvinceCityModelCopyWith<IranProvinceCityModel> get copyWith => _$IranProvinceCityModelCopyWithImpl<IranProvinceCityModel>(this as IranProvinceCityModel, _$identity);
|
||||
|
||||
/// Serializes this IranProvinceCityModel to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is IranProvinceCityModel&&(identical(other.id, id) || other.id == id)&&(identical(other.name, name) || other.name == name));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,id,name);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'IranProvinceCityModel(id: $id, name: $name)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $IranProvinceCityModelCopyWith<$Res> {
|
||||
factory $IranProvinceCityModelCopyWith(IranProvinceCityModel value, $Res Function(IranProvinceCityModel) _then) = _$IranProvinceCityModelCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
int? id, String? name
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$IranProvinceCityModelCopyWithImpl<$Res>
|
||||
implements $IranProvinceCityModelCopyWith<$Res> {
|
||||
_$IranProvinceCityModelCopyWithImpl(this._self, this._then);
|
||||
|
||||
final IranProvinceCityModel _self;
|
||||
final $Res Function(IranProvinceCityModel) _then;
|
||||
|
||||
/// Create a copy of IranProvinceCityModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? name = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
|
||||
as int?,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [IranProvinceCityModel].
|
||||
extension IranProvinceCityModelPatterns on IranProvinceCityModel {
|
||||
/// A variant of `map` that fallback to returning `orElse`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _IranProvinceCityModel value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _IranProvinceCityModel() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// Callbacks receives the raw object, upcasted.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case final Subclass2 value:
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _IranProvinceCityModel value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _IranProvinceCityModel():
|
||||
return $default(_that);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `map` that fallback to returning `null`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _IranProvinceCityModel value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _IranProvinceCityModel() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to an `orElse` callback.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( int? id, String? name)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _IranProvinceCityModel() when $default != null:
|
||||
return $default(_that.id,_that.name);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// As opposed to `map`, this offers destructuring.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case Subclass2(:final field2):
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( int? id, String? name) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _IranProvinceCityModel():
|
||||
return $default(_that.id,_that.name);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to returning `null`
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( int? id, String? name)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _IranProvinceCityModel() when $default != null:
|
||||
return $default(_that.id,_that.name);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
|
||||
class _IranProvinceCityModel implements IranProvinceCityModel {
|
||||
const _IranProvinceCityModel({this.id, this.name});
|
||||
factory _IranProvinceCityModel.fromJson(Map<String, dynamic> json) => _$IranProvinceCityModelFromJson(json);
|
||||
|
||||
@override final int? id;
|
||||
@override final String? name;
|
||||
|
||||
/// Create a copy of IranProvinceCityModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$IranProvinceCityModelCopyWith<_IranProvinceCityModel> get copyWith => __$IranProvinceCityModelCopyWithImpl<_IranProvinceCityModel>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$IranProvinceCityModelToJson(this, );
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _IranProvinceCityModel&&(identical(other.id, id) || other.id == id)&&(identical(other.name, name) || other.name == name));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,id,name);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'IranProvinceCityModel(id: $id, name: $name)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$IranProvinceCityModelCopyWith<$Res> implements $IranProvinceCityModelCopyWith<$Res> {
|
||||
factory _$IranProvinceCityModelCopyWith(_IranProvinceCityModel value, $Res Function(_IranProvinceCityModel) _then) = __$IranProvinceCityModelCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
int? id, String? name
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$IranProvinceCityModelCopyWithImpl<$Res>
|
||||
implements _$IranProvinceCityModelCopyWith<$Res> {
|
||||
__$IranProvinceCityModelCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _IranProvinceCityModel _self;
|
||||
final $Res Function(_IranProvinceCityModel) _then;
|
||||
|
||||
/// Create a copy of IranProvinceCityModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? name = freezed,}) {
|
||||
return _then(_IranProvinceCityModel(
|
||||
id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
|
||||
as int?,name: freezed == name ? _self.name : name // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// dart format on
|
||||
@@ -0,0 +1,18 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'iran_province_city_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_IranProvinceCityModel _$IranProvinceCityModelFromJson(
|
||||
Map<String, dynamic> json,
|
||||
) => _IranProvinceCityModel(
|
||||
id: (json['id'] as num?)?.toInt(),
|
||||
name: json['name'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$IranProvinceCityModelToJson(
|
||||
_IranProvinceCityModel instance,
|
||||
) => <String, dynamic>{'id': instance.id, 'name': instance.name};
|
||||
@@ -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,280 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// coverage:ignore-file
|
||||
// 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?,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [KillHouseDistributionInfo].
|
||||
extension KillHouseDistributionInfoPatterns on KillHouseDistributionInfo {
|
||||
/// A variant of `map` that fallback to returning `orElse`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _KillHouseDistributionInfo value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _KillHouseDistributionInfo() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// Callbacks receives the raw object, upcasted.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case final Subclass2 value:
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _KillHouseDistributionInfo value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _KillHouseDistributionInfo():
|
||||
return $default(_that);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `map` that fallback to returning `null`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _KillHouseDistributionInfo value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _KillHouseDistributionInfo() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to an `orElse` callback.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( double? stewardAllocationsWeight, double? freeSalesWeight)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _KillHouseDistributionInfo() when $default != null:
|
||||
return $default(_that.stewardAllocationsWeight,_that.freeSalesWeight);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// As opposed to `map`, this offers destructuring.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case Subclass2(:final field2):
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( double? stewardAllocationsWeight, double? freeSalesWeight) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _KillHouseDistributionInfo():
|
||||
return $default(_that.stewardAllocationsWeight,_that.freeSalesWeight);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to returning `null`
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( double? stewardAllocationsWeight, double? freeSalesWeight)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _KillHouseDistributionInfo() when $default != null:
|
||||
return $default(_that.stewardAllocationsWeight,_that.freeSalesWeight);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @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,71 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'kill_house_free_bar.freezed.dart';
|
||||
part 'kill_house_free_bar.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class KillHouseFreeBar with _$KillHouseFreeBar {
|
||||
const factory KillHouseFreeBar({
|
||||
int? id,
|
||||
dynamic killHouse,
|
||||
dynamic exclusiveKiller,
|
||||
String? key,
|
||||
String? createDate,
|
||||
String? modifyDate,
|
||||
bool? trash,
|
||||
String? poultryName,
|
||||
String? poultryMobile,
|
||||
String? sellerName,
|
||||
String? sellerMobile,
|
||||
String? province,
|
||||
String? city,
|
||||
String? vetFarmName,
|
||||
String? vetFarmMobile,
|
||||
String? driverName,
|
||||
String? driverMobile,
|
||||
String? car,
|
||||
String? clearanceCode,
|
||||
String? barClearanceCode,
|
||||
int? quantity,
|
||||
int? numberOfCarcasses,
|
||||
int? weightOfCarcasses,
|
||||
int? killHouseVetQuantity,
|
||||
int? killHouseVetWeight,
|
||||
String? killHouseVetState,
|
||||
String? dateOfAcceptReject,
|
||||
dynamic acceptorRejector,
|
||||
int? liveWeight,
|
||||
String? barImage,
|
||||
String? buyType,
|
||||
bool? wareHouse,
|
||||
String? date,
|
||||
int? wage,
|
||||
int? totalWageAmount,
|
||||
int? unionShare,
|
||||
int? unionSharePercent,
|
||||
int? companyShare,
|
||||
int? companySharePercent,
|
||||
int? guildsShare,
|
||||
int? guildsSharePercent,
|
||||
int? cityShare,
|
||||
int? citySharePercent,
|
||||
int? walletShare,
|
||||
int? walletSharePercent,
|
||||
int? otherShare,
|
||||
int? otherSharePercent,
|
||||
bool? archiveWage,
|
||||
int? weightLoss,
|
||||
bool? calculateStatus,
|
||||
bool? temporaryTrash,
|
||||
bool? temporaryDeleted,
|
||||
String? enteredMessage,
|
||||
int? barCode,
|
||||
String? registerType,
|
||||
dynamic createdBy,
|
||||
dynamic modifiedBy,
|
||||
int? product,
|
||||
}) = _KillHouseFreeBar;
|
||||
|
||||
factory KillHouseFreeBar.fromJson(Map<String, dynamic> json) =>
|
||||
_$KillHouseFreeBarFromJson(json);
|
||||
}
|
||||
@@ -0,0 +1,448 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// coverage:ignore-file
|
||||
// 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_free_bar.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
/// @nodoc
|
||||
mixin _$KillHouseFreeBar {
|
||||
|
||||
int? get id; dynamic get killHouse; dynamic get exclusiveKiller; String? get key; String? get createDate; String? get modifyDate; bool? get trash; String? get poultryName; String? get poultryMobile; String? get sellerName; String? get sellerMobile; String? get province; String? get city; String? get vetFarmName; String? get vetFarmMobile; String? get driverName; String? get driverMobile; String? get car; String? get clearanceCode; String? get barClearanceCode; int? get quantity; int? get numberOfCarcasses; int? get weightOfCarcasses; int? get killHouseVetQuantity; int? get killHouseVetWeight; String? get killHouseVetState; String? get dateOfAcceptReject; dynamic get acceptorRejector; int? get liveWeight; String? get barImage; String? get buyType; bool? get wareHouse; String? get date; int? get wage; int? get totalWageAmount; int? get unionShare; int? get unionSharePercent; int? get companyShare; int? get companySharePercent; int? get guildsShare; int? get guildsSharePercent; int? get cityShare; int? get citySharePercent; int? get walletShare; int? get walletSharePercent; int? get otherShare; int? get otherSharePercent; bool? get archiveWage; int? get weightLoss; bool? get calculateStatus; bool? get temporaryTrash; bool? get temporaryDeleted; String? get enteredMessage; int? get barCode; String? get registerType; dynamic get createdBy; dynamic get modifiedBy; int? get product;
|
||||
/// Create a copy of KillHouseFreeBar
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$KillHouseFreeBarCopyWith<KillHouseFreeBar> get copyWith => _$KillHouseFreeBarCopyWithImpl<KillHouseFreeBar>(this as KillHouseFreeBar, _$identity);
|
||||
|
||||
/// Serializes this KillHouseFreeBar to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is KillHouseFreeBar&&(identical(other.id, id) || other.id == id)&&const DeepCollectionEquality().equals(other.killHouse, killHouse)&&const DeepCollectionEquality().equals(other.exclusiveKiller, exclusiveKiller)&&(identical(other.key, key) || other.key == key)&&(identical(other.createDate, createDate) || other.createDate == createDate)&&(identical(other.modifyDate, modifyDate) || other.modifyDate == modifyDate)&&(identical(other.trash, trash) || other.trash == trash)&&(identical(other.poultryName, poultryName) || other.poultryName == poultryName)&&(identical(other.poultryMobile, poultryMobile) || other.poultryMobile == poultryMobile)&&(identical(other.sellerName, sellerName) || other.sellerName == sellerName)&&(identical(other.sellerMobile, sellerMobile) || other.sellerMobile == sellerMobile)&&(identical(other.province, province) || other.province == province)&&(identical(other.city, city) || other.city == city)&&(identical(other.vetFarmName, vetFarmName) || other.vetFarmName == vetFarmName)&&(identical(other.vetFarmMobile, vetFarmMobile) || other.vetFarmMobile == vetFarmMobile)&&(identical(other.driverName, driverName) || other.driverName == driverName)&&(identical(other.driverMobile, driverMobile) || other.driverMobile == driverMobile)&&(identical(other.car, car) || other.car == car)&&(identical(other.clearanceCode, clearanceCode) || other.clearanceCode == clearanceCode)&&(identical(other.barClearanceCode, barClearanceCode) || other.barClearanceCode == barClearanceCode)&&(identical(other.quantity, quantity) || other.quantity == quantity)&&(identical(other.numberOfCarcasses, numberOfCarcasses) || other.numberOfCarcasses == numberOfCarcasses)&&(identical(other.weightOfCarcasses, weightOfCarcasses) || other.weightOfCarcasses == weightOfCarcasses)&&(identical(other.killHouseVetQuantity, killHouseVetQuantity) || other.killHouseVetQuantity == killHouseVetQuantity)&&(identical(other.killHouseVetWeight, killHouseVetWeight) || other.killHouseVetWeight == killHouseVetWeight)&&(identical(other.killHouseVetState, killHouseVetState) || other.killHouseVetState == killHouseVetState)&&(identical(other.dateOfAcceptReject, dateOfAcceptReject) || other.dateOfAcceptReject == dateOfAcceptReject)&&const DeepCollectionEquality().equals(other.acceptorRejector, acceptorRejector)&&(identical(other.liveWeight, liveWeight) || other.liveWeight == liveWeight)&&(identical(other.barImage, barImage) || other.barImage == barImage)&&(identical(other.buyType, buyType) || other.buyType == buyType)&&(identical(other.wareHouse, wareHouse) || other.wareHouse == wareHouse)&&(identical(other.date, date) || other.date == date)&&(identical(other.wage, wage) || other.wage == wage)&&(identical(other.totalWageAmount, totalWageAmount) || other.totalWageAmount == totalWageAmount)&&(identical(other.unionShare, unionShare) || other.unionShare == unionShare)&&(identical(other.unionSharePercent, unionSharePercent) || other.unionSharePercent == unionSharePercent)&&(identical(other.companyShare, companyShare) || other.companyShare == companyShare)&&(identical(other.companySharePercent, companySharePercent) || other.companySharePercent == companySharePercent)&&(identical(other.guildsShare, guildsShare) || other.guildsShare == guildsShare)&&(identical(other.guildsSharePercent, guildsSharePercent) || other.guildsSharePercent == guildsSharePercent)&&(identical(other.cityShare, cityShare) || other.cityShare == cityShare)&&(identical(other.citySharePercent, citySharePercent) || other.citySharePercent == citySharePercent)&&(identical(other.walletShare, walletShare) || other.walletShare == walletShare)&&(identical(other.walletSharePercent, walletSharePercent) || other.walletSharePercent == walletSharePercent)&&(identical(other.otherShare, otherShare) || other.otherShare == otherShare)&&(identical(other.otherSharePercent, otherSharePercent) || other.otherSharePercent == otherSharePercent)&&(identical(other.archiveWage, archiveWage) || other.archiveWage == archiveWage)&&(identical(other.weightLoss, weightLoss) || other.weightLoss == weightLoss)&&(identical(other.calculateStatus, calculateStatus) || other.calculateStatus == calculateStatus)&&(identical(other.temporaryTrash, temporaryTrash) || other.temporaryTrash == temporaryTrash)&&(identical(other.temporaryDeleted, temporaryDeleted) || other.temporaryDeleted == temporaryDeleted)&&(identical(other.enteredMessage, enteredMessage) || other.enteredMessage == enteredMessage)&&(identical(other.barCode, barCode) || other.barCode == barCode)&&(identical(other.registerType, registerType) || other.registerType == registerType)&&const DeepCollectionEquality().equals(other.createdBy, createdBy)&&const DeepCollectionEquality().equals(other.modifiedBy, modifiedBy)&&(identical(other.product, product) || other.product == product));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hashAll([runtimeType,id,const DeepCollectionEquality().hash(killHouse),const DeepCollectionEquality().hash(exclusiveKiller),key,createDate,modifyDate,trash,poultryName,poultryMobile,sellerName,sellerMobile,province,city,vetFarmName,vetFarmMobile,driverName,driverMobile,car,clearanceCode,barClearanceCode,quantity,numberOfCarcasses,weightOfCarcasses,killHouseVetQuantity,killHouseVetWeight,killHouseVetState,dateOfAcceptReject,const DeepCollectionEquality().hash(acceptorRejector),liveWeight,barImage,buyType,wareHouse,date,wage,totalWageAmount,unionShare,unionSharePercent,companyShare,companySharePercent,guildsShare,guildsSharePercent,cityShare,citySharePercent,walletShare,walletSharePercent,otherShare,otherSharePercent,archiveWage,weightLoss,calculateStatus,temporaryTrash,temporaryDeleted,enteredMessage,barCode,registerType,const DeepCollectionEquality().hash(createdBy),const DeepCollectionEquality().hash(modifiedBy),product]);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'KillHouseFreeBar(id: $id, killHouse: $killHouse, exclusiveKiller: $exclusiveKiller, key: $key, createDate: $createDate, modifyDate: $modifyDate, trash: $trash, poultryName: $poultryName, poultryMobile: $poultryMobile, sellerName: $sellerName, sellerMobile: $sellerMobile, province: $province, city: $city, vetFarmName: $vetFarmName, vetFarmMobile: $vetFarmMobile, driverName: $driverName, driverMobile: $driverMobile, car: $car, clearanceCode: $clearanceCode, barClearanceCode: $barClearanceCode, quantity: $quantity, numberOfCarcasses: $numberOfCarcasses, weightOfCarcasses: $weightOfCarcasses, killHouseVetQuantity: $killHouseVetQuantity, killHouseVetWeight: $killHouseVetWeight, killHouseVetState: $killHouseVetState, dateOfAcceptReject: $dateOfAcceptReject, acceptorRejector: $acceptorRejector, liveWeight: $liveWeight, barImage: $barImage, buyType: $buyType, wareHouse: $wareHouse, date: $date, wage: $wage, totalWageAmount: $totalWageAmount, unionShare: $unionShare, unionSharePercent: $unionSharePercent, companyShare: $companyShare, companySharePercent: $companySharePercent, guildsShare: $guildsShare, guildsSharePercent: $guildsSharePercent, cityShare: $cityShare, citySharePercent: $citySharePercent, walletShare: $walletShare, walletSharePercent: $walletSharePercent, otherShare: $otherShare, otherSharePercent: $otherSharePercent, archiveWage: $archiveWage, weightLoss: $weightLoss, calculateStatus: $calculateStatus, temporaryTrash: $temporaryTrash, temporaryDeleted: $temporaryDeleted, enteredMessage: $enteredMessage, barCode: $barCode, registerType: $registerType, createdBy: $createdBy, modifiedBy: $modifiedBy, product: $product)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $KillHouseFreeBarCopyWith<$Res> {
|
||||
factory $KillHouseFreeBarCopyWith(KillHouseFreeBar value, $Res Function(KillHouseFreeBar) _then) = _$KillHouseFreeBarCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
int? id, dynamic killHouse, dynamic exclusiveKiller, String? key, String? createDate, String? modifyDate, bool? trash, String? poultryName, String? poultryMobile, String? sellerName, String? sellerMobile, String? province, String? city, String? vetFarmName, String? vetFarmMobile, String? driverName, String? driverMobile, String? car, String? clearanceCode, String? barClearanceCode, int? quantity, int? numberOfCarcasses, int? weightOfCarcasses, int? killHouseVetQuantity, int? killHouseVetWeight, String? killHouseVetState, String? dateOfAcceptReject, dynamic acceptorRejector, int? liveWeight, String? barImage, String? buyType, bool? wareHouse, String? date, int? wage, int? totalWageAmount, int? unionShare, int? unionSharePercent, int? companyShare, int? companySharePercent, int? guildsShare, int? guildsSharePercent, int? cityShare, int? citySharePercent, int? walletShare, int? walletSharePercent, int? otherShare, int? otherSharePercent, bool? archiveWage, int? weightLoss, bool? calculateStatus, bool? temporaryTrash, bool? temporaryDeleted, String? enteredMessage, int? barCode, String? registerType, dynamic createdBy, dynamic modifiedBy, int? product
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$KillHouseFreeBarCopyWithImpl<$Res>
|
||||
implements $KillHouseFreeBarCopyWith<$Res> {
|
||||
_$KillHouseFreeBarCopyWithImpl(this._self, this._then);
|
||||
|
||||
final KillHouseFreeBar _self;
|
||||
final $Res Function(KillHouseFreeBar) _then;
|
||||
|
||||
/// Create a copy of KillHouseFreeBar
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? id = freezed,Object? killHouse = freezed,Object? exclusiveKiller = freezed,Object? key = freezed,Object? createDate = freezed,Object? modifyDate = freezed,Object? trash = freezed,Object? poultryName = freezed,Object? poultryMobile = freezed,Object? sellerName = freezed,Object? sellerMobile = freezed,Object? province = freezed,Object? city = freezed,Object? vetFarmName = freezed,Object? vetFarmMobile = freezed,Object? driverName = freezed,Object? driverMobile = freezed,Object? car = freezed,Object? clearanceCode = freezed,Object? barClearanceCode = freezed,Object? quantity = freezed,Object? numberOfCarcasses = freezed,Object? weightOfCarcasses = freezed,Object? killHouseVetQuantity = freezed,Object? killHouseVetWeight = freezed,Object? killHouseVetState = freezed,Object? dateOfAcceptReject = freezed,Object? acceptorRejector = freezed,Object? liveWeight = freezed,Object? barImage = freezed,Object? buyType = freezed,Object? wareHouse = freezed,Object? date = freezed,Object? wage = freezed,Object? totalWageAmount = freezed,Object? unionShare = freezed,Object? unionSharePercent = freezed,Object? companyShare = freezed,Object? companySharePercent = freezed,Object? guildsShare = freezed,Object? guildsSharePercent = freezed,Object? cityShare = freezed,Object? citySharePercent = freezed,Object? walletShare = freezed,Object? walletSharePercent = freezed,Object? otherShare = freezed,Object? otherSharePercent = freezed,Object? archiveWage = freezed,Object? weightLoss = freezed,Object? calculateStatus = freezed,Object? temporaryTrash = freezed,Object? temporaryDeleted = freezed,Object? enteredMessage = freezed,Object? barCode = freezed,Object? registerType = freezed,Object? createdBy = freezed,Object? modifiedBy = freezed,Object? product = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
|
||||
as int?,killHouse: freezed == killHouse ? _self.killHouse : killHouse // ignore: cast_nullable_to_non_nullable
|
||||
as dynamic,exclusiveKiller: freezed == exclusiveKiller ? _self.exclusiveKiller : exclusiveKiller // ignore: cast_nullable_to_non_nullable
|
||||
as dynamic,key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable
|
||||
as String?,createDate: freezed == createDate ? _self.createDate : createDate // ignore: cast_nullable_to_non_nullable
|
||||
as String?,modifyDate: freezed == modifyDate ? _self.modifyDate : modifyDate // ignore: cast_nullable_to_non_nullable
|
||||
as String?,trash: freezed == trash ? _self.trash : trash // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,poultryName: freezed == poultryName ? _self.poultryName : poultryName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,poultryMobile: freezed == poultryMobile ? _self.poultryMobile : poultryMobile // ignore: cast_nullable_to_non_nullable
|
||||
as String?,sellerName: freezed == sellerName ? _self.sellerName : sellerName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,sellerMobile: freezed == sellerMobile ? _self.sellerMobile : sellerMobile // ignore: cast_nullable_to_non_nullable
|
||||
as String?,province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable
|
||||
as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable
|
||||
as String?,vetFarmName: freezed == vetFarmName ? _self.vetFarmName : vetFarmName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,vetFarmMobile: freezed == vetFarmMobile ? _self.vetFarmMobile : vetFarmMobile // ignore: cast_nullable_to_non_nullable
|
||||
as String?,driverName: freezed == driverName ? _self.driverName : driverName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,driverMobile: freezed == driverMobile ? _self.driverMobile : driverMobile // ignore: cast_nullable_to_non_nullable
|
||||
as String?,car: freezed == car ? _self.car : car // ignore: cast_nullable_to_non_nullable
|
||||
as String?,clearanceCode: freezed == clearanceCode ? _self.clearanceCode : clearanceCode // ignore: cast_nullable_to_non_nullable
|
||||
as String?,barClearanceCode: freezed == barClearanceCode ? _self.barClearanceCode : barClearanceCode // ignore: cast_nullable_to_non_nullable
|
||||
as String?,quantity: freezed == quantity ? _self.quantity : quantity // ignore: cast_nullable_to_non_nullable
|
||||
as int?,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?,killHouseVetQuantity: freezed == killHouseVetQuantity ? _self.killHouseVetQuantity : killHouseVetQuantity // ignore: cast_nullable_to_non_nullable
|
||||
as int?,killHouseVetWeight: freezed == killHouseVetWeight ? _self.killHouseVetWeight : killHouseVetWeight // ignore: cast_nullable_to_non_nullable
|
||||
as int?,killHouseVetState: freezed == killHouseVetState ? _self.killHouseVetState : killHouseVetState // ignore: cast_nullable_to_non_nullable
|
||||
as String?,dateOfAcceptReject: freezed == dateOfAcceptReject ? _self.dateOfAcceptReject : dateOfAcceptReject // ignore: cast_nullable_to_non_nullable
|
||||
as String?,acceptorRejector: freezed == acceptorRejector ? _self.acceptorRejector : acceptorRejector // ignore: cast_nullable_to_non_nullable
|
||||
as dynamic,liveWeight: freezed == liveWeight ? _self.liveWeight : liveWeight // ignore: cast_nullable_to_non_nullable
|
||||
as int?,barImage: freezed == barImage ? _self.barImage : barImage // ignore: cast_nullable_to_non_nullable
|
||||
as String?,buyType: freezed == buyType ? _self.buyType : buyType // ignore: cast_nullable_to_non_nullable
|
||||
as String?,wareHouse: freezed == wareHouse ? _self.wareHouse : wareHouse // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,date: freezed == date ? _self.date : date // ignore: cast_nullable_to_non_nullable
|
||||
as String?,wage: freezed == wage ? _self.wage : wage // ignore: cast_nullable_to_non_nullable
|
||||
as int?,totalWageAmount: freezed == totalWageAmount ? _self.totalWageAmount : totalWageAmount // ignore: cast_nullable_to_non_nullable
|
||||
as int?,unionShare: freezed == unionShare ? _self.unionShare : unionShare // ignore: cast_nullable_to_non_nullable
|
||||
as int?,unionSharePercent: freezed == unionSharePercent ? _self.unionSharePercent : unionSharePercent // ignore: cast_nullable_to_non_nullable
|
||||
as int?,companyShare: freezed == companyShare ? _self.companyShare : companyShare // ignore: cast_nullable_to_non_nullable
|
||||
as int?,companySharePercent: freezed == companySharePercent ? _self.companySharePercent : companySharePercent // ignore: cast_nullable_to_non_nullable
|
||||
as int?,guildsShare: freezed == guildsShare ? _self.guildsShare : guildsShare // ignore: cast_nullable_to_non_nullable
|
||||
as int?,guildsSharePercent: freezed == guildsSharePercent ? _self.guildsSharePercent : guildsSharePercent // ignore: cast_nullable_to_non_nullable
|
||||
as int?,cityShare: freezed == cityShare ? _self.cityShare : cityShare // ignore: cast_nullable_to_non_nullable
|
||||
as int?,citySharePercent: freezed == citySharePercent ? _self.citySharePercent : citySharePercent // ignore: cast_nullable_to_non_nullable
|
||||
as int?,walletShare: freezed == walletShare ? _self.walletShare : walletShare // ignore: cast_nullable_to_non_nullable
|
||||
as int?,walletSharePercent: freezed == walletSharePercent ? _self.walletSharePercent : walletSharePercent // ignore: cast_nullable_to_non_nullable
|
||||
as int?,otherShare: freezed == otherShare ? _self.otherShare : otherShare // ignore: cast_nullable_to_non_nullable
|
||||
as int?,otherSharePercent: freezed == otherSharePercent ? _self.otherSharePercent : otherSharePercent // ignore: cast_nullable_to_non_nullable
|
||||
as int?,archiveWage: freezed == archiveWage ? _self.archiveWage : archiveWage // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,weightLoss: freezed == weightLoss ? _self.weightLoss : weightLoss // ignore: cast_nullable_to_non_nullable
|
||||
as int?,calculateStatus: freezed == calculateStatus ? _self.calculateStatus : calculateStatus // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,temporaryTrash: freezed == temporaryTrash ? _self.temporaryTrash : temporaryTrash // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,temporaryDeleted: freezed == temporaryDeleted ? _self.temporaryDeleted : temporaryDeleted // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,enteredMessage: freezed == enteredMessage ? _self.enteredMessage : enteredMessage // ignore: cast_nullable_to_non_nullable
|
||||
as String?,barCode: freezed == barCode ? _self.barCode : barCode // ignore: cast_nullable_to_non_nullable
|
||||
as int?,registerType: freezed == registerType ? _self.registerType : registerType // ignore: cast_nullable_to_non_nullable
|
||||
as String?,createdBy: freezed == createdBy ? _self.createdBy : createdBy // ignore: cast_nullable_to_non_nullable
|
||||
as dynamic,modifiedBy: freezed == modifiedBy ? _self.modifiedBy : modifiedBy // ignore: cast_nullable_to_non_nullable
|
||||
as dynamic,product: freezed == product ? _self.product : product // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [KillHouseFreeBar].
|
||||
extension KillHouseFreeBarPatterns on KillHouseFreeBar {
|
||||
/// A variant of `map` that fallback to returning `orElse`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _KillHouseFreeBar value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _KillHouseFreeBar() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// Callbacks receives the raw object, upcasted.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case final Subclass2 value:
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _KillHouseFreeBar value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _KillHouseFreeBar():
|
||||
return $default(_that);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `map` that fallback to returning `null`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _KillHouseFreeBar value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _KillHouseFreeBar() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to an `orElse` callback.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( int? id, dynamic killHouse, dynamic exclusiveKiller, String? key, String? createDate, String? modifyDate, bool? trash, String? poultryName, String? poultryMobile, String? sellerName, String? sellerMobile, String? province, String? city, String? vetFarmName, String? vetFarmMobile, String? driverName, String? driverMobile, String? car, String? clearanceCode, String? barClearanceCode, int? quantity, int? numberOfCarcasses, int? weightOfCarcasses, int? killHouseVetQuantity, int? killHouseVetWeight, String? killHouseVetState, String? dateOfAcceptReject, dynamic acceptorRejector, int? liveWeight, String? barImage, String? buyType, bool? wareHouse, String? date, int? wage, int? totalWageAmount, int? unionShare, int? unionSharePercent, int? companyShare, int? companySharePercent, int? guildsShare, int? guildsSharePercent, int? cityShare, int? citySharePercent, int? walletShare, int? walletSharePercent, int? otherShare, int? otherSharePercent, bool? archiveWage, int? weightLoss, bool? calculateStatus, bool? temporaryTrash, bool? temporaryDeleted, String? enteredMessage, int? barCode, String? registerType, dynamic createdBy, dynamic modifiedBy, int? product)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _KillHouseFreeBar() when $default != null:
|
||||
return $default(_that.id,_that.killHouse,_that.exclusiveKiller,_that.key,_that.createDate,_that.modifyDate,_that.trash,_that.poultryName,_that.poultryMobile,_that.sellerName,_that.sellerMobile,_that.province,_that.city,_that.vetFarmName,_that.vetFarmMobile,_that.driverName,_that.driverMobile,_that.car,_that.clearanceCode,_that.barClearanceCode,_that.quantity,_that.numberOfCarcasses,_that.weightOfCarcasses,_that.killHouseVetQuantity,_that.killHouseVetWeight,_that.killHouseVetState,_that.dateOfAcceptReject,_that.acceptorRejector,_that.liveWeight,_that.barImage,_that.buyType,_that.wareHouse,_that.date,_that.wage,_that.totalWageAmount,_that.unionShare,_that.unionSharePercent,_that.companyShare,_that.companySharePercent,_that.guildsShare,_that.guildsSharePercent,_that.cityShare,_that.citySharePercent,_that.walletShare,_that.walletSharePercent,_that.otherShare,_that.otherSharePercent,_that.archiveWage,_that.weightLoss,_that.calculateStatus,_that.temporaryTrash,_that.temporaryDeleted,_that.enteredMessage,_that.barCode,_that.registerType,_that.createdBy,_that.modifiedBy,_that.product);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// As opposed to `map`, this offers destructuring.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case Subclass2(:final field2):
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( int? id, dynamic killHouse, dynamic exclusiveKiller, String? key, String? createDate, String? modifyDate, bool? trash, String? poultryName, String? poultryMobile, String? sellerName, String? sellerMobile, String? province, String? city, String? vetFarmName, String? vetFarmMobile, String? driverName, String? driverMobile, String? car, String? clearanceCode, String? barClearanceCode, int? quantity, int? numberOfCarcasses, int? weightOfCarcasses, int? killHouseVetQuantity, int? killHouseVetWeight, String? killHouseVetState, String? dateOfAcceptReject, dynamic acceptorRejector, int? liveWeight, String? barImage, String? buyType, bool? wareHouse, String? date, int? wage, int? totalWageAmount, int? unionShare, int? unionSharePercent, int? companyShare, int? companySharePercent, int? guildsShare, int? guildsSharePercent, int? cityShare, int? citySharePercent, int? walletShare, int? walletSharePercent, int? otherShare, int? otherSharePercent, bool? archiveWage, int? weightLoss, bool? calculateStatus, bool? temporaryTrash, bool? temporaryDeleted, String? enteredMessage, int? barCode, String? registerType, dynamic createdBy, dynamic modifiedBy, int? product) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _KillHouseFreeBar():
|
||||
return $default(_that.id,_that.killHouse,_that.exclusiveKiller,_that.key,_that.createDate,_that.modifyDate,_that.trash,_that.poultryName,_that.poultryMobile,_that.sellerName,_that.sellerMobile,_that.province,_that.city,_that.vetFarmName,_that.vetFarmMobile,_that.driverName,_that.driverMobile,_that.car,_that.clearanceCode,_that.barClearanceCode,_that.quantity,_that.numberOfCarcasses,_that.weightOfCarcasses,_that.killHouseVetQuantity,_that.killHouseVetWeight,_that.killHouseVetState,_that.dateOfAcceptReject,_that.acceptorRejector,_that.liveWeight,_that.barImage,_that.buyType,_that.wareHouse,_that.date,_that.wage,_that.totalWageAmount,_that.unionShare,_that.unionSharePercent,_that.companyShare,_that.companySharePercent,_that.guildsShare,_that.guildsSharePercent,_that.cityShare,_that.citySharePercent,_that.walletShare,_that.walletSharePercent,_that.otherShare,_that.otherSharePercent,_that.archiveWage,_that.weightLoss,_that.calculateStatus,_that.temporaryTrash,_that.temporaryDeleted,_that.enteredMessage,_that.barCode,_that.registerType,_that.createdBy,_that.modifiedBy,_that.product);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to returning `null`
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( int? id, dynamic killHouse, dynamic exclusiveKiller, String? key, String? createDate, String? modifyDate, bool? trash, String? poultryName, String? poultryMobile, String? sellerName, String? sellerMobile, String? province, String? city, String? vetFarmName, String? vetFarmMobile, String? driverName, String? driverMobile, String? car, String? clearanceCode, String? barClearanceCode, int? quantity, int? numberOfCarcasses, int? weightOfCarcasses, int? killHouseVetQuantity, int? killHouseVetWeight, String? killHouseVetState, String? dateOfAcceptReject, dynamic acceptorRejector, int? liveWeight, String? barImage, String? buyType, bool? wareHouse, String? date, int? wage, int? totalWageAmount, int? unionShare, int? unionSharePercent, int? companyShare, int? companySharePercent, int? guildsShare, int? guildsSharePercent, int? cityShare, int? citySharePercent, int? walletShare, int? walletSharePercent, int? otherShare, int? otherSharePercent, bool? archiveWage, int? weightLoss, bool? calculateStatus, bool? temporaryTrash, bool? temporaryDeleted, String? enteredMessage, int? barCode, String? registerType, dynamic createdBy, dynamic modifiedBy, int? product)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _KillHouseFreeBar() when $default != null:
|
||||
return $default(_that.id,_that.killHouse,_that.exclusiveKiller,_that.key,_that.createDate,_that.modifyDate,_that.trash,_that.poultryName,_that.poultryMobile,_that.sellerName,_that.sellerMobile,_that.province,_that.city,_that.vetFarmName,_that.vetFarmMobile,_that.driverName,_that.driverMobile,_that.car,_that.clearanceCode,_that.barClearanceCode,_that.quantity,_that.numberOfCarcasses,_that.weightOfCarcasses,_that.killHouseVetQuantity,_that.killHouseVetWeight,_that.killHouseVetState,_that.dateOfAcceptReject,_that.acceptorRejector,_that.liveWeight,_that.barImage,_that.buyType,_that.wareHouse,_that.date,_that.wage,_that.totalWageAmount,_that.unionShare,_that.unionSharePercent,_that.companyShare,_that.companySharePercent,_that.guildsShare,_that.guildsSharePercent,_that.cityShare,_that.citySharePercent,_that.walletShare,_that.walletSharePercent,_that.otherShare,_that.otherSharePercent,_that.archiveWage,_that.weightLoss,_that.calculateStatus,_that.temporaryTrash,_that.temporaryDeleted,_that.enteredMessage,_that.barCode,_that.registerType,_that.createdBy,_that.modifiedBy,_that.product);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
|
||||
class _KillHouseFreeBar implements KillHouseFreeBar {
|
||||
const _KillHouseFreeBar({this.id, this.killHouse, this.exclusiveKiller, this.key, this.createDate, this.modifyDate, this.trash, this.poultryName, this.poultryMobile, this.sellerName, this.sellerMobile, this.province, this.city, this.vetFarmName, this.vetFarmMobile, this.driverName, this.driverMobile, this.car, this.clearanceCode, this.barClearanceCode, this.quantity, this.numberOfCarcasses, this.weightOfCarcasses, this.killHouseVetQuantity, this.killHouseVetWeight, this.killHouseVetState, this.dateOfAcceptReject, this.acceptorRejector, this.liveWeight, this.barImage, this.buyType, this.wareHouse, this.date, this.wage, this.totalWageAmount, this.unionShare, this.unionSharePercent, this.companyShare, this.companySharePercent, this.guildsShare, this.guildsSharePercent, this.cityShare, this.citySharePercent, this.walletShare, this.walletSharePercent, this.otherShare, this.otherSharePercent, this.archiveWage, this.weightLoss, this.calculateStatus, this.temporaryTrash, this.temporaryDeleted, this.enteredMessage, this.barCode, this.registerType, this.createdBy, this.modifiedBy, this.product});
|
||||
factory _KillHouseFreeBar.fromJson(Map<String, dynamic> json) => _$KillHouseFreeBarFromJson(json);
|
||||
|
||||
@override final int? id;
|
||||
@override final dynamic killHouse;
|
||||
@override final dynamic exclusiveKiller;
|
||||
@override final String? key;
|
||||
@override final String? createDate;
|
||||
@override final String? modifyDate;
|
||||
@override final bool? trash;
|
||||
@override final String? poultryName;
|
||||
@override final String? poultryMobile;
|
||||
@override final String? sellerName;
|
||||
@override final String? sellerMobile;
|
||||
@override final String? province;
|
||||
@override final String? city;
|
||||
@override final String? vetFarmName;
|
||||
@override final String? vetFarmMobile;
|
||||
@override final String? driverName;
|
||||
@override final String? driverMobile;
|
||||
@override final String? car;
|
||||
@override final String? clearanceCode;
|
||||
@override final String? barClearanceCode;
|
||||
@override final int? quantity;
|
||||
@override final int? numberOfCarcasses;
|
||||
@override final int? weightOfCarcasses;
|
||||
@override final int? killHouseVetQuantity;
|
||||
@override final int? killHouseVetWeight;
|
||||
@override final String? killHouseVetState;
|
||||
@override final String? dateOfAcceptReject;
|
||||
@override final dynamic acceptorRejector;
|
||||
@override final int? liveWeight;
|
||||
@override final String? barImage;
|
||||
@override final String? buyType;
|
||||
@override final bool? wareHouse;
|
||||
@override final String? date;
|
||||
@override final int? wage;
|
||||
@override final int? totalWageAmount;
|
||||
@override final int? unionShare;
|
||||
@override final int? unionSharePercent;
|
||||
@override final int? companyShare;
|
||||
@override final int? companySharePercent;
|
||||
@override final int? guildsShare;
|
||||
@override final int? guildsSharePercent;
|
||||
@override final int? cityShare;
|
||||
@override final int? citySharePercent;
|
||||
@override final int? walletShare;
|
||||
@override final int? walletSharePercent;
|
||||
@override final int? otherShare;
|
||||
@override final int? otherSharePercent;
|
||||
@override final bool? archiveWage;
|
||||
@override final int? weightLoss;
|
||||
@override final bool? calculateStatus;
|
||||
@override final bool? temporaryTrash;
|
||||
@override final bool? temporaryDeleted;
|
||||
@override final String? enteredMessage;
|
||||
@override final int? barCode;
|
||||
@override final String? registerType;
|
||||
@override final dynamic createdBy;
|
||||
@override final dynamic modifiedBy;
|
||||
@override final int? product;
|
||||
|
||||
/// Create a copy of KillHouseFreeBar
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$KillHouseFreeBarCopyWith<_KillHouseFreeBar> get copyWith => __$KillHouseFreeBarCopyWithImpl<_KillHouseFreeBar>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$KillHouseFreeBarToJson(this, );
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _KillHouseFreeBar&&(identical(other.id, id) || other.id == id)&&const DeepCollectionEquality().equals(other.killHouse, killHouse)&&const DeepCollectionEquality().equals(other.exclusiveKiller, exclusiveKiller)&&(identical(other.key, key) || other.key == key)&&(identical(other.createDate, createDate) || other.createDate == createDate)&&(identical(other.modifyDate, modifyDate) || other.modifyDate == modifyDate)&&(identical(other.trash, trash) || other.trash == trash)&&(identical(other.poultryName, poultryName) || other.poultryName == poultryName)&&(identical(other.poultryMobile, poultryMobile) || other.poultryMobile == poultryMobile)&&(identical(other.sellerName, sellerName) || other.sellerName == sellerName)&&(identical(other.sellerMobile, sellerMobile) || other.sellerMobile == sellerMobile)&&(identical(other.province, province) || other.province == province)&&(identical(other.city, city) || other.city == city)&&(identical(other.vetFarmName, vetFarmName) || other.vetFarmName == vetFarmName)&&(identical(other.vetFarmMobile, vetFarmMobile) || other.vetFarmMobile == vetFarmMobile)&&(identical(other.driverName, driverName) || other.driverName == driverName)&&(identical(other.driverMobile, driverMobile) || other.driverMobile == driverMobile)&&(identical(other.car, car) || other.car == car)&&(identical(other.clearanceCode, clearanceCode) || other.clearanceCode == clearanceCode)&&(identical(other.barClearanceCode, barClearanceCode) || other.barClearanceCode == barClearanceCode)&&(identical(other.quantity, quantity) || other.quantity == quantity)&&(identical(other.numberOfCarcasses, numberOfCarcasses) || other.numberOfCarcasses == numberOfCarcasses)&&(identical(other.weightOfCarcasses, weightOfCarcasses) || other.weightOfCarcasses == weightOfCarcasses)&&(identical(other.killHouseVetQuantity, killHouseVetQuantity) || other.killHouseVetQuantity == killHouseVetQuantity)&&(identical(other.killHouseVetWeight, killHouseVetWeight) || other.killHouseVetWeight == killHouseVetWeight)&&(identical(other.killHouseVetState, killHouseVetState) || other.killHouseVetState == killHouseVetState)&&(identical(other.dateOfAcceptReject, dateOfAcceptReject) || other.dateOfAcceptReject == dateOfAcceptReject)&&const DeepCollectionEquality().equals(other.acceptorRejector, acceptorRejector)&&(identical(other.liveWeight, liveWeight) || other.liveWeight == liveWeight)&&(identical(other.barImage, barImage) || other.barImage == barImage)&&(identical(other.buyType, buyType) || other.buyType == buyType)&&(identical(other.wareHouse, wareHouse) || other.wareHouse == wareHouse)&&(identical(other.date, date) || other.date == date)&&(identical(other.wage, wage) || other.wage == wage)&&(identical(other.totalWageAmount, totalWageAmount) || other.totalWageAmount == totalWageAmount)&&(identical(other.unionShare, unionShare) || other.unionShare == unionShare)&&(identical(other.unionSharePercent, unionSharePercent) || other.unionSharePercent == unionSharePercent)&&(identical(other.companyShare, companyShare) || other.companyShare == companyShare)&&(identical(other.companySharePercent, companySharePercent) || other.companySharePercent == companySharePercent)&&(identical(other.guildsShare, guildsShare) || other.guildsShare == guildsShare)&&(identical(other.guildsSharePercent, guildsSharePercent) || other.guildsSharePercent == guildsSharePercent)&&(identical(other.cityShare, cityShare) || other.cityShare == cityShare)&&(identical(other.citySharePercent, citySharePercent) || other.citySharePercent == citySharePercent)&&(identical(other.walletShare, walletShare) || other.walletShare == walletShare)&&(identical(other.walletSharePercent, walletSharePercent) || other.walletSharePercent == walletSharePercent)&&(identical(other.otherShare, otherShare) || other.otherShare == otherShare)&&(identical(other.otherSharePercent, otherSharePercent) || other.otherSharePercent == otherSharePercent)&&(identical(other.archiveWage, archiveWage) || other.archiveWage == archiveWage)&&(identical(other.weightLoss, weightLoss) || other.weightLoss == weightLoss)&&(identical(other.calculateStatus, calculateStatus) || other.calculateStatus == calculateStatus)&&(identical(other.temporaryTrash, temporaryTrash) || other.temporaryTrash == temporaryTrash)&&(identical(other.temporaryDeleted, temporaryDeleted) || other.temporaryDeleted == temporaryDeleted)&&(identical(other.enteredMessage, enteredMessage) || other.enteredMessage == enteredMessage)&&(identical(other.barCode, barCode) || other.barCode == barCode)&&(identical(other.registerType, registerType) || other.registerType == registerType)&&const DeepCollectionEquality().equals(other.createdBy, createdBy)&&const DeepCollectionEquality().equals(other.modifiedBy, modifiedBy)&&(identical(other.product, product) || other.product == product));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hashAll([runtimeType,id,const DeepCollectionEquality().hash(killHouse),const DeepCollectionEquality().hash(exclusiveKiller),key,createDate,modifyDate,trash,poultryName,poultryMobile,sellerName,sellerMobile,province,city,vetFarmName,vetFarmMobile,driverName,driverMobile,car,clearanceCode,barClearanceCode,quantity,numberOfCarcasses,weightOfCarcasses,killHouseVetQuantity,killHouseVetWeight,killHouseVetState,dateOfAcceptReject,const DeepCollectionEquality().hash(acceptorRejector),liveWeight,barImage,buyType,wareHouse,date,wage,totalWageAmount,unionShare,unionSharePercent,companyShare,companySharePercent,guildsShare,guildsSharePercent,cityShare,citySharePercent,walletShare,walletSharePercent,otherShare,otherSharePercent,archiveWage,weightLoss,calculateStatus,temporaryTrash,temporaryDeleted,enteredMessage,barCode,registerType,const DeepCollectionEquality().hash(createdBy),const DeepCollectionEquality().hash(modifiedBy),product]);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'KillHouseFreeBar(id: $id, killHouse: $killHouse, exclusiveKiller: $exclusiveKiller, key: $key, createDate: $createDate, modifyDate: $modifyDate, trash: $trash, poultryName: $poultryName, poultryMobile: $poultryMobile, sellerName: $sellerName, sellerMobile: $sellerMobile, province: $province, city: $city, vetFarmName: $vetFarmName, vetFarmMobile: $vetFarmMobile, driverName: $driverName, driverMobile: $driverMobile, car: $car, clearanceCode: $clearanceCode, barClearanceCode: $barClearanceCode, quantity: $quantity, numberOfCarcasses: $numberOfCarcasses, weightOfCarcasses: $weightOfCarcasses, killHouseVetQuantity: $killHouseVetQuantity, killHouseVetWeight: $killHouseVetWeight, killHouseVetState: $killHouseVetState, dateOfAcceptReject: $dateOfAcceptReject, acceptorRejector: $acceptorRejector, liveWeight: $liveWeight, barImage: $barImage, buyType: $buyType, wareHouse: $wareHouse, date: $date, wage: $wage, totalWageAmount: $totalWageAmount, unionShare: $unionShare, unionSharePercent: $unionSharePercent, companyShare: $companyShare, companySharePercent: $companySharePercent, guildsShare: $guildsShare, guildsSharePercent: $guildsSharePercent, cityShare: $cityShare, citySharePercent: $citySharePercent, walletShare: $walletShare, walletSharePercent: $walletSharePercent, otherShare: $otherShare, otherSharePercent: $otherSharePercent, archiveWage: $archiveWage, weightLoss: $weightLoss, calculateStatus: $calculateStatus, temporaryTrash: $temporaryTrash, temporaryDeleted: $temporaryDeleted, enteredMessage: $enteredMessage, barCode: $barCode, registerType: $registerType, createdBy: $createdBy, modifiedBy: $modifiedBy, product: $product)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$KillHouseFreeBarCopyWith<$Res> implements $KillHouseFreeBarCopyWith<$Res> {
|
||||
factory _$KillHouseFreeBarCopyWith(_KillHouseFreeBar value, $Res Function(_KillHouseFreeBar) _then) = __$KillHouseFreeBarCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
int? id, dynamic killHouse, dynamic exclusiveKiller, String? key, String? createDate, String? modifyDate, bool? trash, String? poultryName, String? poultryMobile, String? sellerName, String? sellerMobile, String? province, String? city, String? vetFarmName, String? vetFarmMobile, String? driverName, String? driverMobile, String? car, String? clearanceCode, String? barClearanceCode, int? quantity, int? numberOfCarcasses, int? weightOfCarcasses, int? killHouseVetQuantity, int? killHouseVetWeight, String? killHouseVetState, String? dateOfAcceptReject, dynamic acceptorRejector, int? liveWeight, String? barImage, String? buyType, bool? wareHouse, String? date, int? wage, int? totalWageAmount, int? unionShare, int? unionSharePercent, int? companyShare, int? companySharePercent, int? guildsShare, int? guildsSharePercent, int? cityShare, int? citySharePercent, int? walletShare, int? walletSharePercent, int? otherShare, int? otherSharePercent, bool? archiveWage, int? weightLoss, bool? calculateStatus, bool? temporaryTrash, bool? temporaryDeleted, String? enteredMessage, int? barCode, String? registerType, dynamic createdBy, dynamic modifiedBy, int? product
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$KillHouseFreeBarCopyWithImpl<$Res>
|
||||
implements _$KillHouseFreeBarCopyWith<$Res> {
|
||||
__$KillHouseFreeBarCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _KillHouseFreeBar _self;
|
||||
final $Res Function(_KillHouseFreeBar) _then;
|
||||
|
||||
/// Create a copy of KillHouseFreeBar
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? id = freezed,Object? killHouse = freezed,Object? exclusiveKiller = freezed,Object? key = freezed,Object? createDate = freezed,Object? modifyDate = freezed,Object? trash = freezed,Object? poultryName = freezed,Object? poultryMobile = freezed,Object? sellerName = freezed,Object? sellerMobile = freezed,Object? province = freezed,Object? city = freezed,Object? vetFarmName = freezed,Object? vetFarmMobile = freezed,Object? driverName = freezed,Object? driverMobile = freezed,Object? car = freezed,Object? clearanceCode = freezed,Object? barClearanceCode = freezed,Object? quantity = freezed,Object? numberOfCarcasses = freezed,Object? weightOfCarcasses = freezed,Object? killHouseVetQuantity = freezed,Object? killHouseVetWeight = freezed,Object? killHouseVetState = freezed,Object? dateOfAcceptReject = freezed,Object? acceptorRejector = freezed,Object? liveWeight = freezed,Object? barImage = freezed,Object? buyType = freezed,Object? wareHouse = freezed,Object? date = freezed,Object? wage = freezed,Object? totalWageAmount = freezed,Object? unionShare = freezed,Object? unionSharePercent = freezed,Object? companyShare = freezed,Object? companySharePercent = freezed,Object? guildsShare = freezed,Object? guildsSharePercent = freezed,Object? cityShare = freezed,Object? citySharePercent = freezed,Object? walletShare = freezed,Object? walletSharePercent = freezed,Object? otherShare = freezed,Object? otherSharePercent = freezed,Object? archiveWage = freezed,Object? weightLoss = freezed,Object? calculateStatus = freezed,Object? temporaryTrash = freezed,Object? temporaryDeleted = freezed,Object? enteredMessage = freezed,Object? barCode = freezed,Object? registerType = freezed,Object? createdBy = freezed,Object? modifiedBy = freezed,Object? product = freezed,}) {
|
||||
return _then(_KillHouseFreeBar(
|
||||
id: freezed == id ? _self.id : id // ignore: cast_nullable_to_non_nullable
|
||||
as int?,killHouse: freezed == killHouse ? _self.killHouse : killHouse // ignore: cast_nullable_to_non_nullable
|
||||
as dynamic,exclusiveKiller: freezed == exclusiveKiller ? _self.exclusiveKiller : exclusiveKiller // ignore: cast_nullable_to_non_nullable
|
||||
as dynamic,key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable
|
||||
as String?,createDate: freezed == createDate ? _self.createDate : createDate // ignore: cast_nullable_to_non_nullable
|
||||
as String?,modifyDate: freezed == modifyDate ? _self.modifyDate : modifyDate // ignore: cast_nullable_to_non_nullable
|
||||
as String?,trash: freezed == trash ? _self.trash : trash // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,poultryName: freezed == poultryName ? _self.poultryName : poultryName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,poultryMobile: freezed == poultryMobile ? _self.poultryMobile : poultryMobile // ignore: cast_nullable_to_non_nullable
|
||||
as String?,sellerName: freezed == sellerName ? _self.sellerName : sellerName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,sellerMobile: freezed == sellerMobile ? _self.sellerMobile : sellerMobile // ignore: cast_nullable_to_non_nullable
|
||||
as String?,province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable
|
||||
as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable
|
||||
as String?,vetFarmName: freezed == vetFarmName ? _self.vetFarmName : vetFarmName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,vetFarmMobile: freezed == vetFarmMobile ? _self.vetFarmMobile : vetFarmMobile // ignore: cast_nullable_to_non_nullable
|
||||
as String?,driverName: freezed == driverName ? _self.driverName : driverName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,driverMobile: freezed == driverMobile ? _self.driverMobile : driverMobile // ignore: cast_nullable_to_non_nullable
|
||||
as String?,car: freezed == car ? _self.car : car // ignore: cast_nullable_to_non_nullable
|
||||
as String?,clearanceCode: freezed == clearanceCode ? _self.clearanceCode : clearanceCode // ignore: cast_nullable_to_non_nullable
|
||||
as String?,barClearanceCode: freezed == barClearanceCode ? _self.barClearanceCode : barClearanceCode // ignore: cast_nullable_to_non_nullable
|
||||
as String?,quantity: freezed == quantity ? _self.quantity : quantity // ignore: cast_nullable_to_non_nullable
|
||||
as int?,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?,killHouseVetQuantity: freezed == killHouseVetQuantity ? _self.killHouseVetQuantity : killHouseVetQuantity // ignore: cast_nullable_to_non_nullable
|
||||
as int?,killHouseVetWeight: freezed == killHouseVetWeight ? _self.killHouseVetWeight : killHouseVetWeight // ignore: cast_nullable_to_non_nullable
|
||||
as int?,killHouseVetState: freezed == killHouseVetState ? _self.killHouseVetState : killHouseVetState // ignore: cast_nullable_to_non_nullable
|
||||
as String?,dateOfAcceptReject: freezed == dateOfAcceptReject ? _self.dateOfAcceptReject : dateOfAcceptReject // ignore: cast_nullable_to_non_nullable
|
||||
as String?,acceptorRejector: freezed == acceptorRejector ? _self.acceptorRejector : acceptorRejector // ignore: cast_nullable_to_non_nullable
|
||||
as dynamic,liveWeight: freezed == liveWeight ? _self.liveWeight : liveWeight // ignore: cast_nullable_to_non_nullable
|
||||
as int?,barImage: freezed == barImage ? _self.barImage : barImage // ignore: cast_nullable_to_non_nullable
|
||||
as String?,buyType: freezed == buyType ? _self.buyType : buyType // ignore: cast_nullable_to_non_nullable
|
||||
as String?,wareHouse: freezed == wareHouse ? _self.wareHouse : wareHouse // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,date: freezed == date ? _self.date : date // ignore: cast_nullable_to_non_nullable
|
||||
as String?,wage: freezed == wage ? _self.wage : wage // ignore: cast_nullable_to_non_nullable
|
||||
as int?,totalWageAmount: freezed == totalWageAmount ? _self.totalWageAmount : totalWageAmount // ignore: cast_nullable_to_non_nullable
|
||||
as int?,unionShare: freezed == unionShare ? _self.unionShare : unionShare // ignore: cast_nullable_to_non_nullable
|
||||
as int?,unionSharePercent: freezed == unionSharePercent ? _self.unionSharePercent : unionSharePercent // ignore: cast_nullable_to_non_nullable
|
||||
as int?,companyShare: freezed == companyShare ? _self.companyShare : companyShare // ignore: cast_nullable_to_non_nullable
|
||||
as int?,companySharePercent: freezed == companySharePercent ? _self.companySharePercent : companySharePercent // ignore: cast_nullable_to_non_nullable
|
||||
as int?,guildsShare: freezed == guildsShare ? _self.guildsShare : guildsShare // ignore: cast_nullable_to_non_nullable
|
||||
as int?,guildsSharePercent: freezed == guildsSharePercent ? _self.guildsSharePercent : guildsSharePercent // ignore: cast_nullable_to_non_nullable
|
||||
as int?,cityShare: freezed == cityShare ? _self.cityShare : cityShare // ignore: cast_nullable_to_non_nullable
|
||||
as int?,citySharePercent: freezed == citySharePercent ? _self.citySharePercent : citySharePercent // ignore: cast_nullable_to_non_nullable
|
||||
as int?,walletShare: freezed == walletShare ? _self.walletShare : walletShare // ignore: cast_nullable_to_non_nullable
|
||||
as int?,walletSharePercent: freezed == walletSharePercent ? _self.walletSharePercent : walletSharePercent // ignore: cast_nullable_to_non_nullable
|
||||
as int?,otherShare: freezed == otherShare ? _self.otherShare : otherShare // ignore: cast_nullable_to_non_nullable
|
||||
as int?,otherSharePercent: freezed == otherSharePercent ? _self.otherSharePercent : otherSharePercent // ignore: cast_nullable_to_non_nullable
|
||||
as int?,archiveWage: freezed == archiveWage ? _self.archiveWage : archiveWage // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,weightLoss: freezed == weightLoss ? _self.weightLoss : weightLoss // ignore: cast_nullable_to_non_nullable
|
||||
as int?,calculateStatus: freezed == calculateStatus ? _self.calculateStatus : calculateStatus // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,temporaryTrash: freezed == temporaryTrash ? _self.temporaryTrash : temporaryTrash // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,temporaryDeleted: freezed == temporaryDeleted ? _self.temporaryDeleted : temporaryDeleted // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,enteredMessage: freezed == enteredMessage ? _self.enteredMessage : enteredMessage // ignore: cast_nullable_to_non_nullable
|
||||
as String?,barCode: freezed == barCode ? _self.barCode : barCode // ignore: cast_nullable_to_non_nullable
|
||||
as int?,registerType: freezed == registerType ? _self.registerType : registerType // ignore: cast_nullable_to_non_nullable
|
||||
as String?,createdBy: freezed == createdBy ? _self.createdBy : createdBy // ignore: cast_nullable_to_non_nullable
|
||||
as dynamic,modifiedBy: freezed == modifiedBy ? _self.modifiedBy : modifiedBy // ignore: cast_nullable_to_non_nullable
|
||||
as dynamic,product: freezed == product ? _self.product : product // ignore: cast_nullable_to_non_nullable
|
||||
as int?,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// dart format on
|
||||
@@ -0,0 +1,131 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'kill_house_free_bar.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_KillHouseFreeBar _$KillHouseFreeBarFromJson(Map<String, dynamic> json) =>
|
||||
_KillHouseFreeBar(
|
||||
id: (json['id'] as num?)?.toInt(),
|
||||
killHouse: json['kill_house'],
|
||||
exclusiveKiller: json['exclusive_killer'],
|
||||
key: json['key'] as String?,
|
||||
createDate: json['create_date'] as String?,
|
||||
modifyDate: json['modify_date'] as String?,
|
||||
trash: json['trash'] as bool?,
|
||||
poultryName: json['poultry_name'] as String?,
|
||||
poultryMobile: json['poultry_mobile'] as String?,
|
||||
sellerName: json['seller_name'] as String?,
|
||||
sellerMobile: json['seller_mobile'] as String?,
|
||||
province: json['province'] as String?,
|
||||
city: json['city'] as String?,
|
||||
vetFarmName: json['vet_farm_name'] as String?,
|
||||
vetFarmMobile: json['vet_farm_mobile'] as String?,
|
||||
driverName: json['driver_name'] as String?,
|
||||
driverMobile: json['driver_mobile'] as String?,
|
||||
car: json['car'] as String?,
|
||||
clearanceCode: json['clearance_code'] as String?,
|
||||
barClearanceCode: json['bar_clearance_code'] as String?,
|
||||
quantity: (json['quantity'] as num?)?.toInt(),
|
||||
numberOfCarcasses: (json['number_of_carcasses'] as num?)?.toInt(),
|
||||
weightOfCarcasses: (json['weight_of_carcasses'] as num?)?.toInt(),
|
||||
killHouseVetQuantity: (json['kill_house_vet_quantity'] as num?)?.toInt(),
|
||||
killHouseVetWeight: (json['kill_house_vet_weight'] as num?)?.toInt(),
|
||||
killHouseVetState: json['kill_house_vet_state'] as String?,
|
||||
dateOfAcceptReject: json['date_of_accept_reject'] as String?,
|
||||
acceptorRejector: json['acceptor_rejector'],
|
||||
liveWeight: (json['live_weight'] as num?)?.toInt(),
|
||||
barImage: json['bar_image'] as String?,
|
||||
buyType: json['buy_type'] as String?,
|
||||
wareHouse: json['ware_house'] as bool?,
|
||||
date: json['date'] as String?,
|
||||
wage: (json['wage'] as num?)?.toInt(),
|
||||
totalWageAmount: (json['total_wage_amount'] as num?)?.toInt(),
|
||||
unionShare: (json['union_share'] as num?)?.toInt(),
|
||||
unionSharePercent: (json['union_share_percent'] as num?)?.toInt(),
|
||||
companyShare: (json['company_share'] as num?)?.toInt(),
|
||||
companySharePercent: (json['company_share_percent'] as num?)?.toInt(),
|
||||
guildsShare: (json['guilds_share'] as num?)?.toInt(),
|
||||
guildsSharePercent: (json['guilds_share_percent'] as num?)?.toInt(),
|
||||
cityShare: (json['city_share'] as num?)?.toInt(),
|
||||
citySharePercent: (json['city_share_percent'] as num?)?.toInt(),
|
||||
walletShare: (json['wallet_share'] as num?)?.toInt(),
|
||||
walletSharePercent: (json['wallet_share_percent'] as num?)?.toInt(),
|
||||
otherShare: (json['other_share'] as num?)?.toInt(),
|
||||
otherSharePercent: (json['other_share_percent'] as num?)?.toInt(),
|
||||
archiveWage: json['archive_wage'] as bool?,
|
||||
weightLoss: (json['weight_loss'] as num?)?.toInt(),
|
||||
calculateStatus: json['calculate_status'] as bool?,
|
||||
temporaryTrash: json['temporary_trash'] as bool?,
|
||||
temporaryDeleted: json['temporary_deleted'] as bool?,
|
||||
enteredMessage: json['entered_message'] as String?,
|
||||
barCode: (json['bar_code'] as num?)?.toInt(),
|
||||
registerType: json['register_type'] as String?,
|
||||
createdBy: json['created_by'],
|
||||
modifiedBy: json['modified_by'],
|
||||
product: (json['product'] as num?)?.toInt(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$KillHouseFreeBarToJson(_KillHouseFreeBar instance) =>
|
||||
<String, dynamic>{
|
||||
'id': instance.id,
|
||||
'kill_house': instance.killHouse,
|
||||
'exclusive_killer': instance.exclusiveKiller,
|
||||
'key': instance.key,
|
||||
'create_date': instance.createDate,
|
||||
'modify_date': instance.modifyDate,
|
||||
'trash': instance.trash,
|
||||
'poultry_name': instance.poultryName,
|
||||
'poultry_mobile': instance.poultryMobile,
|
||||
'seller_name': instance.sellerName,
|
||||
'seller_mobile': instance.sellerMobile,
|
||||
'province': instance.province,
|
||||
'city': instance.city,
|
||||
'vet_farm_name': instance.vetFarmName,
|
||||
'vet_farm_mobile': instance.vetFarmMobile,
|
||||
'driver_name': instance.driverName,
|
||||
'driver_mobile': instance.driverMobile,
|
||||
'car': instance.car,
|
||||
'clearance_code': instance.clearanceCode,
|
||||
'bar_clearance_code': instance.barClearanceCode,
|
||||
'quantity': instance.quantity,
|
||||
'number_of_carcasses': instance.numberOfCarcasses,
|
||||
'weight_of_carcasses': instance.weightOfCarcasses,
|
||||
'kill_house_vet_quantity': instance.killHouseVetQuantity,
|
||||
'kill_house_vet_weight': instance.killHouseVetWeight,
|
||||
'kill_house_vet_state': instance.killHouseVetState,
|
||||
'date_of_accept_reject': instance.dateOfAcceptReject,
|
||||
'acceptor_rejector': instance.acceptorRejector,
|
||||
'live_weight': instance.liveWeight,
|
||||
'bar_image': instance.barImage,
|
||||
'buy_type': instance.buyType,
|
||||
'ware_house': instance.wareHouse,
|
||||
'date': instance.date,
|
||||
'wage': instance.wage,
|
||||
'total_wage_amount': instance.totalWageAmount,
|
||||
'union_share': instance.unionShare,
|
||||
'union_share_percent': instance.unionSharePercent,
|
||||
'company_share': instance.companyShare,
|
||||
'company_share_percent': instance.companySharePercent,
|
||||
'guilds_share': instance.guildsShare,
|
||||
'guilds_share_percent': instance.guildsSharePercent,
|
||||
'city_share': instance.cityShare,
|
||||
'city_share_percent': instance.citySharePercent,
|
||||
'wallet_share': instance.walletShare,
|
||||
'wallet_share_percent': instance.walletSharePercent,
|
||||
'other_share': instance.otherShare,
|
||||
'other_share_percent': instance.otherSharePercent,
|
||||
'archive_wage': instance.archiveWage,
|
||||
'weight_loss': instance.weightLoss,
|
||||
'calculate_status': instance.calculateStatus,
|
||||
'temporary_trash': instance.temporaryTrash,
|
||||
'temporary_deleted': instance.temporaryDeleted,
|
||||
'entered_message': instance.enteredMessage,
|
||||
'bar_code': instance.barCode,
|
||||
'register_type': instance.registerType,
|
||||
'created_by': instance.createdBy,
|
||||
'modified_by': instance.modifiedBy,
|
||||
'product': instance.product,
|
||||
};
|
||||
@@ -0,0 +1,69 @@
|
||||
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,
|
||||
int? totalFreeRemainWeight,
|
||||
int? totalGovernmentalRemainWeight,
|
||||
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,146 @@
|
||||
// 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(),
|
||||
totalFreeRemainWeight: (json['total_free_remain_weight'] as num?)?.toInt(),
|
||||
totalGovernmentalRemainWeight:
|
||||
(json['total_governmental_remain_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,
|
||||
'total_free_remain_weight': instance.totalFreeRemainWeight,
|
||||
'total_governmental_remain_weight': instance.totalGovernmentalRemainWeight,
|
||||
'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,18 @@
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
part 'user_info_model.freezed.dart';
|
||||
|
||||
part 'user_info_model.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class UserInfoModel with _$UserInfoModel {
|
||||
const factory UserInfoModel({
|
||||
bool? isUser,
|
||||
String? address,
|
||||
String? backend,
|
||||
String? apiKey,
|
||||
}) = _UserInfoModel ;
|
||||
|
||||
factory UserInfoModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$UserInfoModelFromJson(json);
|
||||
}
|
||||
@@ -0,0 +1,286 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// coverage:ignore-file
|
||||
// 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 'user_info_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
/// @nodoc
|
||||
mixin _$UserInfoModel {
|
||||
|
||||
bool? get isUser; String? get address; String? get backend; String? get apiKey;
|
||||
/// Create a copy of UserInfoModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$UserInfoModelCopyWith<UserInfoModel> get copyWith => _$UserInfoModelCopyWithImpl<UserInfoModel>(this as UserInfoModel, _$identity);
|
||||
|
||||
/// Serializes this UserInfoModel to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is UserInfoModel&&(identical(other.isUser, isUser) || other.isUser == isUser)&&(identical(other.address, address) || other.address == address)&&(identical(other.backend, backend) || other.backend == backend)&&(identical(other.apiKey, apiKey) || other.apiKey == apiKey));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,isUser,address,backend,apiKey);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'UserInfoModel(isUser: $isUser, address: $address, backend: $backend, apiKey: $apiKey)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $UserInfoModelCopyWith<$Res> {
|
||||
factory $UserInfoModelCopyWith(UserInfoModel value, $Res Function(UserInfoModel) _then) = _$UserInfoModelCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
bool? isUser, String? address, String? backend, String? apiKey
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$UserInfoModelCopyWithImpl<$Res>
|
||||
implements $UserInfoModelCopyWith<$Res> {
|
||||
_$UserInfoModelCopyWithImpl(this._self, this._then);
|
||||
|
||||
final UserInfoModel _self;
|
||||
final $Res Function(UserInfoModel) _then;
|
||||
|
||||
/// Create a copy of UserInfoModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? isUser = freezed,Object? address = freezed,Object? backend = freezed,Object? apiKey = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
isUser: freezed == isUser ? _self.isUser : isUser // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable
|
||||
as String?,backend: freezed == backend ? _self.backend : backend // ignore: cast_nullable_to_non_nullable
|
||||
as String?,apiKey: freezed == apiKey ? _self.apiKey : apiKey // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [UserInfoModel].
|
||||
extension UserInfoModelPatterns on UserInfoModel {
|
||||
/// A variant of `map` that fallback to returning `orElse`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _UserInfoModel value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _UserInfoModel() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// Callbacks receives the raw object, upcasted.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case final Subclass2 value:
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _UserInfoModel value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _UserInfoModel():
|
||||
return $default(_that);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `map` that fallback to returning `null`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _UserInfoModel value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _UserInfoModel() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to an `orElse` callback.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( bool? isUser, String? address, String? backend, String? apiKey)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _UserInfoModel() when $default != null:
|
||||
return $default(_that.isUser,_that.address,_that.backend,_that.apiKey);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// As opposed to `map`, this offers destructuring.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case Subclass2(:final field2):
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( bool? isUser, String? address, String? backend, String? apiKey) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _UserInfoModel():
|
||||
return $default(_that.isUser,_that.address,_that.backend,_that.apiKey);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to returning `null`
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( bool? isUser, String? address, String? backend, String? apiKey)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _UserInfoModel() when $default != null:
|
||||
return $default(_that.isUser,_that.address,_that.backend,_that.apiKey);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
|
||||
class _UserInfoModel implements UserInfoModel {
|
||||
const _UserInfoModel({this.isUser, this.address, this.backend, this.apiKey});
|
||||
factory _UserInfoModel.fromJson(Map<String, dynamic> json) => _$UserInfoModelFromJson(json);
|
||||
|
||||
@override final bool? isUser;
|
||||
@override final String? address;
|
||||
@override final String? backend;
|
||||
@override final String? apiKey;
|
||||
|
||||
/// Create a copy of UserInfoModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$UserInfoModelCopyWith<_UserInfoModel> get copyWith => __$UserInfoModelCopyWithImpl<_UserInfoModel>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$UserInfoModelToJson(this, );
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _UserInfoModel&&(identical(other.isUser, isUser) || other.isUser == isUser)&&(identical(other.address, address) || other.address == address)&&(identical(other.backend, backend) || other.backend == backend)&&(identical(other.apiKey, apiKey) || other.apiKey == apiKey));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,isUser,address,backend,apiKey);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'UserInfoModel(isUser: $isUser, address: $address, backend: $backend, apiKey: $apiKey)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$UserInfoModelCopyWith<$Res> implements $UserInfoModelCopyWith<$Res> {
|
||||
factory _$UserInfoModelCopyWith(_UserInfoModel value, $Res Function(_UserInfoModel) _then) = __$UserInfoModelCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
bool? isUser, String? address, String? backend, String? apiKey
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$UserInfoModelCopyWithImpl<$Res>
|
||||
implements _$UserInfoModelCopyWith<$Res> {
|
||||
__$UserInfoModelCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _UserInfoModel _self;
|
||||
final $Res Function(_UserInfoModel) _then;
|
||||
|
||||
/// Create a copy of UserInfoModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? isUser = freezed,Object? address = freezed,Object? backend = freezed,Object? apiKey = freezed,}) {
|
||||
return _then(_UserInfoModel(
|
||||
isUser: freezed == isUser ? _self.isUser : isUser // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,address: freezed == address ? _self.address : address // ignore: cast_nullable_to_non_nullable
|
||||
as String?,backend: freezed == backend ? _self.backend : backend // ignore: cast_nullable_to_non_nullable
|
||||
as String?,apiKey: freezed == apiKey ? _self.apiKey : apiKey // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// dart format on
|
||||
@@ -0,0 +1,23 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'user_info_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_UserInfoModel _$UserInfoModelFromJson(Map<String, dynamic> json) =>
|
||||
_UserInfoModel(
|
||||
isUser: json['is_user'] as bool?,
|
||||
address: json['address'] as String?,
|
||||
backend: json['backend'] as String?,
|
||||
apiKey: json['api_key'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$UserInfoModelToJson(_UserInfoModel instance) =>
|
||||
<String, dynamic>{
|
||||
'is_user': instance.isUser,
|
||||
'address': instance.address,
|
||||
'backend': instance.backend,
|
||||
'api_key': instance.apiKey,
|
||||
};
|
||||
@@ -0,0 +1,65 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'user_profile.freezed.dart';
|
||||
part 'user_profile.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class UserProfile with _$UserProfile {
|
||||
const factory UserProfile({
|
||||
List<String>? role,
|
||||
String? city,
|
||||
String? province,
|
||||
String? key,
|
||||
String? userGateWayId,
|
||||
dynamic userDjangoIdForeignKey,
|
||||
dynamic provinceIdForeignKey,
|
||||
dynamic cityIdForeignKey,
|
||||
dynamic systemUserProfileIdKey,
|
||||
String? fullname,
|
||||
String? firstName,
|
||||
String? lastName,
|
||||
String? nationalCode,
|
||||
String? nationalCodeImage,
|
||||
String? nationalId,
|
||||
String? mobile,
|
||||
String? birthday,
|
||||
String? image,
|
||||
String? password,
|
||||
bool? active,
|
||||
UserState? state,
|
||||
int? baseOrder,
|
||||
int? cityNumber,
|
||||
String? cityName,
|
||||
int? provinceNumber,
|
||||
String? provinceName,
|
||||
String? unitName,
|
||||
String? unitNationalId,
|
||||
String? unitRegistrationNumber,
|
||||
String? unitEconomicalNumber,
|
||||
String? unitProvince,
|
||||
String? unitCity,
|
||||
String? unitPostalCode,
|
||||
String? unitAddress,
|
||||
String? personType,
|
||||
String? type,
|
||||
}) = _UserProfile;
|
||||
|
||||
factory UserProfile.fromJson(Map<String, dynamic> json) => _$UserProfileFromJson(json);
|
||||
}
|
||||
|
||||
@freezed
|
||||
abstract class UserState with _$UserState {
|
||||
const factory UserState({
|
||||
String? city,
|
||||
String? image,
|
||||
String? mobile,
|
||||
String? birthday,
|
||||
String? province,
|
||||
String? lastName,
|
||||
String? firstName,
|
||||
String? nationalId,
|
||||
String? nationalCode,
|
||||
}) = _UserState;
|
||||
|
||||
factory UserState.fromJson(Map<String, dynamic> json) => _$UserStateFromJson(json);
|
||||
}
|
||||
@@ -0,0 +1,701 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// coverage:ignore-file
|
||||
// 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 'user_profile.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
/// @nodoc
|
||||
mixin _$UserProfile {
|
||||
|
||||
List<String>? get role; String? get city; String? get province; String? get key; String? get userGateWayId; dynamic get userDjangoIdForeignKey; dynamic get provinceIdForeignKey; dynamic get cityIdForeignKey; dynamic get systemUserProfileIdKey; String? get fullname; String? get firstName; String? get lastName; String? get nationalCode; String? get nationalCodeImage; String? get nationalId; String? get mobile; String? get birthday; String? get image; String? get password; bool? get active; UserState? get state; int? get baseOrder; int? get cityNumber; String? get cityName; int? get provinceNumber; String? get provinceName; String? get unitName; String? get unitNationalId; String? get unitRegistrationNumber; String? get unitEconomicalNumber; String? get unitProvince; String? get unitCity; String? get unitPostalCode; String? get unitAddress; String? get personType; String? get type;
|
||||
/// Create a copy of UserProfile
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$UserProfileCopyWith<UserProfile> get copyWith => _$UserProfileCopyWithImpl<UserProfile>(this as UserProfile, _$identity);
|
||||
|
||||
/// Serializes this UserProfile to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is UserProfile&&const DeepCollectionEquality().equals(other.role, role)&&(identical(other.city, city) || other.city == city)&&(identical(other.province, province) || other.province == province)&&(identical(other.key, key) || other.key == key)&&(identical(other.userGateWayId, userGateWayId) || other.userGateWayId == userGateWayId)&&const DeepCollectionEquality().equals(other.userDjangoIdForeignKey, userDjangoIdForeignKey)&&const DeepCollectionEquality().equals(other.provinceIdForeignKey, provinceIdForeignKey)&&const DeepCollectionEquality().equals(other.cityIdForeignKey, cityIdForeignKey)&&const DeepCollectionEquality().equals(other.systemUserProfileIdKey, systemUserProfileIdKey)&&(identical(other.fullname, fullname) || other.fullname == fullname)&&(identical(other.firstName, firstName) || other.firstName == firstName)&&(identical(other.lastName, lastName) || other.lastName == lastName)&&(identical(other.nationalCode, nationalCode) || other.nationalCode == nationalCode)&&(identical(other.nationalCodeImage, nationalCodeImage) || other.nationalCodeImage == nationalCodeImage)&&(identical(other.nationalId, nationalId) || other.nationalId == nationalId)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.birthday, birthday) || other.birthday == birthday)&&(identical(other.image, image) || other.image == image)&&(identical(other.password, password) || other.password == password)&&(identical(other.active, active) || other.active == active)&&(identical(other.state, state) || other.state == state)&&(identical(other.baseOrder, baseOrder) || other.baseOrder == baseOrder)&&(identical(other.cityNumber, cityNumber) || other.cityNumber == cityNumber)&&(identical(other.cityName, cityName) || other.cityName == cityName)&&(identical(other.provinceNumber, provinceNumber) || other.provinceNumber == provinceNumber)&&(identical(other.provinceName, provinceName) || other.provinceName == provinceName)&&(identical(other.unitName, unitName) || other.unitName == unitName)&&(identical(other.unitNationalId, unitNationalId) || other.unitNationalId == unitNationalId)&&(identical(other.unitRegistrationNumber, unitRegistrationNumber) || other.unitRegistrationNumber == unitRegistrationNumber)&&(identical(other.unitEconomicalNumber, unitEconomicalNumber) || other.unitEconomicalNumber == unitEconomicalNumber)&&(identical(other.unitProvince, unitProvince) || other.unitProvince == unitProvince)&&(identical(other.unitCity, unitCity) || other.unitCity == unitCity)&&(identical(other.unitPostalCode, unitPostalCode) || other.unitPostalCode == unitPostalCode)&&(identical(other.unitAddress, unitAddress) || other.unitAddress == unitAddress)&&(identical(other.personType, personType) || other.personType == personType)&&(identical(other.type, type) || other.type == type));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hashAll([runtimeType,const DeepCollectionEquality().hash(role),city,province,key,userGateWayId,const DeepCollectionEquality().hash(userDjangoIdForeignKey),const DeepCollectionEquality().hash(provinceIdForeignKey),const DeepCollectionEquality().hash(cityIdForeignKey),const DeepCollectionEquality().hash(systemUserProfileIdKey),fullname,firstName,lastName,nationalCode,nationalCodeImage,nationalId,mobile,birthday,image,password,active,state,baseOrder,cityNumber,cityName,provinceNumber,provinceName,unitName,unitNationalId,unitRegistrationNumber,unitEconomicalNumber,unitProvince,unitCity,unitPostalCode,unitAddress,personType,type]);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'UserProfile(role: $role, city: $city, province: $province, key: $key, userGateWayId: $userGateWayId, userDjangoIdForeignKey: $userDjangoIdForeignKey, provinceIdForeignKey: $provinceIdForeignKey, cityIdForeignKey: $cityIdForeignKey, systemUserProfileIdKey: $systemUserProfileIdKey, fullname: $fullname, firstName: $firstName, lastName: $lastName, nationalCode: $nationalCode, nationalCodeImage: $nationalCodeImage, nationalId: $nationalId, mobile: $mobile, birthday: $birthday, image: $image, password: $password, active: $active, state: $state, baseOrder: $baseOrder, cityNumber: $cityNumber, cityName: $cityName, provinceNumber: $provinceNumber, provinceName: $provinceName, unitName: $unitName, unitNationalId: $unitNationalId, unitRegistrationNumber: $unitRegistrationNumber, unitEconomicalNumber: $unitEconomicalNumber, unitProvince: $unitProvince, unitCity: $unitCity, unitPostalCode: $unitPostalCode, unitAddress: $unitAddress, personType: $personType, type: $type)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $UserProfileCopyWith<$Res> {
|
||||
factory $UserProfileCopyWith(UserProfile value, $Res Function(UserProfile) _then) = _$UserProfileCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
List<String>? role, String? city, String? province, String? key, String? userGateWayId, dynamic userDjangoIdForeignKey, dynamic provinceIdForeignKey, dynamic cityIdForeignKey, dynamic systemUserProfileIdKey, String? fullname, String? firstName, String? lastName, String? nationalCode, String? nationalCodeImage, String? nationalId, String? mobile, String? birthday, String? image, String? password, bool? active, UserState? state, int? baseOrder, int? cityNumber, String? cityName, int? provinceNumber, String? provinceName, String? unitName, String? unitNationalId, String? unitRegistrationNumber, String? unitEconomicalNumber, String? unitProvince, String? unitCity, String? unitPostalCode, String? unitAddress, String? personType, String? type
|
||||
});
|
||||
|
||||
|
||||
$UserStateCopyWith<$Res>? get state;
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$UserProfileCopyWithImpl<$Res>
|
||||
implements $UserProfileCopyWith<$Res> {
|
||||
_$UserProfileCopyWithImpl(this._self, this._then);
|
||||
|
||||
final UserProfile _self;
|
||||
final $Res Function(UserProfile) _then;
|
||||
|
||||
/// Create a copy of UserProfile
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? role = freezed,Object? city = freezed,Object? province = freezed,Object? key = freezed,Object? userGateWayId = freezed,Object? userDjangoIdForeignKey = freezed,Object? provinceIdForeignKey = freezed,Object? cityIdForeignKey = freezed,Object? systemUserProfileIdKey = freezed,Object? fullname = freezed,Object? firstName = freezed,Object? lastName = freezed,Object? nationalCode = freezed,Object? nationalCodeImage = freezed,Object? nationalId = freezed,Object? mobile = freezed,Object? birthday = freezed,Object? image = freezed,Object? password = freezed,Object? active = freezed,Object? state = freezed,Object? baseOrder = freezed,Object? cityNumber = freezed,Object? cityName = freezed,Object? provinceNumber = freezed,Object? provinceName = freezed,Object? unitName = freezed,Object? unitNationalId = freezed,Object? unitRegistrationNumber = freezed,Object? unitEconomicalNumber = freezed,Object? unitProvince = freezed,Object? unitCity = freezed,Object? unitPostalCode = freezed,Object? unitAddress = freezed,Object? personType = freezed,Object? type = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
role: freezed == role ? _self.role : role // ignore: cast_nullable_to_non_nullable
|
||||
as List<String>?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable
|
||||
as String?,province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable
|
||||
as String?,key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable
|
||||
as String?,userGateWayId: freezed == userGateWayId ? _self.userGateWayId : userGateWayId // ignore: cast_nullable_to_non_nullable
|
||||
as String?,userDjangoIdForeignKey: freezed == userDjangoIdForeignKey ? _self.userDjangoIdForeignKey : userDjangoIdForeignKey // ignore: cast_nullable_to_non_nullable
|
||||
as dynamic,provinceIdForeignKey: freezed == provinceIdForeignKey ? _self.provinceIdForeignKey : provinceIdForeignKey // ignore: cast_nullable_to_non_nullable
|
||||
as dynamic,cityIdForeignKey: freezed == cityIdForeignKey ? _self.cityIdForeignKey : cityIdForeignKey // ignore: cast_nullable_to_non_nullable
|
||||
as dynamic,systemUserProfileIdKey: freezed == systemUserProfileIdKey ? _self.systemUserProfileIdKey : systemUserProfileIdKey // ignore: cast_nullable_to_non_nullable
|
||||
as dynamic,fullname: freezed == fullname ? _self.fullname : fullname // ignore: cast_nullable_to_non_nullable
|
||||
as String?,firstName: freezed == firstName ? _self.firstName : firstName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,lastName: freezed == lastName ? _self.lastName : lastName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,nationalCode: freezed == nationalCode ? _self.nationalCode : nationalCode // ignore: cast_nullable_to_non_nullable
|
||||
as String?,nationalCodeImage: freezed == nationalCodeImage ? _self.nationalCodeImage : nationalCodeImage // ignore: cast_nullable_to_non_nullable
|
||||
as String?,nationalId: freezed == nationalId ? _self.nationalId : nationalId // ignore: cast_nullable_to_non_nullable
|
||||
as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable
|
||||
as String?,birthday: freezed == birthday ? _self.birthday : birthday // ignore: cast_nullable_to_non_nullable
|
||||
as String?,image: freezed == image ? _self.image : image // ignore: cast_nullable_to_non_nullable
|
||||
as String?,password: freezed == password ? _self.password : password // ignore: cast_nullable_to_non_nullable
|
||||
as String?,active: freezed == active ? _self.active : active // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,state: freezed == state ? _self.state : state // ignore: cast_nullable_to_non_nullable
|
||||
as UserState?,baseOrder: freezed == baseOrder ? _self.baseOrder : baseOrder // ignore: cast_nullable_to_non_nullable
|
||||
as int?,cityNumber: freezed == cityNumber ? _self.cityNumber : cityNumber // ignore: cast_nullable_to_non_nullable
|
||||
as int?,cityName: freezed == cityName ? _self.cityName : cityName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,provinceNumber: freezed == provinceNumber ? _self.provinceNumber : provinceNumber // ignore: cast_nullable_to_non_nullable
|
||||
as int?,provinceName: freezed == provinceName ? _self.provinceName : provinceName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,unitName: freezed == unitName ? _self.unitName : unitName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,unitNationalId: freezed == unitNationalId ? _self.unitNationalId : unitNationalId // ignore: cast_nullable_to_non_nullable
|
||||
as String?,unitRegistrationNumber: freezed == unitRegistrationNumber ? _self.unitRegistrationNumber : unitRegistrationNumber // ignore: cast_nullable_to_non_nullable
|
||||
as String?,unitEconomicalNumber: freezed == unitEconomicalNumber ? _self.unitEconomicalNumber : unitEconomicalNumber // ignore: cast_nullable_to_non_nullable
|
||||
as String?,unitProvince: freezed == unitProvince ? _self.unitProvince : unitProvince // ignore: cast_nullable_to_non_nullable
|
||||
as String?,unitCity: freezed == unitCity ? _self.unitCity : unitCity // ignore: cast_nullable_to_non_nullable
|
||||
as String?,unitPostalCode: freezed == unitPostalCode ? _self.unitPostalCode : unitPostalCode // ignore: cast_nullable_to_non_nullable
|
||||
as String?,unitAddress: freezed == unitAddress ? _self.unitAddress : unitAddress // ignore: cast_nullable_to_non_nullable
|
||||
as String?,personType: freezed == personType ? _self.personType : personType // ignore: cast_nullable_to_non_nullable
|
||||
as String?,type: freezed == type ? _self.type : type // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
/// Create a copy of UserProfile
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$UserStateCopyWith<$Res>? get state {
|
||||
if (_self.state == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $UserStateCopyWith<$Res>(_self.state!, (value) {
|
||||
return _then(_self.copyWith(state: value));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [UserProfile].
|
||||
extension UserProfilePatterns on UserProfile {
|
||||
/// A variant of `map` that fallback to returning `orElse`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _UserProfile value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _UserProfile() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// Callbacks receives the raw object, upcasted.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case final Subclass2 value:
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _UserProfile value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _UserProfile():
|
||||
return $default(_that);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `map` that fallback to returning `null`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _UserProfile value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _UserProfile() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to an `orElse` callback.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( List<String>? role, String? city, String? province, String? key, String? userGateWayId, dynamic userDjangoIdForeignKey, dynamic provinceIdForeignKey, dynamic cityIdForeignKey, dynamic systemUserProfileIdKey, String? fullname, String? firstName, String? lastName, String? nationalCode, String? nationalCodeImage, String? nationalId, String? mobile, String? birthday, String? image, String? password, bool? active, UserState? state, int? baseOrder, int? cityNumber, String? cityName, int? provinceNumber, String? provinceName, String? unitName, String? unitNationalId, String? unitRegistrationNumber, String? unitEconomicalNumber, String? unitProvince, String? unitCity, String? unitPostalCode, String? unitAddress, String? personType, String? type)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _UserProfile() when $default != null:
|
||||
return $default(_that.role,_that.city,_that.province,_that.key,_that.userGateWayId,_that.userDjangoIdForeignKey,_that.provinceIdForeignKey,_that.cityIdForeignKey,_that.systemUserProfileIdKey,_that.fullname,_that.firstName,_that.lastName,_that.nationalCode,_that.nationalCodeImage,_that.nationalId,_that.mobile,_that.birthday,_that.image,_that.password,_that.active,_that.state,_that.baseOrder,_that.cityNumber,_that.cityName,_that.provinceNumber,_that.provinceName,_that.unitName,_that.unitNationalId,_that.unitRegistrationNumber,_that.unitEconomicalNumber,_that.unitProvince,_that.unitCity,_that.unitPostalCode,_that.unitAddress,_that.personType,_that.type);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// As opposed to `map`, this offers destructuring.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case Subclass2(:final field2):
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( List<String>? role, String? city, String? province, String? key, String? userGateWayId, dynamic userDjangoIdForeignKey, dynamic provinceIdForeignKey, dynamic cityIdForeignKey, dynamic systemUserProfileIdKey, String? fullname, String? firstName, String? lastName, String? nationalCode, String? nationalCodeImage, String? nationalId, String? mobile, String? birthday, String? image, String? password, bool? active, UserState? state, int? baseOrder, int? cityNumber, String? cityName, int? provinceNumber, String? provinceName, String? unitName, String? unitNationalId, String? unitRegistrationNumber, String? unitEconomicalNumber, String? unitProvince, String? unitCity, String? unitPostalCode, String? unitAddress, String? personType, String? type) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _UserProfile():
|
||||
return $default(_that.role,_that.city,_that.province,_that.key,_that.userGateWayId,_that.userDjangoIdForeignKey,_that.provinceIdForeignKey,_that.cityIdForeignKey,_that.systemUserProfileIdKey,_that.fullname,_that.firstName,_that.lastName,_that.nationalCode,_that.nationalCodeImage,_that.nationalId,_that.mobile,_that.birthday,_that.image,_that.password,_that.active,_that.state,_that.baseOrder,_that.cityNumber,_that.cityName,_that.provinceNumber,_that.provinceName,_that.unitName,_that.unitNationalId,_that.unitRegistrationNumber,_that.unitEconomicalNumber,_that.unitProvince,_that.unitCity,_that.unitPostalCode,_that.unitAddress,_that.personType,_that.type);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to returning `null`
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( List<String>? role, String? city, String? province, String? key, String? userGateWayId, dynamic userDjangoIdForeignKey, dynamic provinceIdForeignKey, dynamic cityIdForeignKey, dynamic systemUserProfileIdKey, String? fullname, String? firstName, String? lastName, String? nationalCode, String? nationalCodeImage, String? nationalId, String? mobile, String? birthday, String? image, String? password, bool? active, UserState? state, int? baseOrder, int? cityNumber, String? cityName, int? provinceNumber, String? provinceName, String? unitName, String? unitNationalId, String? unitRegistrationNumber, String? unitEconomicalNumber, String? unitProvince, String? unitCity, String? unitPostalCode, String? unitAddress, String? personType, String? type)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _UserProfile() when $default != null:
|
||||
return $default(_that.role,_that.city,_that.province,_that.key,_that.userGateWayId,_that.userDjangoIdForeignKey,_that.provinceIdForeignKey,_that.cityIdForeignKey,_that.systemUserProfileIdKey,_that.fullname,_that.firstName,_that.lastName,_that.nationalCode,_that.nationalCodeImage,_that.nationalId,_that.mobile,_that.birthday,_that.image,_that.password,_that.active,_that.state,_that.baseOrder,_that.cityNumber,_that.cityName,_that.provinceNumber,_that.provinceName,_that.unitName,_that.unitNationalId,_that.unitRegistrationNumber,_that.unitEconomicalNumber,_that.unitProvince,_that.unitCity,_that.unitPostalCode,_that.unitAddress,_that.personType,_that.type);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
|
||||
class _UserProfile implements UserProfile {
|
||||
const _UserProfile({final List<String>? role, this.city, this.province, this.key, this.userGateWayId, this.userDjangoIdForeignKey, this.provinceIdForeignKey, this.cityIdForeignKey, this.systemUserProfileIdKey, this.fullname, this.firstName, this.lastName, this.nationalCode, this.nationalCodeImage, this.nationalId, this.mobile, this.birthday, this.image, this.password, this.active, this.state, this.baseOrder, this.cityNumber, this.cityName, this.provinceNumber, this.provinceName, this.unitName, this.unitNationalId, this.unitRegistrationNumber, this.unitEconomicalNumber, this.unitProvince, this.unitCity, this.unitPostalCode, this.unitAddress, this.personType, this.type}): _role = role;
|
||||
factory _UserProfile.fromJson(Map<String, dynamic> json) => _$UserProfileFromJson(json);
|
||||
|
||||
final List<String>? _role;
|
||||
@override List<String>? get role {
|
||||
final value = _role;
|
||||
if (value == null) return null;
|
||||
if (_role is EqualUnmodifiableListView) return _role;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(value);
|
||||
}
|
||||
|
||||
@override final String? city;
|
||||
@override final String? province;
|
||||
@override final String? key;
|
||||
@override final String? userGateWayId;
|
||||
@override final dynamic userDjangoIdForeignKey;
|
||||
@override final dynamic provinceIdForeignKey;
|
||||
@override final dynamic cityIdForeignKey;
|
||||
@override final dynamic systemUserProfileIdKey;
|
||||
@override final String? fullname;
|
||||
@override final String? firstName;
|
||||
@override final String? lastName;
|
||||
@override final String? nationalCode;
|
||||
@override final String? nationalCodeImage;
|
||||
@override final String? nationalId;
|
||||
@override final String? mobile;
|
||||
@override final String? birthday;
|
||||
@override final String? image;
|
||||
@override final String? password;
|
||||
@override final bool? active;
|
||||
@override final UserState? state;
|
||||
@override final int? baseOrder;
|
||||
@override final int? cityNumber;
|
||||
@override final String? cityName;
|
||||
@override final int? provinceNumber;
|
||||
@override final String? provinceName;
|
||||
@override final String? unitName;
|
||||
@override final String? unitNationalId;
|
||||
@override final String? unitRegistrationNumber;
|
||||
@override final String? unitEconomicalNumber;
|
||||
@override final String? unitProvince;
|
||||
@override final String? unitCity;
|
||||
@override final String? unitPostalCode;
|
||||
@override final String? unitAddress;
|
||||
@override final String? personType;
|
||||
@override final String? type;
|
||||
|
||||
/// Create a copy of UserProfile
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$UserProfileCopyWith<_UserProfile> get copyWith => __$UserProfileCopyWithImpl<_UserProfile>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$UserProfileToJson(this, );
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _UserProfile&&const DeepCollectionEquality().equals(other._role, _role)&&(identical(other.city, city) || other.city == city)&&(identical(other.province, province) || other.province == province)&&(identical(other.key, key) || other.key == key)&&(identical(other.userGateWayId, userGateWayId) || other.userGateWayId == userGateWayId)&&const DeepCollectionEquality().equals(other.userDjangoIdForeignKey, userDjangoIdForeignKey)&&const DeepCollectionEquality().equals(other.provinceIdForeignKey, provinceIdForeignKey)&&const DeepCollectionEquality().equals(other.cityIdForeignKey, cityIdForeignKey)&&const DeepCollectionEquality().equals(other.systemUserProfileIdKey, systemUserProfileIdKey)&&(identical(other.fullname, fullname) || other.fullname == fullname)&&(identical(other.firstName, firstName) || other.firstName == firstName)&&(identical(other.lastName, lastName) || other.lastName == lastName)&&(identical(other.nationalCode, nationalCode) || other.nationalCode == nationalCode)&&(identical(other.nationalCodeImage, nationalCodeImage) || other.nationalCodeImage == nationalCodeImage)&&(identical(other.nationalId, nationalId) || other.nationalId == nationalId)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.birthday, birthday) || other.birthday == birthday)&&(identical(other.image, image) || other.image == image)&&(identical(other.password, password) || other.password == password)&&(identical(other.active, active) || other.active == active)&&(identical(other.state, state) || other.state == state)&&(identical(other.baseOrder, baseOrder) || other.baseOrder == baseOrder)&&(identical(other.cityNumber, cityNumber) || other.cityNumber == cityNumber)&&(identical(other.cityName, cityName) || other.cityName == cityName)&&(identical(other.provinceNumber, provinceNumber) || other.provinceNumber == provinceNumber)&&(identical(other.provinceName, provinceName) || other.provinceName == provinceName)&&(identical(other.unitName, unitName) || other.unitName == unitName)&&(identical(other.unitNationalId, unitNationalId) || other.unitNationalId == unitNationalId)&&(identical(other.unitRegistrationNumber, unitRegistrationNumber) || other.unitRegistrationNumber == unitRegistrationNumber)&&(identical(other.unitEconomicalNumber, unitEconomicalNumber) || other.unitEconomicalNumber == unitEconomicalNumber)&&(identical(other.unitProvince, unitProvince) || other.unitProvince == unitProvince)&&(identical(other.unitCity, unitCity) || other.unitCity == unitCity)&&(identical(other.unitPostalCode, unitPostalCode) || other.unitPostalCode == unitPostalCode)&&(identical(other.unitAddress, unitAddress) || other.unitAddress == unitAddress)&&(identical(other.personType, personType) || other.personType == personType)&&(identical(other.type, type) || other.type == type));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hashAll([runtimeType,const DeepCollectionEquality().hash(_role),city,province,key,userGateWayId,const DeepCollectionEquality().hash(userDjangoIdForeignKey),const DeepCollectionEquality().hash(provinceIdForeignKey),const DeepCollectionEquality().hash(cityIdForeignKey),const DeepCollectionEquality().hash(systemUserProfileIdKey),fullname,firstName,lastName,nationalCode,nationalCodeImage,nationalId,mobile,birthday,image,password,active,state,baseOrder,cityNumber,cityName,provinceNumber,provinceName,unitName,unitNationalId,unitRegistrationNumber,unitEconomicalNumber,unitProvince,unitCity,unitPostalCode,unitAddress,personType,type]);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'UserProfile(role: $role, city: $city, province: $province, key: $key, userGateWayId: $userGateWayId, userDjangoIdForeignKey: $userDjangoIdForeignKey, provinceIdForeignKey: $provinceIdForeignKey, cityIdForeignKey: $cityIdForeignKey, systemUserProfileIdKey: $systemUserProfileIdKey, fullname: $fullname, firstName: $firstName, lastName: $lastName, nationalCode: $nationalCode, nationalCodeImage: $nationalCodeImage, nationalId: $nationalId, mobile: $mobile, birthday: $birthday, image: $image, password: $password, active: $active, state: $state, baseOrder: $baseOrder, cityNumber: $cityNumber, cityName: $cityName, provinceNumber: $provinceNumber, provinceName: $provinceName, unitName: $unitName, unitNationalId: $unitNationalId, unitRegistrationNumber: $unitRegistrationNumber, unitEconomicalNumber: $unitEconomicalNumber, unitProvince: $unitProvince, unitCity: $unitCity, unitPostalCode: $unitPostalCode, unitAddress: $unitAddress, personType: $personType, type: $type)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$UserProfileCopyWith<$Res> implements $UserProfileCopyWith<$Res> {
|
||||
factory _$UserProfileCopyWith(_UserProfile value, $Res Function(_UserProfile) _then) = __$UserProfileCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
List<String>? role, String? city, String? province, String? key, String? userGateWayId, dynamic userDjangoIdForeignKey, dynamic provinceIdForeignKey, dynamic cityIdForeignKey, dynamic systemUserProfileIdKey, String? fullname, String? firstName, String? lastName, String? nationalCode, String? nationalCodeImage, String? nationalId, String? mobile, String? birthday, String? image, String? password, bool? active, UserState? state, int? baseOrder, int? cityNumber, String? cityName, int? provinceNumber, String? provinceName, String? unitName, String? unitNationalId, String? unitRegistrationNumber, String? unitEconomicalNumber, String? unitProvince, String? unitCity, String? unitPostalCode, String? unitAddress, String? personType, String? type
|
||||
});
|
||||
|
||||
|
||||
@override $UserStateCopyWith<$Res>? get state;
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$UserProfileCopyWithImpl<$Res>
|
||||
implements _$UserProfileCopyWith<$Res> {
|
||||
__$UserProfileCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _UserProfile _self;
|
||||
final $Res Function(_UserProfile) _then;
|
||||
|
||||
/// Create a copy of UserProfile
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? role = freezed,Object? city = freezed,Object? province = freezed,Object? key = freezed,Object? userGateWayId = freezed,Object? userDjangoIdForeignKey = freezed,Object? provinceIdForeignKey = freezed,Object? cityIdForeignKey = freezed,Object? systemUserProfileIdKey = freezed,Object? fullname = freezed,Object? firstName = freezed,Object? lastName = freezed,Object? nationalCode = freezed,Object? nationalCodeImage = freezed,Object? nationalId = freezed,Object? mobile = freezed,Object? birthday = freezed,Object? image = freezed,Object? password = freezed,Object? active = freezed,Object? state = freezed,Object? baseOrder = freezed,Object? cityNumber = freezed,Object? cityName = freezed,Object? provinceNumber = freezed,Object? provinceName = freezed,Object? unitName = freezed,Object? unitNationalId = freezed,Object? unitRegistrationNumber = freezed,Object? unitEconomicalNumber = freezed,Object? unitProvince = freezed,Object? unitCity = freezed,Object? unitPostalCode = freezed,Object? unitAddress = freezed,Object? personType = freezed,Object? type = freezed,}) {
|
||||
return _then(_UserProfile(
|
||||
role: freezed == role ? _self._role : role // ignore: cast_nullable_to_non_nullable
|
||||
as List<String>?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable
|
||||
as String?,province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable
|
||||
as String?,key: freezed == key ? _self.key : key // ignore: cast_nullable_to_non_nullable
|
||||
as String?,userGateWayId: freezed == userGateWayId ? _self.userGateWayId : userGateWayId // ignore: cast_nullable_to_non_nullable
|
||||
as String?,userDjangoIdForeignKey: freezed == userDjangoIdForeignKey ? _self.userDjangoIdForeignKey : userDjangoIdForeignKey // ignore: cast_nullable_to_non_nullable
|
||||
as dynamic,provinceIdForeignKey: freezed == provinceIdForeignKey ? _self.provinceIdForeignKey : provinceIdForeignKey // ignore: cast_nullable_to_non_nullable
|
||||
as dynamic,cityIdForeignKey: freezed == cityIdForeignKey ? _self.cityIdForeignKey : cityIdForeignKey // ignore: cast_nullable_to_non_nullable
|
||||
as dynamic,systemUserProfileIdKey: freezed == systemUserProfileIdKey ? _self.systemUserProfileIdKey : systemUserProfileIdKey // ignore: cast_nullable_to_non_nullable
|
||||
as dynamic,fullname: freezed == fullname ? _self.fullname : fullname // ignore: cast_nullable_to_non_nullable
|
||||
as String?,firstName: freezed == firstName ? _self.firstName : firstName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,lastName: freezed == lastName ? _self.lastName : lastName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,nationalCode: freezed == nationalCode ? _self.nationalCode : nationalCode // ignore: cast_nullable_to_non_nullable
|
||||
as String?,nationalCodeImage: freezed == nationalCodeImage ? _self.nationalCodeImage : nationalCodeImage // ignore: cast_nullable_to_non_nullable
|
||||
as String?,nationalId: freezed == nationalId ? _self.nationalId : nationalId // ignore: cast_nullable_to_non_nullable
|
||||
as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable
|
||||
as String?,birthday: freezed == birthday ? _self.birthday : birthday // ignore: cast_nullable_to_non_nullable
|
||||
as String?,image: freezed == image ? _self.image : image // ignore: cast_nullable_to_non_nullable
|
||||
as String?,password: freezed == password ? _self.password : password // ignore: cast_nullable_to_non_nullable
|
||||
as String?,active: freezed == active ? _self.active : active // ignore: cast_nullable_to_non_nullable
|
||||
as bool?,state: freezed == state ? _self.state : state // ignore: cast_nullable_to_non_nullable
|
||||
as UserState?,baseOrder: freezed == baseOrder ? _self.baseOrder : baseOrder // ignore: cast_nullable_to_non_nullable
|
||||
as int?,cityNumber: freezed == cityNumber ? _self.cityNumber : cityNumber // ignore: cast_nullable_to_non_nullable
|
||||
as int?,cityName: freezed == cityName ? _self.cityName : cityName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,provinceNumber: freezed == provinceNumber ? _self.provinceNumber : provinceNumber // ignore: cast_nullable_to_non_nullable
|
||||
as int?,provinceName: freezed == provinceName ? _self.provinceName : provinceName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,unitName: freezed == unitName ? _self.unitName : unitName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,unitNationalId: freezed == unitNationalId ? _self.unitNationalId : unitNationalId // ignore: cast_nullable_to_non_nullable
|
||||
as String?,unitRegistrationNumber: freezed == unitRegistrationNumber ? _self.unitRegistrationNumber : unitRegistrationNumber // ignore: cast_nullable_to_non_nullable
|
||||
as String?,unitEconomicalNumber: freezed == unitEconomicalNumber ? _self.unitEconomicalNumber : unitEconomicalNumber // ignore: cast_nullable_to_non_nullable
|
||||
as String?,unitProvince: freezed == unitProvince ? _self.unitProvince : unitProvince // ignore: cast_nullable_to_non_nullable
|
||||
as String?,unitCity: freezed == unitCity ? _self.unitCity : unitCity // ignore: cast_nullable_to_non_nullable
|
||||
as String?,unitPostalCode: freezed == unitPostalCode ? _self.unitPostalCode : unitPostalCode // ignore: cast_nullable_to_non_nullable
|
||||
as String?,unitAddress: freezed == unitAddress ? _self.unitAddress : unitAddress // ignore: cast_nullable_to_non_nullable
|
||||
as String?,personType: freezed == personType ? _self.personType : personType // ignore: cast_nullable_to_non_nullable
|
||||
as String?,type: freezed == type ? _self.type : type // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
|
||||
/// Create a copy of UserProfile
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override
|
||||
@pragma('vm:prefer-inline')
|
||||
$UserStateCopyWith<$Res>? get state {
|
||||
if (_self.state == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $UserStateCopyWith<$Res>(_self.state!, (value) {
|
||||
return _then(_self.copyWith(state: value));
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// @nodoc
|
||||
mixin _$UserState {
|
||||
|
||||
String? get city; String? get image; String? get mobile; String? get birthday; String? get province; String? get lastName; String? get firstName; String? get nationalId; String? get nationalCode;
|
||||
/// Create a copy of UserState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$UserStateCopyWith<UserState> get copyWith => _$UserStateCopyWithImpl<UserState>(this as UserState, _$identity);
|
||||
|
||||
/// Serializes this UserState to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is UserState&&(identical(other.city, city) || other.city == city)&&(identical(other.image, image) || other.image == image)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.birthday, birthday) || other.birthday == birthday)&&(identical(other.province, province) || other.province == province)&&(identical(other.lastName, lastName) || other.lastName == lastName)&&(identical(other.firstName, firstName) || other.firstName == firstName)&&(identical(other.nationalId, nationalId) || other.nationalId == nationalId)&&(identical(other.nationalCode, nationalCode) || other.nationalCode == nationalCode));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,city,image,mobile,birthday,province,lastName,firstName,nationalId,nationalCode);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'UserState(city: $city, image: $image, mobile: $mobile, birthday: $birthday, province: $province, lastName: $lastName, firstName: $firstName, nationalId: $nationalId, nationalCode: $nationalCode)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $UserStateCopyWith<$Res> {
|
||||
factory $UserStateCopyWith(UserState value, $Res Function(UserState) _then) = _$UserStateCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
String? city, String? image, String? mobile, String? birthday, String? province, String? lastName, String? firstName, String? nationalId, String? nationalCode
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$UserStateCopyWithImpl<$Res>
|
||||
implements $UserStateCopyWith<$Res> {
|
||||
_$UserStateCopyWithImpl(this._self, this._then);
|
||||
|
||||
final UserState _self;
|
||||
final $Res Function(UserState) _then;
|
||||
|
||||
/// Create a copy of UserState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? city = freezed,Object? image = freezed,Object? mobile = freezed,Object? birthday = freezed,Object? province = freezed,Object? lastName = freezed,Object? firstName = freezed,Object? nationalId = freezed,Object? nationalCode = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable
|
||||
as String?,image: freezed == image ? _self.image : image // ignore: cast_nullable_to_non_nullable
|
||||
as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable
|
||||
as String?,birthday: freezed == birthday ? _self.birthday : birthday // ignore: cast_nullable_to_non_nullable
|
||||
as String?,province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable
|
||||
as String?,lastName: freezed == lastName ? _self.lastName : lastName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,firstName: freezed == firstName ? _self.firstName : firstName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,nationalId: freezed == nationalId ? _self.nationalId : nationalId // ignore: cast_nullable_to_non_nullable
|
||||
as String?,nationalCode: freezed == nationalCode ? _self.nationalCode : nationalCode // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [UserState].
|
||||
extension UserStatePatterns on UserState {
|
||||
/// A variant of `map` that fallback to returning `orElse`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _UserState value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _UserState() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// Callbacks receives the raw object, upcasted.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case final Subclass2 value:
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _UserState value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _UserState():
|
||||
return $default(_that);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `map` that fallback to returning `null`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _UserState value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _UserState() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to an `orElse` callback.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String? city, String? image, String? mobile, String? birthday, String? province, String? lastName, String? firstName, String? nationalId, String? nationalCode)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _UserState() when $default != null:
|
||||
return $default(_that.city,_that.image,_that.mobile,_that.birthday,_that.province,_that.lastName,_that.firstName,_that.nationalId,_that.nationalCode);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// As opposed to `map`, this offers destructuring.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case Subclass2(:final field2):
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String? city, String? image, String? mobile, String? birthday, String? province, String? lastName, String? firstName, String? nationalId, String? nationalCode) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _UserState():
|
||||
return $default(_that.city,_that.image,_that.mobile,_that.birthday,_that.province,_that.lastName,_that.firstName,_that.nationalId,_that.nationalCode);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to returning `null`
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String? city, String? image, String? mobile, String? birthday, String? province, String? lastName, String? firstName, String? nationalId, String? nationalCode)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _UserState() when $default != null:
|
||||
return $default(_that.city,_that.image,_that.mobile,_that.birthday,_that.province,_that.lastName,_that.firstName,_that.nationalId,_that.nationalCode);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
|
||||
class _UserState implements UserState {
|
||||
const _UserState({this.city, this.image, this.mobile, this.birthday, this.province, this.lastName, this.firstName, this.nationalId, this.nationalCode});
|
||||
factory _UserState.fromJson(Map<String, dynamic> json) => _$UserStateFromJson(json);
|
||||
|
||||
@override final String? city;
|
||||
@override final String? image;
|
||||
@override final String? mobile;
|
||||
@override final String? birthday;
|
||||
@override final String? province;
|
||||
@override final String? lastName;
|
||||
@override final String? firstName;
|
||||
@override final String? nationalId;
|
||||
@override final String? nationalCode;
|
||||
|
||||
/// Create a copy of UserState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$UserStateCopyWith<_UserState> get copyWith => __$UserStateCopyWithImpl<_UserState>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$UserStateToJson(this, );
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _UserState&&(identical(other.city, city) || other.city == city)&&(identical(other.image, image) || other.image == image)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.birthday, birthday) || other.birthday == birthday)&&(identical(other.province, province) || other.province == province)&&(identical(other.lastName, lastName) || other.lastName == lastName)&&(identical(other.firstName, firstName) || other.firstName == firstName)&&(identical(other.nationalId, nationalId) || other.nationalId == nationalId)&&(identical(other.nationalCode, nationalCode) || other.nationalCode == nationalCode));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,city,image,mobile,birthday,province,lastName,firstName,nationalId,nationalCode);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'UserState(city: $city, image: $image, mobile: $mobile, birthday: $birthday, province: $province, lastName: $lastName, firstName: $firstName, nationalId: $nationalId, nationalCode: $nationalCode)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$UserStateCopyWith<$Res> implements $UserStateCopyWith<$Res> {
|
||||
factory _$UserStateCopyWith(_UserState value, $Res Function(_UserState) _then) = __$UserStateCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
String? city, String? image, String? mobile, String? birthday, String? province, String? lastName, String? firstName, String? nationalId, String? nationalCode
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$UserStateCopyWithImpl<$Res>
|
||||
implements _$UserStateCopyWith<$Res> {
|
||||
__$UserStateCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _UserState _self;
|
||||
final $Res Function(_UserState) _then;
|
||||
|
||||
/// Create a copy of UserState
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? city = freezed,Object? image = freezed,Object? mobile = freezed,Object? birthday = freezed,Object? province = freezed,Object? lastName = freezed,Object? firstName = freezed,Object? nationalId = freezed,Object? nationalCode = freezed,}) {
|
||||
return _then(_UserState(
|
||||
city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable
|
||||
as String?,image: freezed == image ? _self.image : image // ignore: cast_nullable_to_non_nullable
|
||||
as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable
|
||||
as String?,birthday: freezed == birthday ? _self.birthday : birthday // ignore: cast_nullable_to_non_nullable
|
||||
as String?,province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable
|
||||
as String?,lastName: freezed == lastName ? _self.lastName : lastName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,firstName: freezed == firstName ? _self.firstName : firstName // ignore: cast_nullable_to_non_nullable
|
||||
as String?,nationalId: freezed == nationalId ? _self.nationalId : nationalId // ignore: cast_nullable_to_non_nullable
|
||||
as String?,nationalCode: freezed == nationalCode ? _self.nationalCode : nationalCode // ignore: cast_nullable_to_non_nullable
|
||||
as String?,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// dart format on
|
||||
@@ -0,0 +1,113 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'user_profile.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_UserProfile _$UserProfileFromJson(Map<String, dynamic> json) => _UserProfile(
|
||||
role: (json['role'] as List<dynamic>?)?.map((e) => e as String).toList(),
|
||||
city: json['city'] as String?,
|
||||
province: json['province'] as String?,
|
||||
key: json['key'] as String?,
|
||||
userGateWayId: json['user_gate_way_id'] as String?,
|
||||
userDjangoIdForeignKey: json['user_django_id_foreign_key'],
|
||||
provinceIdForeignKey: json['province_id_foreign_key'],
|
||||
cityIdForeignKey: json['city_id_foreign_key'],
|
||||
systemUserProfileIdKey: json['system_user_profile_id_key'],
|
||||
fullname: json['fullname'] as String?,
|
||||
firstName: json['first_name'] as String?,
|
||||
lastName: json['last_name'] as String?,
|
||||
nationalCode: json['national_code'] as String?,
|
||||
nationalCodeImage: json['national_code_image'] as String?,
|
||||
nationalId: json['national_id'] as String?,
|
||||
mobile: json['mobile'] as String?,
|
||||
birthday: json['birthday'] as String?,
|
||||
image: json['image'] as String?,
|
||||
password: json['password'] as String?,
|
||||
active: json['active'] as bool?,
|
||||
state: json['state'] == null
|
||||
? null
|
||||
: UserState.fromJson(json['state'] as Map<String, dynamic>),
|
||||
baseOrder: (json['base_order'] as num?)?.toInt(),
|
||||
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?,
|
||||
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?,
|
||||
personType: json['person_type'] as String?,
|
||||
type: json['type'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$UserProfileToJson(_UserProfile instance) =>
|
||||
<String, dynamic>{
|
||||
'role': instance.role,
|
||||
'city': instance.city,
|
||||
'province': instance.province,
|
||||
'key': instance.key,
|
||||
'user_gate_way_id': instance.userGateWayId,
|
||||
'user_django_id_foreign_key': instance.userDjangoIdForeignKey,
|
||||
'province_id_foreign_key': instance.provinceIdForeignKey,
|
||||
'city_id_foreign_key': instance.cityIdForeignKey,
|
||||
'system_user_profile_id_key': instance.systemUserProfileIdKey,
|
||||
'fullname': instance.fullname,
|
||||
'first_name': instance.firstName,
|
||||
'last_name': instance.lastName,
|
||||
'national_code': instance.nationalCode,
|
||||
'national_code_image': instance.nationalCodeImage,
|
||||
'national_id': instance.nationalId,
|
||||
'mobile': instance.mobile,
|
||||
'birthday': instance.birthday,
|
||||
'image': instance.image,
|
||||
'password': instance.password,
|
||||
'active': instance.active,
|
||||
'state': instance.state,
|
||||
'base_order': instance.baseOrder,
|
||||
'city_number': instance.cityNumber,
|
||||
'city_name': instance.cityName,
|
||||
'province_number': instance.provinceNumber,
|
||||
'province_name': instance.provinceName,
|
||||
'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,
|
||||
'person_type': instance.personType,
|
||||
'type': instance.type,
|
||||
};
|
||||
|
||||
_UserState _$UserStateFromJson(Map<String, dynamic> json) => _UserState(
|
||||
city: json['city'] as String?,
|
||||
image: json['image'] as String?,
|
||||
mobile: json['mobile'] as String?,
|
||||
birthday: json['birthday'] as String?,
|
||||
province: json['province'] as String?,
|
||||
lastName: json['last_name'] as String?,
|
||||
firstName: json['first_name'] as String?,
|
||||
nationalId: json['national_id'] as String?,
|
||||
nationalCode: json['national_code'] as String?,
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$UserStateToJson(_UserState instance) =>
|
||||
<String, dynamic>{
|
||||
'city': instance.city,
|
||||
'image': instance.image,
|
||||
'mobile': instance.mobile,
|
||||
'birthday': instance.birthday,
|
||||
'province': instance.province,
|
||||
'last_name': instance.lastName,
|
||||
'first_name': instance.firstName,
|
||||
'national_id': instance.nationalId,
|
||||
'national_code': instance.nationalCode,
|
||||
};
|
||||
@@ -0,0 +1,30 @@
|
||||
import 'package:freezed_annotation/freezed_annotation.dart';
|
||||
|
||||
part 'user_profile_model.freezed.dart';
|
||||
|
||||
part 'user_profile_model.g.dart';
|
||||
|
||||
@freezed
|
||||
abstract class UserProfileModel with _$UserProfileModel {
|
||||
const factory UserProfileModel({
|
||||
String? accessToken,
|
||||
String? expiresIn,
|
||||
String? scope,
|
||||
String? expireTime,
|
||||
String? mobile,
|
||||
String? fullname,
|
||||
String? firstname,
|
||||
String? lastname,
|
||||
String? city,
|
||||
String? province,
|
||||
String? nationalCode,
|
||||
String? nationalId,
|
||||
String? birthday,
|
||||
String? image,
|
||||
int? baseOrder,
|
||||
List<String>? role,
|
||||
}) = _UserProfileModel;
|
||||
|
||||
factory UserProfileModel.fromJson(Map<String, dynamic> json) =>
|
||||
_$UserProfileModelFromJson(json);
|
||||
}
|
||||
@@ -0,0 +1,330 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
// coverage:ignore-file
|
||||
// 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 'user_profile_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// FreezedGenerator
|
||||
// **************************************************************************
|
||||
|
||||
// dart format off
|
||||
T _$identity<T>(T value) => value;
|
||||
|
||||
/// @nodoc
|
||||
mixin _$UserProfileModel {
|
||||
|
||||
String? get accessToken; String? get expiresIn; String? get scope; String? get expireTime; String? get mobile; String? get fullname; String? get firstname; String? get lastname; String? get city; String? get province; String? get nationalCode; String? get nationalId; String? get birthday; String? get image; int? get baseOrder; List<String>? get role;
|
||||
/// Create a copy of UserProfileModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
$UserProfileModelCopyWith<UserProfileModel> get copyWith => _$UserProfileModelCopyWithImpl<UserProfileModel>(this as UserProfileModel, _$identity);
|
||||
|
||||
/// Serializes this UserProfileModel to a JSON map.
|
||||
Map<String, dynamic> toJson();
|
||||
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is UserProfileModel&&(identical(other.accessToken, accessToken) || other.accessToken == accessToken)&&(identical(other.expiresIn, expiresIn) || other.expiresIn == expiresIn)&&(identical(other.scope, scope) || other.scope == scope)&&(identical(other.expireTime, expireTime) || other.expireTime == expireTime)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.fullname, fullname) || other.fullname == fullname)&&(identical(other.firstname, firstname) || other.firstname == firstname)&&(identical(other.lastname, lastname) || other.lastname == lastname)&&(identical(other.city, city) || other.city == city)&&(identical(other.province, province) || other.province == province)&&(identical(other.nationalCode, nationalCode) || other.nationalCode == nationalCode)&&(identical(other.nationalId, nationalId) || other.nationalId == nationalId)&&(identical(other.birthday, birthday) || other.birthday == birthday)&&(identical(other.image, image) || other.image == image)&&(identical(other.baseOrder, baseOrder) || other.baseOrder == baseOrder)&&const DeepCollectionEquality().equals(other.role, role));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,accessToken,expiresIn,scope,expireTime,mobile,fullname,firstname,lastname,city,province,nationalCode,nationalId,birthday,image,baseOrder,const DeepCollectionEquality().hash(role));
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'UserProfileModel(accessToken: $accessToken, expiresIn: $expiresIn, scope: $scope, expireTime: $expireTime, mobile: $mobile, fullname: $fullname, firstname: $firstname, lastname: $lastname, city: $city, province: $province, nationalCode: $nationalCode, nationalId: $nationalId, birthday: $birthday, image: $image, baseOrder: $baseOrder, role: $role)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class $UserProfileModelCopyWith<$Res> {
|
||||
factory $UserProfileModelCopyWith(UserProfileModel value, $Res Function(UserProfileModel) _then) = _$UserProfileModelCopyWithImpl;
|
||||
@useResult
|
||||
$Res call({
|
||||
String? accessToken, String? expiresIn, String? scope, String? expireTime, String? mobile, String? fullname, String? firstname, String? lastname, String? city, String? province, String? nationalCode, String? nationalId, String? birthday, String? image, int? baseOrder, List<String>? role
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class _$UserProfileModelCopyWithImpl<$Res>
|
||||
implements $UserProfileModelCopyWith<$Res> {
|
||||
_$UserProfileModelCopyWithImpl(this._self, this._then);
|
||||
|
||||
final UserProfileModel _self;
|
||||
final $Res Function(UserProfileModel) _then;
|
||||
|
||||
/// Create a copy of UserProfileModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@pragma('vm:prefer-inline') @override $Res call({Object? accessToken = freezed,Object? expiresIn = freezed,Object? scope = freezed,Object? expireTime = freezed,Object? mobile = freezed,Object? fullname = freezed,Object? firstname = freezed,Object? lastname = freezed,Object? city = freezed,Object? province = freezed,Object? nationalCode = freezed,Object? nationalId = freezed,Object? birthday = freezed,Object? image = freezed,Object? baseOrder = freezed,Object? role = freezed,}) {
|
||||
return _then(_self.copyWith(
|
||||
accessToken: freezed == accessToken ? _self.accessToken : accessToken // ignore: cast_nullable_to_non_nullable
|
||||
as String?,expiresIn: freezed == expiresIn ? _self.expiresIn : expiresIn // ignore: cast_nullable_to_non_nullable
|
||||
as String?,scope: freezed == scope ? _self.scope : scope // ignore: cast_nullable_to_non_nullable
|
||||
as String?,expireTime: freezed == expireTime ? _self.expireTime : expireTime // ignore: cast_nullable_to_non_nullable
|
||||
as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable
|
||||
as String?,fullname: freezed == fullname ? _self.fullname : fullname // ignore: cast_nullable_to_non_nullable
|
||||
as String?,firstname: freezed == firstname ? _self.firstname : firstname // ignore: cast_nullable_to_non_nullable
|
||||
as String?,lastname: freezed == lastname ? _self.lastname : lastname // ignore: cast_nullable_to_non_nullable
|
||||
as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable
|
||||
as String?,province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable
|
||||
as String?,nationalCode: freezed == nationalCode ? _self.nationalCode : nationalCode // ignore: cast_nullable_to_non_nullable
|
||||
as String?,nationalId: freezed == nationalId ? _self.nationalId : nationalId // ignore: cast_nullable_to_non_nullable
|
||||
as String?,birthday: freezed == birthday ? _self.birthday : birthday // ignore: cast_nullable_to_non_nullable
|
||||
as String?,image: freezed == image ? _self.image : image // ignore: cast_nullable_to_non_nullable
|
||||
as String?,baseOrder: freezed == baseOrder ? _self.baseOrder : baseOrder // ignore: cast_nullable_to_non_nullable
|
||||
as int?,role: freezed == role ? _self.role : role // ignore: cast_nullable_to_non_nullable
|
||||
as List<String>?,
|
||||
));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// Adds pattern-matching-related methods to [UserProfileModel].
|
||||
extension UserProfileModelPatterns on UserProfileModel {
|
||||
/// A variant of `map` that fallback to returning `orElse`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeMap<TResult extends Object?>(TResult Function( _UserProfileModel value)? $default,{required TResult orElse(),}){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _UserProfileModel() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// Callbacks receives the raw object, upcasted.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case final Subclass2 value:
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult map<TResult extends Object?>(TResult Function( _UserProfileModel value) $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _UserProfileModel():
|
||||
return $default(_that);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `map` that fallback to returning `null`.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case final Subclass value:
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? mapOrNull<TResult extends Object?>(TResult? Function( _UserProfileModel value)? $default,){
|
||||
final _that = this;
|
||||
switch (_that) {
|
||||
case _UserProfileModel() when $default != null:
|
||||
return $default(_that);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to an `orElse` callback.
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return orElse();
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult maybeWhen<TResult extends Object?>(TResult Function( String? accessToken, String? expiresIn, String? scope, String? expireTime, String? mobile, String? fullname, String? firstname, String? lastname, String? city, String? province, String? nationalCode, String? nationalId, String? birthday, String? image, int? baseOrder, List<String>? role)? $default,{required TResult orElse(),}) {final _that = this;
|
||||
switch (_that) {
|
||||
case _UserProfileModel() when $default != null:
|
||||
return $default(_that.accessToken,_that.expiresIn,_that.scope,_that.expireTime,_that.mobile,_that.fullname,_that.firstname,_that.lastname,_that.city,_that.province,_that.nationalCode,_that.nationalId,_that.birthday,_that.image,_that.baseOrder,_that.role);case _:
|
||||
return orElse();
|
||||
|
||||
}
|
||||
}
|
||||
/// A `switch`-like method, using callbacks.
|
||||
///
|
||||
/// As opposed to `map`, this offers destructuring.
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case Subclass2(:final field2):
|
||||
/// return ...;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult when<TResult extends Object?>(TResult Function( String? accessToken, String? expiresIn, String? scope, String? expireTime, String? mobile, String? fullname, String? firstname, String? lastname, String? city, String? province, String? nationalCode, String? nationalId, String? birthday, String? image, int? baseOrder, List<String>? role) $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _UserProfileModel():
|
||||
return $default(_that.accessToken,_that.expiresIn,_that.scope,_that.expireTime,_that.mobile,_that.fullname,_that.firstname,_that.lastname,_that.city,_that.province,_that.nationalCode,_that.nationalId,_that.birthday,_that.image,_that.baseOrder,_that.role);case _:
|
||||
throw StateError('Unexpected subclass');
|
||||
|
||||
}
|
||||
}
|
||||
/// A variant of `when` that fallback to returning `null`
|
||||
///
|
||||
/// It is equivalent to doing:
|
||||
/// ```dart
|
||||
/// switch (sealedClass) {
|
||||
/// case Subclass(:final field):
|
||||
/// return ...;
|
||||
/// case _:
|
||||
/// return null;
|
||||
/// }
|
||||
/// ```
|
||||
|
||||
@optionalTypeArgs TResult? whenOrNull<TResult extends Object?>(TResult? Function( String? accessToken, String? expiresIn, String? scope, String? expireTime, String? mobile, String? fullname, String? firstname, String? lastname, String? city, String? province, String? nationalCode, String? nationalId, String? birthday, String? image, int? baseOrder, List<String>? role)? $default,) {final _that = this;
|
||||
switch (_that) {
|
||||
case _UserProfileModel() when $default != null:
|
||||
return $default(_that.accessToken,_that.expiresIn,_that.scope,_that.expireTime,_that.mobile,_that.fullname,_that.firstname,_that.lastname,_that.city,_that.province,_that.nationalCode,_that.nationalId,_that.birthday,_that.image,_that.baseOrder,_that.role);case _:
|
||||
return null;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
@JsonSerializable()
|
||||
|
||||
class _UserProfileModel implements UserProfileModel {
|
||||
const _UserProfileModel({this.accessToken, this.expiresIn, this.scope, this.expireTime, this.mobile, this.fullname, this.firstname, this.lastname, this.city, this.province, this.nationalCode, this.nationalId, this.birthday, this.image, this.baseOrder, final List<String>? role}): _role = role;
|
||||
factory _UserProfileModel.fromJson(Map<String, dynamic> json) => _$UserProfileModelFromJson(json);
|
||||
|
||||
@override final String? accessToken;
|
||||
@override final String? expiresIn;
|
||||
@override final String? scope;
|
||||
@override final String? expireTime;
|
||||
@override final String? mobile;
|
||||
@override final String? fullname;
|
||||
@override final String? firstname;
|
||||
@override final String? lastname;
|
||||
@override final String? city;
|
||||
@override final String? province;
|
||||
@override final String? nationalCode;
|
||||
@override final String? nationalId;
|
||||
@override final String? birthday;
|
||||
@override final String? image;
|
||||
@override final int? baseOrder;
|
||||
final List<String>? _role;
|
||||
@override List<String>? get role {
|
||||
final value = _role;
|
||||
if (value == null) return null;
|
||||
if (_role is EqualUnmodifiableListView) return _role;
|
||||
// ignore: implicit_dynamic_type
|
||||
return EqualUnmodifiableListView(value);
|
||||
}
|
||||
|
||||
|
||||
/// Create a copy of UserProfileModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@pragma('vm:prefer-inline')
|
||||
_$UserProfileModelCopyWith<_UserProfileModel> get copyWith => __$UserProfileModelCopyWithImpl<_UserProfileModel>(this, _$identity);
|
||||
|
||||
@override
|
||||
Map<String, dynamic> toJson() {
|
||||
return _$UserProfileModelToJson(this, );
|
||||
}
|
||||
|
||||
@override
|
||||
bool operator ==(Object other) {
|
||||
return identical(this, other) || (other.runtimeType == runtimeType&&other is _UserProfileModel&&(identical(other.accessToken, accessToken) || other.accessToken == accessToken)&&(identical(other.expiresIn, expiresIn) || other.expiresIn == expiresIn)&&(identical(other.scope, scope) || other.scope == scope)&&(identical(other.expireTime, expireTime) || other.expireTime == expireTime)&&(identical(other.mobile, mobile) || other.mobile == mobile)&&(identical(other.fullname, fullname) || other.fullname == fullname)&&(identical(other.firstname, firstname) || other.firstname == firstname)&&(identical(other.lastname, lastname) || other.lastname == lastname)&&(identical(other.city, city) || other.city == city)&&(identical(other.province, province) || other.province == province)&&(identical(other.nationalCode, nationalCode) || other.nationalCode == nationalCode)&&(identical(other.nationalId, nationalId) || other.nationalId == nationalId)&&(identical(other.birthday, birthday) || other.birthday == birthday)&&(identical(other.image, image) || other.image == image)&&(identical(other.baseOrder, baseOrder) || other.baseOrder == baseOrder)&&const DeepCollectionEquality().equals(other._role, _role));
|
||||
}
|
||||
|
||||
@JsonKey(includeFromJson: false, includeToJson: false)
|
||||
@override
|
||||
int get hashCode => Object.hash(runtimeType,accessToken,expiresIn,scope,expireTime,mobile,fullname,firstname,lastname,city,province,nationalCode,nationalId,birthday,image,baseOrder,const DeepCollectionEquality().hash(_role));
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'UserProfileModel(accessToken: $accessToken, expiresIn: $expiresIn, scope: $scope, expireTime: $expireTime, mobile: $mobile, fullname: $fullname, firstname: $firstname, lastname: $lastname, city: $city, province: $province, nationalCode: $nationalCode, nationalId: $nationalId, birthday: $birthday, image: $image, baseOrder: $baseOrder, role: $role)';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/// @nodoc
|
||||
abstract mixin class _$UserProfileModelCopyWith<$Res> implements $UserProfileModelCopyWith<$Res> {
|
||||
factory _$UserProfileModelCopyWith(_UserProfileModel value, $Res Function(_UserProfileModel) _then) = __$UserProfileModelCopyWithImpl;
|
||||
@override @useResult
|
||||
$Res call({
|
||||
String? accessToken, String? expiresIn, String? scope, String? expireTime, String? mobile, String? fullname, String? firstname, String? lastname, String? city, String? province, String? nationalCode, String? nationalId, String? birthday, String? image, int? baseOrder, List<String>? role
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
/// @nodoc
|
||||
class __$UserProfileModelCopyWithImpl<$Res>
|
||||
implements _$UserProfileModelCopyWith<$Res> {
|
||||
__$UserProfileModelCopyWithImpl(this._self, this._then);
|
||||
|
||||
final _UserProfileModel _self;
|
||||
final $Res Function(_UserProfileModel) _then;
|
||||
|
||||
/// Create a copy of UserProfileModel
|
||||
/// with the given fields replaced by the non-null parameter values.
|
||||
@override @pragma('vm:prefer-inline') $Res call({Object? accessToken = freezed,Object? expiresIn = freezed,Object? scope = freezed,Object? expireTime = freezed,Object? mobile = freezed,Object? fullname = freezed,Object? firstname = freezed,Object? lastname = freezed,Object? city = freezed,Object? province = freezed,Object? nationalCode = freezed,Object? nationalId = freezed,Object? birthday = freezed,Object? image = freezed,Object? baseOrder = freezed,Object? role = freezed,}) {
|
||||
return _then(_UserProfileModel(
|
||||
accessToken: freezed == accessToken ? _self.accessToken : accessToken // ignore: cast_nullable_to_non_nullable
|
||||
as String?,expiresIn: freezed == expiresIn ? _self.expiresIn : expiresIn // ignore: cast_nullable_to_non_nullable
|
||||
as String?,scope: freezed == scope ? _self.scope : scope // ignore: cast_nullable_to_non_nullable
|
||||
as String?,expireTime: freezed == expireTime ? _self.expireTime : expireTime // ignore: cast_nullable_to_non_nullable
|
||||
as String?,mobile: freezed == mobile ? _self.mobile : mobile // ignore: cast_nullable_to_non_nullable
|
||||
as String?,fullname: freezed == fullname ? _self.fullname : fullname // ignore: cast_nullable_to_non_nullable
|
||||
as String?,firstname: freezed == firstname ? _self.firstname : firstname // ignore: cast_nullable_to_non_nullable
|
||||
as String?,lastname: freezed == lastname ? _self.lastname : lastname // ignore: cast_nullable_to_non_nullable
|
||||
as String?,city: freezed == city ? _self.city : city // ignore: cast_nullable_to_non_nullable
|
||||
as String?,province: freezed == province ? _self.province : province // ignore: cast_nullable_to_non_nullable
|
||||
as String?,nationalCode: freezed == nationalCode ? _self.nationalCode : nationalCode // ignore: cast_nullable_to_non_nullable
|
||||
as String?,nationalId: freezed == nationalId ? _self.nationalId : nationalId // ignore: cast_nullable_to_non_nullable
|
||||
as String?,birthday: freezed == birthday ? _self.birthday : birthday // ignore: cast_nullable_to_non_nullable
|
||||
as String?,image: freezed == image ? _self.image : image // ignore: cast_nullable_to_non_nullable
|
||||
as String?,baseOrder: freezed == baseOrder ? _self.baseOrder : baseOrder // ignore: cast_nullable_to_non_nullable
|
||||
as int?,role: freezed == role ? _self._role : role // ignore: cast_nullable_to_non_nullable
|
||||
as List<String>?,
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// dart format on
|
||||
@@ -0,0 +1,47 @@
|
||||
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||
|
||||
part of 'user_profile_model.dart';
|
||||
|
||||
// **************************************************************************
|
||||
// JsonSerializableGenerator
|
||||
// **************************************************************************
|
||||
|
||||
_UserProfileModel _$UserProfileModelFromJson(Map<String, dynamic> json) =>
|
||||
_UserProfileModel(
|
||||
accessToken: json['access_token'] as String?,
|
||||
expiresIn: json['expires_in'] as String?,
|
||||
scope: json['scope'] as String?,
|
||||
expireTime: json['expire_time'] as String?,
|
||||
mobile: json['mobile'] as String?,
|
||||
fullname: json['fullname'] as String?,
|
||||
firstname: json['firstname'] as String?,
|
||||
lastname: json['lastname'] as String?,
|
||||
city: json['city'] as String?,
|
||||
province: json['province'] as String?,
|
||||
nationalCode: json['national_code'] as String?,
|
||||
nationalId: json['national_id'] as String?,
|
||||
birthday: json['birthday'] as String?,
|
||||
image: json['image'] as String?,
|
||||
baseOrder: (json['base_order'] as num?)?.toInt(),
|
||||
role: (json['role'] as List<dynamic>?)?.map((e) => e as String).toList(),
|
||||
);
|
||||
|
||||
Map<String, dynamic> _$UserProfileModelToJson(_UserProfileModel instance) =>
|
||||
<String, dynamic>{
|
||||
'access_token': instance.accessToken,
|
||||
'expires_in': instance.expiresIn,
|
||||
'scope': instance.scope,
|
||||
'expire_time': instance.expireTime,
|
||||
'mobile': instance.mobile,
|
||||
'fullname': instance.fullname,
|
||||
'firstname': instance.firstname,
|
||||
'lastname': instance.lastname,
|
||||
'city': instance.city,
|
||||
'province': instance.province,
|
||||
'national_code': instance.nationalCode,
|
||||
'national_id': instance.nationalId,
|
||||
'birthday': instance.birthday,
|
||||
'image': instance.image,
|
||||
'base_order': instance.baseOrder,
|
||||
'role': instance.role,
|
||||
};
|
||||
@@ -0,0 +1,15 @@
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/user_info/user_info_model.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/user_profile_model/user_profile_model.dart';
|
||||
|
||||
abstract class AuthRepository {
|
||||
Future<UserProfileModel?> login({required Map<String, dynamic> authRequest});
|
||||
|
||||
Future<void> logout();
|
||||
|
||||
Future<bool> hasAuthenticated();
|
||||
|
||||
Future<UserInfoModel?> getUserInfo(String phoneNumber);
|
||||
|
||||
/// Calls `/steward-app-login/` with Bearer token and required `server` query param.
|
||||
Future<void> stewardAppLogin({required String token, Map<String, dynamic>? queryParameters});
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
import 'package:rasadyar_chicken/features/common/data/datasources/remote/auth/auth_remote.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/user_info/user_info_model.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/user_profile_model/user_profile_model.dart';
|
||||
|
||||
import 'auth_repository.dart';
|
||||
|
||||
class AuthRepositoryImpl implements AuthRepository {
|
||||
final AuthRemoteDataSource authRemote;
|
||||
|
||||
AuthRepositoryImpl(this.authRemote);
|
||||
|
||||
@override
|
||||
Future<UserProfileModel?> login({required Map<String, dynamic> authRequest}) async =>
|
||||
await authRemote.login(authRequest: authRequest);
|
||||
|
||||
@override
|
||||
Future<void> logout() async => await authRemote.logout();
|
||||
|
||||
@override
|
||||
Future<bool> hasAuthenticated() async => await authRemote.hasAuthenticated();
|
||||
|
||||
@override
|
||||
Future<UserInfoModel?> getUserInfo(String phoneNumber) async =>
|
||||
await authRemote.getUserInfo(phoneNumber);
|
||||
|
||||
@override
|
||||
Future<void> stewardAppLogin({
|
||||
required String token,
|
||||
Map<String, dynamic>? queryParameters,
|
||||
}) async {
|
||||
await authRemote.stewardAppLogin(token: token, queryParameters: queryParameters);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
import 'package:rasadyar_chicken/features/common/data/model/local/widely_used_local_model.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/request/change_password/change_password_request_model.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/bar_information/bar_information.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/broadcast_price/broadcast_price.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/guild/guild_model.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/guild_profile/guild_profile.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/inventory/inventory_model.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/iran_province_city/iran_province_city_model.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/kill_house_distribution_info/kill_house_distribution_info.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/roles_products/roles_products.dart';
|
||||
import 'package:rasadyar_chicken/features/steward/data/model/response/segmentation_model/segmentation_model.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/user_profile/user_profile.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
abstract class CommonRepository {
|
||||
//region Remote
|
||||
Future<List<InventoryModel>?> getInventory({
|
||||
required String token,
|
||||
CancelToken? cancelToken,
|
||||
});
|
||||
|
||||
Future<KillHouseDistributionInfo?> getKillHouseDistributionInfo({
|
||||
required String token,
|
||||
});
|
||||
|
||||
Future<BarInformation?> getGeneralBarInformation({
|
||||
required String token,
|
||||
Map<String, dynamic>? queryParameters,
|
||||
});
|
||||
|
||||
Future<List<ProductModel>?> getRolesProducts({required String token});
|
||||
|
||||
Future<List<GuildModel>?> getGuilds({
|
||||
required String token,
|
||||
Map<String, dynamic>? queryParameters,
|
||||
});
|
||||
|
||||
Future<GuildProfile?> getProfile({required String token});
|
||||
|
||||
Future<List<IranProvinceCityModel>?> getProvince({CancelToken? cancelToken});
|
||||
|
||||
Future<List<IranProvinceCityModel>?> getCity({required String provinceName});
|
||||
|
||||
Future<UserProfile?> getUserProfile({required String token});
|
||||
|
||||
Future<void> updateUserProfile({
|
||||
required String token,
|
||||
required UserProfile userProfile,
|
||||
});
|
||||
|
||||
Future<void> updatePassword({
|
||||
required String token,
|
||||
required ChangePasswordRequestModel model,
|
||||
});
|
||||
|
||||
Future<PaginationModel<SegmentationModel>?> getSegmentation({
|
||||
required String token,
|
||||
Map<String, dynamic>? queryParameters,
|
||||
});
|
||||
|
||||
Future<void> createSegmentation({
|
||||
required String token,
|
||||
required SegmentationModel model,
|
||||
});
|
||||
|
||||
Future<void> editSegmentation({
|
||||
required String token,
|
||||
required SegmentationModel model,
|
||||
});
|
||||
|
||||
Future<SegmentationModel?> deleteSegmentation({
|
||||
required String token,
|
||||
required String key,
|
||||
});
|
||||
|
||||
Future<BroadcastPrice?> getBroadcastPrice({required String token});
|
||||
|
||||
//endregion
|
||||
|
||||
//region local
|
||||
Future<void> initWidleyUsed();
|
||||
|
||||
WidelyUsedLocalModel? getAllWidely();
|
||||
//endregion
|
||||
}
|
||||
@@ -0,0 +1,172 @@
|
||||
import 'package:rasadyar_chicken/features/common/data/datasources/local/chicken_local.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/datasources/remote/common/common_remote.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/local/widely_used_local_model.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/request/change_password/change_password_request_model.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/bar_information/bar_information.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/broadcast_price/broadcast_price.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/guild/guild_model.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/guild_profile/guild_profile.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/inventory/inventory_model.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/iran_province_city/iran_province_city_model.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/kill_house_distribution_info/kill_house_distribution_info.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/roles_products/roles_products.dart';
|
||||
import 'package:rasadyar_chicken/features/steward/data/model/response/segmentation_model/segmentation_model.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/user_profile/user_profile.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
import 'common_repository.dart';
|
||||
|
||||
class CommonRepositoryImp implements CommonRepository {
|
||||
final CommonRemoteDatasource remote;
|
||||
final ChickenLocalDataSource local;
|
||||
|
||||
CommonRepositoryImp({required this.remote, required this.local});
|
||||
|
||||
//region Remote
|
||||
@override
|
||||
Future<List<InventoryModel>?> getInventory({
|
||||
required String token,
|
||||
CancelToken? cancelToken,
|
||||
}) async {
|
||||
var res = await remote.getInventory(token: token, cancelToken: cancelToken);
|
||||
return res;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<KillHouseDistributionInfo?> getKillHouseDistributionInfo({
|
||||
required String token,
|
||||
}) async {
|
||||
var res = await remote.getKillHouseDistributionInfo(token: token);
|
||||
return res;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<BarInformation?> getGeneralBarInformation({
|
||||
required String token,
|
||||
Map<String, dynamic>? queryParameters,
|
||||
}) async {
|
||||
var res = await remote.getGeneralBarInformation(
|
||||
token: token,
|
||||
queryParameters: queryParameters,
|
||||
);
|
||||
return res;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<ProductModel>?> getRolesProducts({required String token}) async {
|
||||
var res = await remote.getRolesProducts(token: token);
|
||||
return res;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<GuildModel>?> getGuilds({
|
||||
required String token,
|
||||
Map<String, dynamic>? queryParameters,
|
||||
}) async {
|
||||
var res = await remote.getGuilds(
|
||||
token: token,
|
||||
queryParameters: queryParameters,
|
||||
);
|
||||
return res;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<GuildProfile?> getProfile({required String token}) async {
|
||||
var res = await remote.getProfile(token: token);
|
||||
return res;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<IranProvinceCityModel>?> getCity({
|
||||
required String provinceName,
|
||||
}) async {
|
||||
var res = await remote.getCity(provinceName: provinceName);
|
||||
return res;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<List<IranProvinceCityModel>?> getProvince({
|
||||
CancelToken? cancelToken,
|
||||
}) async {
|
||||
var res = await remote.getProvince(cancelToken: cancelToken);
|
||||
return res;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<UserProfile?> getUserProfile({required String token}) async {
|
||||
var res = await remote.getUserProfile(token: token);
|
||||
return res;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> updateUserProfile({
|
||||
required String token,
|
||||
required UserProfile userProfile,
|
||||
}) async {
|
||||
await remote.updateUserProfile(token: token, userProfile: userProfile);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> updatePassword({
|
||||
required String token,
|
||||
required ChangePasswordRequestModel model,
|
||||
}) async {
|
||||
await remote.updatePassword(token: token, model: model);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<PaginationModel<SegmentationModel>?> getSegmentation({
|
||||
required String token,
|
||||
Map<String, dynamic>? queryParameters,
|
||||
}) async {
|
||||
var res = await remote.getSegmentation(
|
||||
token: token,
|
||||
queryParameters: queryParameters,
|
||||
);
|
||||
return res;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> createSegmentation({
|
||||
required String token,
|
||||
required SegmentationModel model,
|
||||
}) async {
|
||||
await remote.createSegmentation(token: token, model: model);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> editSegmentation({
|
||||
required String token,
|
||||
required SegmentationModel model,
|
||||
}) async {
|
||||
await remote.editSegmentation(token: token, model: model);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<SegmentationModel?> deleteSegmentation({
|
||||
required String token,
|
||||
required String key,
|
||||
}) async {
|
||||
var res = await remote.deleteSegmentation(token: token, key: key);
|
||||
return res;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<BroadcastPrice?> getBroadcastPrice({required String token}) async {
|
||||
var res = await remote.getBroadcastPrice(token: token);
|
||||
return res;
|
||||
}
|
||||
|
||||
//endregion
|
||||
|
||||
//region local
|
||||
@override
|
||||
WidelyUsedLocalModel? getAllWidely() => local.getAllWidely();
|
||||
|
||||
@override
|
||||
Future<void> initWidleyUsed() async {
|
||||
await local.initWidleyUsed();
|
||||
}
|
||||
|
||||
//endregion
|
||||
}
|
||||
@@ -0,0 +1,244 @@
|
||||
import 'dart:async';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_chicken/data/common/dio_error_handler.dart';
|
||||
import 'package:rasadyar_chicken/data/di/chicken_di.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/user_info/user_info_model.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/user_profile_model/user_profile_model.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/repositories/auth/auth_repository.dart';
|
||||
import 'package:rasadyar_chicken/features/common/presentation/routes/routes.dart';
|
||||
import 'package:rasadyar_chicken/features/steward/presentation/routes/routes.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/captcha/logic.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
enum AuthType { useAndPass, otp }
|
||||
|
||||
enum AuthStatus { init }
|
||||
|
||||
enum OtpStatus { init, sent, verified, reSend }
|
||||
|
||||
class AuthLogic extends GetxController with GetTickerProviderStateMixin {
|
||||
GlobalKey<FormState> formKey = GlobalKey<FormState>();
|
||||
late AnimationController _textAnimationController;
|
||||
late Animation<double> textAnimation;
|
||||
RxBool showCard = false.obs;
|
||||
RxBool rememberMe = false.obs;
|
||||
|
||||
Rx<GlobalKey<FormState>> formKeyOtp = GlobalKey<FormState>().obs;
|
||||
Rx<GlobalKey<FormState>> formKeySentOtp = GlobalKey<FormState>().obs;
|
||||
Rx<TextEditingController> usernameController = TextEditingController().obs;
|
||||
Rx<TextEditingController> passwordController = TextEditingController().obs;
|
||||
Rx<TextEditingController> phoneOtpNumberController =
|
||||
TextEditingController().obs;
|
||||
Rx<TextEditingController> otpCodeController = TextEditingController().obs;
|
||||
|
||||
var captchaController = Get.find<CaptchaWidgetLogic>();
|
||||
|
||||
RxnString phoneNumber = RxnString(null);
|
||||
RxBool isLoading = false.obs;
|
||||
RxBool isDisabled = true.obs;
|
||||
|
||||
GService gService = Get.find<GService>();
|
||||
TokenStorageService tokenStorageService = Get.find<TokenStorageService>();
|
||||
|
||||
Rx<AuthType> authType = AuthType.useAndPass.obs;
|
||||
Rx<AuthStatus> authStatus = AuthStatus.init.obs;
|
||||
Rx<OtpStatus> otpStatus = OtpStatus.init.obs;
|
||||
RxnString deviceName = RxnString(null);
|
||||
|
||||
RxInt secondsRemaining = 120.obs;
|
||||
Timer? _timer;
|
||||
|
||||
AuthRepository authRepository = diChicken.get<AuthRepository>();
|
||||
|
||||
final Module _module = Get.arguments;
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
_textAnimationController =
|
||||
AnimationController(
|
||||
vsync: this,
|
||||
duration: const Duration(milliseconds: 1200),
|
||||
)
|
||||
..repeat(reverse: true, count: 2).whenComplete(() {
|
||||
showCard.value = true;
|
||||
});
|
||||
|
||||
textAnimation = CurvedAnimation(
|
||||
parent: _textAnimationController,
|
||||
curve: Curves.easeInOut,
|
||||
);
|
||||
|
||||
initUserPassData();
|
||||
getDeviceModel();
|
||||
}
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
_textAnimationController.dispose();
|
||||
_timer?.cancel();
|
||||
super.onClose();
|
||||
}
|
||||
|
||||
void startTimer() {
|
||||
_timer?.cancel();
|
||||
secondsRemaining.value = 120;
|
||||
|
||||
_timer = Timer.periodic(const Duration(seconds: 1), (timer) {
|
||||
if (secondsRemaining.value > 0) {
|
||||
secondsRemaining.value--;
|
||||
} else {
|
||||
timer.cancel();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
void stopTimer() {
|
||||
_timer?.cancel();
|
||||
}
|
||||
|
||||
String get timeFormatted {
|
||||
final minutes = secondsRemaining.value ~/ 60;
|
||||
final seconds = secondsRemaining.value % 60;
|
||||
return '${minutes.toString().padLeft(2, '0')}:${seconds.toString().padLeft(2, '0')}';
|
||||
}
|
||||
|
||||
bool _isFormValid() {
|
||||
final isCaptchaValid =
|
||||
captchaController.formKey.currentState?.validate() ?? false;
|
||||
final isFormValid = formKey.currentState?.validate() ?? false;
|
||||
return isCaptchaValid && isFormValid;
|
||||
}
|
||||
|
||||
Future<void> submitLoginForm() async {
|
||||
if (!_isFormValid()) return;
|
||||
AuthRepository authTmp = diChicken.get<AuthRepository>();
|
||||
isLoading.value = true;
|
||||
await safeCall<UserProfileModel?>(
|
||||
call: () => authTmp.login(
|
||||
authRequest: {
|
||||
"username": usernameController.value.text,
|
||||
"password": passwordController.value.text,
|
||||
},
|
||||
),
|
||||
onSuccess: (result) async {
|
||||
await gService.saveSelectedModule(_module);
|
||||
await tokenStorageService.saveModule(_module);
|
||||
await tokenStorageService.saveAccessToken(
|
||||
_module,
|
||||
result?.accessToken ?? '',
|
||||
);
|
||||
await tokenStorageService.saveRefreshToken(
|
||||
_module,
|
||||
result?.accessToken ?? '',
|
||||
);
|
||||
var tmpRoles = result?.role?.where((element) {
|
||||
final allowedRoles = {
|
||||
'poultryscience',
|
||||
'steward',
|
||||
'killhouse',
|
||||
'provinceinspector',
|
||||
'cityjahad',
|
||||
'jahad',
|
||||
'vetfarm',
|
||||
'provincesupervisor',
|
||||
'superadmin',
|
||||
};
|
||||
|
||||
final lowerElement = element.toString().toLowerCase().trim();
|
||||
return allowedRoles.contains(lowerElement);
|
||||
}).toList();
|
||||
if (tmpRoles?.length==1) {
|
||||
await tokenStorageService.saveRoles(_module, tmpRoles ?? []);
|
||||
}
|
||||
|
||||
await tokenStorageService.saveRoles(_module, tmpRoles ?? []);
|
||||
if (rememberMe.value) {
|
||||
await tokenStorageService.saveUserPass(
|
||||
_module,
|
||||
usernameController.value.text,
|
||||
passwordController.value.text,
|
||||
);
|
||||
}
|
||||
|
||||
authTmp.stewardAppLogin(
|
||||
token: result?.accessToken ?? '',
|
||||
queryParameters: {
|
||||
"mobile": usernameController.value.text,
|
||||
"device_name": deviceName.value,
|
||||
},
|
||||
);
|
||||
|
||||
|
||||
Get.offAndToNamed(CommonRoutes.role);
|
||||
|
||||
|
||||
/* if (tmpRoles!.length > 1) {
|
||||
Get.offAndToNamed(CommonRoutes.role);
|
||||
} else {
|
||||
Get.offAllNamed(StewardRoutes.initSteward);
|
||||
} */
|
||||
},
|
||||
onError: (error, stackTrace) {
|
||||
if (error is DioException) {
|
||||
diChicken.get<DioErrorHandler>().handle(error);
|
||||
if ((error.type == DioExceptionType.unknown) ||
|
||||
(error.type == DioExceptionType.connectionError)) {
|
||||
getUserInfo(usernameController.value.text);
|
||||
}
|
||||
}
|
||||
captchaController.getCaptcha();
|
||||
},
|
||||
);
|
||||
isLoading.value = false;
|
||||
}
|
||||
|
||||
Future<void> getUserInfo(String value) async {
|
||||
isLoading.value = true;
|
||||
await safeCall<UserInfoModel?>(
|
||||
call: () async => await authRepository.getUserInfo(value),
|
||||
onSuccess: (result) async {
|
||||
if (result != null) {
|
||||
await newSetupAuthDI(result.backend ?? '');
|
||||
await diChicken.allReady();
|
||||
}
|
||||
},
|
||||
onError: (error, stackTrace) {
|
||||
if (error is DioException) {
|
||||
diChicken.get<DioErrorHandler>().handle(error);
|
||||
}
|
||||
captchaController.getCaptcha();
|
||||
},
|
||||
);
|
||||
isLoading.value = false;
|
||||
}
|
||||
|
||||
void initUserPassData() {
|
||||
UserLocalModel? userLocalModel = tokenStorageService.getUserLocal(
|
||||
Module.chicken,
|
||||
);
|
||||
if (userLocalModel?.username != null && userLocalModel?.password != null) {
|
||||
usernameController.value.text = userLocalModel?.username ?? '';
|
||||
passwordController.value.text = userLocalModel?.password ?? '';
|
||||
rememberMe.value = true;
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> getDeviceModel() async {
|
||||
final deviceInfo = DeviceInfoPlugin();
|
||||
|
||||
if (Platform.isAndroid) {
|
||||
final info = await deviceInfo.androidInfo;
|
||||
|
||||
deviceName.value =
|
||||
'Device:${info.manufacturer} Model:${info.model} version ${info.version.release}';
|
||||
} else if (Platform.isIOS) {
|
||||
final info = await deviceInfo.iosInfo;
|
||||
|
||||
deviceName.value =
|
||||
'Device:${info.utsname.machine} Model:${info.model} version ${info.systemVersion}';
|
||||
} else {}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,394 @@
|
||||
import 'package:flutter/gestures.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/captcha/view.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
import 'logic.dart';
|
||||
|
||||
class AuthPage extends GetView<AuthLogic> {
|
||||
const AuthPage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ChickenBasePage(
|
||||
isFullScreen: true,
|
||||
backGroundWidget: backGroundDecoration(
|
||||
gradient: LinearGradient(
|
||||
begin: Alignment.topRight,
|
||||
end: Alignment.bottomLeft,
|
||||
colors: [
|
||||
const Color(0xFFB2C9FF).withValues(alpha: 1.0), // 0%
|
||||
const Color(0xFF40BB93).withValues(alpha: 0.11), // 50%
|
||||
const Color(0xFF93B6D3).withValues(alpha: 1.0), // 100%
|
||||
],
|
||||
stops: const [0.0, 0.5, 1.0],
|
||||
),
|
||||
backgroundPath: Assets.images.patternChicken.path,
|
||||
),
|
||||
onPopScopTaped: () => Get.back(result: -1),
|
||||
child: Stack(
|
||||
children: [
|
||||
Center(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 10.r),
|
||||
child: FadeTransition(
|
||||
opacity: controller.textAnimation,
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
spacing: 12,
|
||||
children: [
|
||||
Text(
|
||||
'به سامانه رصدطیور خوش آمدید!',
|
||||
textAlign: TextAlign.right,
|
||||
style: AppFonts.yekan25Bold.copyWith(
|
||||
color: AppColor.darkGreyDarkActive,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'سامانه رصد و پایش زنجیره تامین، تولید و توزیع کالا های اساسی',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan16.copyWith(
|
||||
color: AppColor.darkGreyDarkActive,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
Obx(() {
|
||||
final screenHeight = MediaQuery.of(context).size.height;
|
||||
final targetTop = (screenHeight - 676) / 2;
|
||||
|
||||
return AnimatedPositioned(
|
||||
duration: const Duration(milliseconds: 1200),
|
||||
curve: Curves.linear,
|
||||
top: controller.showCard.value ? targetTop : screenHeight,
|
||||
left: 10.r,
|
||||
right: 10.r,
|
||||
child: Container(
|
||||
width: 381.w,
|
||||
height: 676.h,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(40),
|
||||
),
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(height: 50.h),
|
||||
LogoWidget(
|
||||
vecPath: Assets.vec.rasadToyorSvg.path,
|
||||
width: 85.w,
|
||||
height: 85.h,
|
||||
titleStyle: AppFonts.yekan20Bold.copyWith(
|
||||
color: Color(0xFF4665AF),
|
||||
),
|
||||
title: 'رصدطیور',
|
||||
),
|
||||
SizedBox(height: 20.h),
|
||||
useAndPassFrom(),
|
||||
SizedBox(height: 24.h),
|
||||
RichText(
|
||||
text: TextSpan(
|
||||
children: [
|
||||
TextSpan(
|
||||
text: 'مطالعه بیانیه ',
|
||||
style: AppFonts.yekan16.copyWith(
|
||||
color: AppColor.darkGreyDark,
|
||||
),
|
||||
),
|
||||
TextSpan(
|
||||
recognizer: TapGestureRecognizer()
|
||||
..onTap = () {
|
||||
Get.bottomSheet(
|
||||
privacyPolicyWidget(),
|
||||
isScrollControlled: true,
|
||||
enableDrag: true,
|
||||
ignoreSafeArea: false,
|
||||
);
|
||||
},
|
||||
text: 'حریم خصوصی',
|
||||
style: AppFonts.yekan16.copyWith(
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget useAndPassFrom() {
|
||||
return Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 30.r),
|
||||
child: Form(
|
||||
key: controller.formKey,
|
||||
child: AutofillGroup(
|
||||
child: Column(
|
||||
children: [
|
||||
RTextField(
|
||||
height: 40.h,
|
||||
label: 'نام کاربری',
|
||||
maxLength: 11,
|
||||
maxLines: 1,
|
||||
controller: controller.usernameController.value,
|
||||
keyboardType: TextInputType.number,
|
||||
inputFormatters: [PersianFormatter()],
|
||||
initText: controller.usernameController.value.text,
|
||||
autofillHints: [AutofillHints.username],
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
borderSide: BorderSide(color: AppColor.textColor, width: 1),
|
||||
),
|
||||
onChanged: (value) async {
|
||||
controller.usernameController.value.text = value;
|
||||
if (value.length == 11) {
|
||||
await controller.getUserInfo(value);
|
||||
}
|
||||
},
|
||||
prefixIcon: Padding(
|
||||
padding: const EdgeInsets.fromLTRB(0, 8, 6, 8),
|
||||
child: Assets.vec.callSvg.svg(width: 12, height: 12),
|
||||
),
|
||||
suffixIcon:
|
||||
controller.usernameController.value.text.trim().isNotEmpty
|
||||
? clearButton(() {
|
||||
controller.usernameController.value.clear();
|
||||
controller.usernameController.refresh();
|
||||
})
|
||||
: null,
|
||||
validator: (value) {
|
||||
if (value == null || value.isEmpty) {
|
||||
return '⚠️ شماره موبایل را وارد کنید';
|
||||
} else if (value.length < 10) {
|
||||
return '⚠️ شماره موبایل باید 11 رقم باشد';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
style: AppFonts.yekan13,
|
||||
errorStyle: AppFonts.yekan13.copyWith(
|
||||
color: AppColor.redNormal,
|
||||
),
|
||||
labelStyle: AppFonts.yekan13,
|
||||
boxConstraints: const BoxConstraints(
|
||||
maxHeight: 40,
|
||||
minHeight: 40,
|
||||
maxWidth: 40,
|
||||
minWidth: 40,
|
||||
),
|
||||
),
|
||||
const SizedBox(height: 26),
|
||||
ObxValue(
|
||||
(passwordController) => RTextField(
|
||||
height: 40.h,
|
||||
label: 'رمز عبور',
|
||||
filled: false,
|
||||
obscure: true,
|
||||
focusedBorder: OutlineInputBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
borderSide: BorderSide(color: AppColor.textColor, width: 1),
|
||||
),
|
||||
controller: passwordController.value,
|
||||
autofillHints: [AutofillHints.password],
|
||||
variant: RTextFieldVariant.password,
|
||||
initText: passwordController.value.text,
|
||||
inputFormatters: [PersianFormatter()],
|
||||
onChanged: (value) {
|
||||
passwordController.refresh();
|
||||
},
|
||||
validator: (value) {
|
||||
if (value == null || value.isEmpty) {
|
||||
return '⚠️ رمز عبور را وارد کنید';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
style: AppFonts.yekan13,
|
||||
errorStyle: AppFonts.yekan13.copyWith(
|
||||
color: AppColor.redNormal,
|
||||
),
|
||||
labelStyle: AppFonts.yekan13,
|
||||
prefixIcon: Padding(
|
||||
padding: const EdgeInsets.fromLTRB(0, 8, 8, 8),
|
||||
child: Assets.vec.keySvg.svg(width: 12, height: 12),
|
||||
),
|
||||
boxConstraints: const BoxConstraints(
|
||||
maxHeight: 34,
|
||||
minHeight: 34,
|
||||
maxWidth: 34,
|
||||
minWidth: 34,
|
||||
),
|
||||
),
|
||||
controller.passwordController,
|
||||
),
|
||||
SizedBox(height: 26),
|
||||
CaptchaWidget(),
|
||||
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
controller.rememberMe.value = !controller.rememberMe.value;
|
||||
},
|
||||
child: Row(
|
||||
children: [
|
||||
ObxValue((data) {
|
||||
return Checkbox(
|
||||
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||
visualDensity: VisualDensity(
|
||||
horizontal: -4,
|
||||
vertical: 4,
|
||||
),
|
||||
tristate: true,
|
||||
value: data.value,
|
||||
onChanged: (value) {
|
||||
data.value = value ?? false;
|
||||
},
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(4),
|
||||
),
|
||||
activeColor: AppColor.blueNormal,
|
||||
);
|
||||
}, controller.rememberMe),
|
||||
Text(
|
||||
'مرا به خاطر بسپار',
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDark,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
Obx(() {
|
||||
return RElevated(
|
||||
text: 'ورود',
|
||||
isLoading: controller.isLoading.value,
|
||||
onPressed: controller.isDisabled.value
|
||||
? null
|
||||
: () async {
|
||||
await controller.submitLoginForm();
|
||||
},
|
||||
width: Get.width,
|
||||
height: 48,
|
||||
);
|
||||
}),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget privacyPolicyWidget() {
|
||||
return BaseBottomSheet(
|
||||
child: Column(
|
||||
spacing: 5,
|
||||
children: [
|
||||
Container(
|
||||
padding: EdgeInsets.all(8.w),
|
||||
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(color: AppColor.darkGreyLight, width: 1),
|
||||
),
|
||||
child: Column(
|
||||
spacing: 3,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'بيانيه حريم خصوصی',
|
||||
style: AppFonts.yekan16Bold.copyWith(
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'اطلاعات مربوط به هر شخص، حریم خصوصی وی محسوب میشود. حفاظت و حراست از اطلاعات شخصی در سامانه رصد یار، نه تنها موجب حفظ امنیت کاربران میشود، بلکه باعث اعتماد بیشتر و مشارکت آنها در فعالیتهای جاری میگردد. هدف از این بیانیه، آگاه ساختن شما درباره ی نوع و نحوه ی استفاده از اطلاعاتی است که در هنگام استفاده از سامانه رصد یار ، از جانب شما دریافت میگردد. شرکت هوشمند سازان خود را ملزم به رعایت حریم خصوصی همه شهروندان و کاربران سامانه دانسته و آن دسته از اطلاعات کاربران را که فقط به منظور ارائه خدمات کفایت میکند، دریافت کرده و از انتشار آن یا در اختیار قرار دادن آن به دیگران خودداری مینماید.',
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.bgDark,
|
||||
height: 1.8,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
padding: EdgeInsets.all(8.w),
|
||||
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(color: AppColor.darkGreyLight, width: 1),
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
spacing: 4,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'چگونگی جمع آوری و استفاده از اطلاعات کاربران',
|
||||
style: AppFonts.yekan16Bold.copyWith(
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'''الف: اطلاعاتی که شما خود در اختيار این سامانه قرار میدهيد، شامل موارد زيرهستند:
|
||||
اقلام اطلاعاتی شامل شماره تلفن همراه، تاریخ تولد، کد پستی و کد ملی کاربران را دریافت مینماییم که از این اقلام، صرفا جهت احراز هویت کاربران استفاده خواهد شد.
|
||||
ب: برخی اطلاعات ديگر که به صورت خودکار از شما دريافت میشود شامل موارد زير میباشد:
|
||||
⦁ دستگاهی که از طریق آن سامانه رصد یار را مشاهده مینمایید( تلفن همراه، تبلت، رایانه).
|
||||
⦁ نام و نسخه سیستم عامل و browser کامپیوتر شما.
|
||||
⦁ اطلاعات صفحات بازدید شده.
|
||||
⦁ تعداد بازدیدهای روزانه در درگاه.
|
||||
⦁ هدف ما از دریافت این اطلاعات استفاده از آنها در تحلیل عملکرد کاربران درگاه می باشد تا بتوانیم در خدمت رسانی بهتر عمل کنیم.
|
||||
''',
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.bgDark,
|
||||
height: 1.8,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
padding: EdgeInsets.all(8.w),
|
||||
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(color: AppColor.darkGreyLight, width: 1),
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
spacing: 4,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
'امنیت اطلاعات',
|
||||
style: AppFonts.yekan16Bold.copyWith(
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'متعهدیم که امنیت اطلاعات شما را تضمین نماییم و برای جلوگیری از هر نوع دسترسی غیرمجاز و افشای اطلاعات شما از همه شیوههای لازم استفاده میکنیم تا امنیت اطلاعاتی را که به صورت آنلاین گردآوری میکنیم، حفظ شود. لازم به ذکر است در سامانه ما، ممکن است به سایت های دیگری لینک شوید، وقتی که شما از طریق این لینکها از سامانه ما خارج میشوید، توجه داشته باشید که ما بر دیگر سایت ها کنترل نداریم و سازمان تعهدی بر حفظ حریم شخصی آنان در سایت مقصد نخواهد داشت و مراجعه کنندگان میبایست به بیانیه حریم شخصی آن سایت ها مراجعه نمایند.',
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.bgDark,
|
||||
height: 1.8,
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,257 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_chicken/data/di/chicken_di.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/request/change_password/change_password_request_model.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/iran_province_city/iran_province_city_model.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/user_profile/user_profile.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/repositories/common/common_repository.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
class ProfileLogic extends GetxController {
|
||||
CommonRepository commonRepository = diChicken.get<CommonRepository>();
|
||||
GService gService = Get.find<GService>();
|
||||
TokenStorageService tokenService = Get.find<TokenStorageService>();
|
||||
RxInt selectedInformationType = 0.obs;
|
||||
Rxn<Jalali> birthDate = Rxn<Jalali>();
|
||||
|
||||
Rx<Resource<UserProfile>> userProfile = Rx<Resource<UserProfile>>(
|
||||
Resource.loading(),
|
||||
);
|
||||
Rx<Resource<UserLocalModel>> userLocal = Rx<Resource<UserLocalModel>>(
|
||||
Resource.loading(),
|
||||
);
|
||||
|
||||
TextEditingController nameController = TextEditingController();
|
||||
TextEditingController lastNameController = TextEditingController();
|
||||
TextEditingController nationalCodeController = TextEditingController();
|
||||
TextEditingController nationalIdController = TextEditingController();
|
||||
TextEditingController birthdayController = TextEditingController();
|
||||
|
||||
TextEditingController oldPasswordController = TextEditingController();
|
||||
TextEditingController newPasswordController = TextEditingController();
|
||||
TextEditingController retryNewPasswordController = TextEditingController();
|
||||
|
||||
RxList<IranProvinceCityModel> cites = <IranProvinceCityModel>[].obs;
|
||||
Rxn<IranProvinceCityModel> selectedProvince = Rxn();
|
||||
Rxn<IranProvinceCityModel> selectedCity = Rxn();
|
||||
|
||||
GlobalKey<FormState> formKey = GlobalKey();
|
||||
ImagePicker imagePicker = ImagePicker();
|
||||
Rxn<XFile> selectedImage = Rxn<XFile>();
|
||||
final RxnString _base64Image = RxnString();
|
||||
RxBool isOnLoading = false.obs;
|
||||
|
||||
RxBool isUserInformationOpen = true.obs;
|
||||
RxBool isUnitInformationOpen = false.obs;
|
||||
|
||||
ScrollController scrollController = ScrollController();
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
ever(selectedImage, (data) async {
|
||||
if (data?.path != null) {
|
||||
_base64Image.value = await convertImageToBase64(data!.path);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
super.onReady();
|
||||
getUserProfile();
|
||||
getUserRole();
|
||||
selectedProvince.listen((p0) => getCites());
|
||||
userProfile.listen((data) {
|
||||
nameController.text = data.data?.firstName ?? '';
|
||||
lastNameController.text = data.data?.lastName ?? '';
|
||||
nationalCodeController.text = data.data?.nationalCode ?? '';
|
||||
nationalIdController.text = data.data?.nationalId ?? '';
|
||||
birthdayController.text =
|
||||
data.data?.birthday?.toJalali.formatCompactDate() ?? '';
|
||||
birthDate.value = data.data?.birthday?.toJalali;
|
||||
selectedProvince.value = IranProvinceCityModel(
|
||||
name: data.data?.province ?? '',
|
||||
id: data.data?.provinceNumber ?? 0,
|
||||
);
|
||||
|
||||
selectedCity.value = IranProvinceCityModel(
|
||||
name: data.data?.city ?? '',
|
||||
id: data.data?.cityNumber ?? 0,
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> getUserProfile() async {
|
||||
userProfile.value = Resource.loading();
|
||||
await safeCall<UserProfile?>(
|
||||
call: () async => await commonRepository.getUserProfile(
|
||||
token: tokenService.accessToken.value!,
|
||||
),
|
||||
onSuccess: (result) {
|
||||
if (result != null) {
|
||||
userProfile.value = Resource.success(result);
|
||||
}
|
||||
},
|
||||
onError: (error, stackTrace) {},
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> getCites() async {
|
||||
await safeCall(
|
||||
call: () => commonRepository.getCity(
|
||||
provinceName: selectedProvince.value?.name ?? '',
|
||||
),
|
||||
onSuccess: (result) {
|
||||
if (result != null && result.isNotEmpty) {
|
||||
cites.value = result;
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> updateUserProfile() async {
|
||||
UserProfile userProfile = UserProfile(
|
||||
firstName: nameController.text,
|
||||
lastName: lastNameController.text,
|
||||
nationalCode: nationalCodeController.text,
|
||||
nationalId: nationalIdController.text,
|
||||
birthday: birthDate.value
|
||||
?.toDateTime()
|
||||
.formattedDashedGregorian
|
||||
.toString(),
|
||||
image: _base64Image.value,
|
||||
personType: 'self',
|
||||
type: 'self_profile',
|
||||
);
|
||||
isOnLoading.value = true;
|
||||
await safeCall(
|
||||
call: () async => await commonRepository.updateUserProfile(
|
||||
token: tokenService.accessToken.value!,
|
||||
userProfile: userProfile,
|
||||
),
|
||||
onSuccess: (result) {
|
||||
isOnLoading.value = false;
|
||||
},
|
||||
onError: (error, stackTrace) {
|
||||
isOnLoading.value = false;
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> updatePassword() async {
|
||||
if (formKey.currentState?.validate() ?? false) {
|
||||
ChangePasswordRequestModel model = ChangePasswordRequestModel(
|
||||
username: userProfile.value.data?.mobile,
|
||||
password: newPasswordController.text,
|
||||
);
|
||||
|
||||
await safeCall(
|
||||
call: () async => await commonRepository.updatePassword(
|
||||
token: tokenService.accessToken.value!,
|
||||
model: model,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Future<void> getUserRole() async {
|
||||
userLocal.value = Resource.loading();
|
||||
await safeCall<UserLocalModel?>(
|
||||
call: () async => tokenService.getUserLocal(Module.chicken),
|
||||
onSuccess: (result) {
|
||||
if (result != null) {
|
||||
userLocal.value = Resource.success(result);
|
||||
}
|
||||
},
|
||||
onError: (error, stackTrace) {},
|
||||
);
|
||||
}
|
||||
|
||||
void clearPasswordForm() {
|
||||
oldPasswordController.clear();
|
||||
newPasswordController.clear();
|
||||
retryNewPasswordController.clear();
|
||||
}
|
||||
|
||||
Future<void> changeUserRole(String newRole) async {
|
||||
dLog(newRole);
|
||||
await gService.saveRoute(Module.chicken, newRole);
|
||||
|
||||
Get.offAllNamed(newRole);
|
||||
}
|
||||
|
||||
void scrollToSelectedItem(
|
||||
int index, {
|
||||
double chipWidth = 100,
|
||||
double spacing = 8,
|
||||
GlobalKey? itemKey,
|
||||
}) {
|
||||
if (!scrollController.hasClients) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
_performScroll(index, chipWidth, spacing, itemKey);
|
||||
});
|
||||
} else {
|
||||
_performScroll(index, chipWidth, spacing, itemKey);
|
||||
}
|
||||
}
|
||||
|
||||
void _performScroll(
|
||||
int index,
|
||||
double chipWidth,
|
||||
double spacing,
|
||||
GlobalKey? itemKey,
|
||||
) {
|
||||
if (!scrollController.hasClients) return;
|
||||
|
||||
double targetOffset;
|
||||
|
||||
// If we have a GlobalKey, use it for precise positioning
|
||||
if (itemKey?.currentContext != null) {
|
||||
final RenderBox? renderBox =
|
||||
itemKey!.currentContext?.findRenderObject() as RenderBox?;
|
||||
if (renderBox != null) {
|
||||
final position = renderBox.localToGlobal(Offset.zero);
|
||||
final scrollPosition = scrollController.position;
|
||||
final viewportWidth = scrollPosition.viewportDimension;
|
||||
final chipWidth = renderBox.size.width;
|
||||
|
||||
// Get the scroll position of the item
|
||||
final itemScrollPosition = position.dx - scrollPosition.pixels;
|
||||
// Center the item
|
||||
targetOffset =
|
||||
scrollPosition.pixels +
|
||||
itemScrollPosition -
|
||||
(viewportWidth / 2) +
|
||||
(chipWidth / 2);
|
||||
} else {
|
||||
// Fallback to estimated position
|
||||
targetOffset = _calculateEstimatedPosition(index, chipWidth, spacing);
|
||||
}
|
||||
} else {
|
||||
// Use estimated position
|
||||
targetOffset = _calculateEstimatedPosition(index, chipWidth, spacing);
|
||||
}
|
||||
|
||||
scrollController.animateTo(
|
||||
targetOffset.clamp(0.0, scrollController.position.maxScrollExtent),
|
||||
duration: const Duration(milliseconds: 300),
|
||||
curve: Curves.easeInOut,
|
||||
);
|
||||
}
|
||||
|
||||
double _calculateEstimatedPosition(
|
||||
int index,
|
||||
double chipWidth,
|
||||
double spacing,
|
||||
) {
|
||||
final double itemPosition = (chipWidth + spacing) * index;
|
||||
final double viewportWidth = scrollController.position.viewportDimension;
|
||||
return itemPosition - (viewportWidth / 2) + (chipWidth / 2);
|
||||
}
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
scrollController.dispose();
|
||||
super.onClose();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,902 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/cupertino.dart' hide Image;
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_chicken/data/common/fa_user_role.dart';
|
||||
import 'package:rasadyar_chicken/data/di/chicken_di.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/user_profile/user_profile.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
import 'logic.dart';
|
||||
|
||||
class ProfilePage extends GetView<ProfileLogic> {
|
||||
const ProfilePage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Column(
|
||||
spacing: 30,
|
||||
children: [
|
||||
Expanded(
|
||||
child: Container(
|
||||
color: AppColor.blueNormal,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Row(),
|
||||
ObxValue((data) {
|
||||
final status = data.value.status;
|
||||
|
||||
if (status == ResourceStatus.loading) {
|
||||
return Container(
|
||||
width: 128.w,
|
||||
height: 128.h,
|
||||
child: Center(child: CupertinoActivityIndicator(color: AppColor.greenNormal)),
|
||||
);
|
||||
}
|
||||
|
||||
if (status == ResourceStatus.error) {
|
||||
return Container(
|
||||
width: 128.w,
|
||||
height: 128.h,
|
||||
child: Center(child: Text('خطا در دریافت اطلاعات')),
|
||||
);
|
||||
}
|
||||
|
||||
// Default UI
|
||||
|
||||
return Container(
|
||||
width: 128.w,
|
||||
height: 128.h,
|
||||
decoration: BoxDecoration(
|
||||
shape: BoxShape.circle,
|
||||
color: AppColor.blueLightActive,
|
||||
),
|
||||
child: Center(
|
||||
child: data.value.data?.image != null
|
||||
? CircleAvatar(
|
||||
radius: 64.w,
|
||||
backgroundImage: NetworkImage(data.value.data!.image!),
|
||||
)
|
||||
: Icon(Icons.person, size: 64.w),
|
||||
),
|
||||
);
|
||||
}, controller.userProfile),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 3,
|
||||
child: SingleChildScrollView(
|
||||
physics: BouncingScrollPhysics(),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
rolesWidget(),
|
||||
SizedBox(height: 12.h),
|
||||
|
||||
ObxValue((data) {
|
||||
if (data.value.status == ResourceStatus.loading) {
|
||||
return LoadingWidget();
|
||||
} else if (data.value.status == ResourceStatus.error) {
|
||||
return ErrorWidget('خطا در دریافت اطلاعات کاربر');
|
||||
} else if (data.value.status == ResourceStatus.success) {
|
||||
return Column(
|
||||
spacing: 6,
|
||||
children: [
|
||||
ObxValue((isOpen) {
|
||||
return GestureDetector(
|
||||
onTap: () => isOpen.toggle(),
|
||||
child: AnimatedContainer(
|
||||
height: isOpen.value ? 320.h : 47.h,
|
||||
duration: Duration(milliseconds: 500),
|
||||
curve: Curves.linear,
|
||||
child: userProfileInformation(data.value),
|
||||
),
|
||||
);
|
||||
}, controller.isUserInformationOpen),
|
||||
|
||||
Visibility(
|
||||
visible:
|
||||
data.value.data?.unitName != null ||
|
||||
data.value.data?.unitAddress != null ||
|
||||
data.value.data?.unitPostalCode != null ||
|
||||
data.value.data?.unitRegistrationNumber != null ||
|
||||
data.value.data?.unitEconomicalNumber != null ||
|
||||
data.value.data?.unitCity != null ||
|
||||
data.value.data?.unitProvince != null ||
|
||||
data.value.data?.unitNationalId != null,
|
||||
|
||||
child: ObxValue((isOpen) {
|
||||
return GestureDetector(
|
||||
onTap: () => isOpen.toggle(),
|
||||
child: AnimatedContainer(
|
||||
height: isOpen.value ? 320.h : 47.h,
|
||||
duration: Duration(milliseconds: 500),
|
||||
curve: Curves.linear,
|
||||
child: unitInformation(data.value),
|
||||
),
|
||||
);
|
||||
}, controller.isUnitInformationOpen),
|
||||
),
|
||||
],
|
||||
);
|
||||
} else {
|
||||
return SizedBox.shrink();
|
||||
}
|
||||
}, controller.userProfile),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.bottomSheet(changePasswordBottomSheet(), isScrollControlled: true);
|
||||
},
|
||||
child: Container(
|
||||
height: 47.h,
|
||||
margin: EdgeInsets.symmetric(horizontal: 8, vertical: 8.h),
|
||||
padding: EdgeInsets.symmetric(horizontal: 11.h, vertical: 8.h),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(width: 1, color: const Color(0xFFD6D6D6)),
|
||||
),
|
||||
child: Row(
|
||||
spacing: 6,
|
||||
children: [
|
||||
Assets.vec.lockSvg.svg(
|
||||
width: 24.w,
|
||||
height: 24.h,
|
||||
colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn),
|
||||
),
|
||||
Text(
|
||||
'تغییر رمز عبور',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.bottomSheet(exitBottomSheet(), isScrollControlled: true);
|
||||
},
|
||||
child: Container(
|
||||
height: 47.h,
|
||||
margin: EdgeInsets.symmetric(horizontal: 8),
|
||||
padding: EdgeInsets.symmetric(horizontal: 11.h, vertical: 8.h),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(width: 1, color: const Color(0xFFD6D6D6)),
|
||||
),
|
||||
child: Row(
|
||||
spacing: 6,
|
||||
children: [
|
||||
Assets.vec.logoutSvg.svg(
|
||||
width: 24.w,
|
||||
height: 24.h,
|
||||
colorFilter: ColorFilter.mode(AppColor.redNormal, BlendMode.srcIn),
|
||||
),
|
||||
Text(
|
||||
'خروج',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.redNormal),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
SizedBox(height: 100),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Container invoiceIssuanceInformation() => Container();
|
||||
|
||||
Widget bankInformationWidget() => Column(
|
||||
spacing: 16,
|
||||
children: [
|
||||
itemList(title: 'نام بانک', content: 'سامان'),
|
||||
itemList(title: 'نام صاحب حساب', content: 'رضا رضایی'),
|
||||
itemList(title: 'شماره کارت ', content: '54154545415'),
|
||||
itemList(title: 'شماره حساب', content: '62565263263652'),
|
||||
itemList(title: 'شماره شبا', content: '62565263263652'),
|
||||
],
|
||||
);
|
||||
|
||||
Widget userProfileInformation(Resource<UserProfile> value) {
|
||||
UserProfile item = value.data!;
|
||||
return Stack(
|
||||
clipBehavior: Clip.none,
|
||||
children: [
|
||||
Positioned.fill(
|
||||
child: ObxValue(
|
||||
(val) => Container(
|
||||
height: val.value ? 320.h : 47.h,
|
||||
margin: EdgeInsets.symmetric(horizontal: 8, vertical: val.value ? 8 : 0),
|
||||
padding: EdgeInsets.symmetric(horizontal: 11.h, vertical: 8.h),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(width: 0.5, color: AppColor.darkGreyLight),
|
||||
),
|
||||
child: val.value
|
||||
? Column(
|
||||
spacing: 6,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.bottomSheet(
|
||||
userInformationBottomSheet(),
|
||||
isScrollControlled: true,
|
||||
ignoreSafeArea: false,
|
||||
);
|
||||
},
|
||||
child: Assets.vec.editSvg.svg(
|
||||
width: 24.w,
|
||||
height: 24.h,
|
||||
colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12.0, vertical: 8.0),
|
||||
child: Column(
|
||||
children: [
|
||||
itemList(
|
||||
title: 'نام و نام خانوادگی',
|
||||
content: item.fullname ?? 'نامشخص',
|
||||
icon: Assets.vec.userSvg.path,
|
||||
hasColoredBox: true,
|
||||
),
|
||||
itemList(
|
||||
title: 'کدملی',
|
||||
content: item.nationalId ?? 'نامشخص',
|
||||
icon: Assets.vec.tagUserSvg.path,
|
||||
),
|
||||
itemList(
|
||||
title: 'موبایل',
|
||||
content: item.mobile ?? 'نامشخص',
|
||||
icon: Assets.vec.callSvg.path,
|
||||
),
|
||||
|
||||
itemList(
|
||||
title: 'شماره شناسنامه',
|
||||
content: item.nationalCode ?? 'نامشخص',
|
||||
icon: Assets.vec.userSquareSvg.path,
|
||||
),
|
||||
itemList(
|
||||
title: 'تاریخ تولد',
|
||||
content: item.birthday?.toJalali.formatCompactDate() ?? 'نامشخص',
|
||||
icon: Assets.vec.calendarSvg.path,
|
||||
),
|
||||
//todo
|
||||
itemList(
|
||||
title: 'استان',
|
||||
content: item.province ?? 'نامشخص',
|
||||
icon: Assets.vec.pictureFrameSvg.path,
|
||||
),
|
||||
itemList(
|
||||
title: 'شهر',
|
||||
content: item.city ?? 'نامشخص',
|
||||
icon: Assets.vec.mapSvg.path,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [Icon(CupertinoIcons.chevron_down, color: AppColor.iconColor)],
|
||||
),
|
||||
),
|
||||
controller.isUserInformationOpen,
|
||||
),
|
||||
),
|
||||
ObxValue(
|
||||
(isOpen) => AnimatedPositioned(
|
||||
right: 16,
|
||||
top: isOpen.value ? -7 : 11,
|
||||
duration: Duration(milliseconds: 500),
|
||||
child: Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
||||
decoration: isOpen.value
|
||||
? BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(width: 0.5, color: Color(0xFFA9A9A9)),
|
||||
)
|
||||
: null,
|
||||
child: Text(
|
||||
'اطلاعات هویتی',
|
||||
style: AppFonts.yekan16.copyWith(color: AppColor.iconColor),
|
||||
),
|
||||
),
|
||||
),
|
||||
controller.isUserInformationOpen,
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget unitInformation(Resource<UserProfile> value) {
|
||||
UserProfile item = value.data!;
|
||||
return Stack(
|
||||
clipBehavior: Clip.none,
|
||||
children: [
|
||||
Positioned.fill(
|
||||
child: ObxValue(
|
||||
(val) => Container(
|
||||
height: val.value ? 320.h : 47.h,
|
||||
margin: EdgeInsets.symmetric(horizontal: 8, vertical: val.value ? 12 : 0),
|
||||
padding: EdgeInsets.symmetric(horizontal: 11.h),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(width: 0.5, color: AppColor.darkGreyLight),
|
||||
),
|
||||
child: val.value
|
||||
? Column(
|
||||
children: [
|
||||
SizedBox(height: 5.h),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
GestureDetector(
|
||||
onTap: () {
|
||||
Get.bottomSheet(
|
||||
userInformationBottomSheet(),
|
||||
isScrollControlled: true,
|
||||
ignoreSafeArea: false,
|
||||
);
|
||||
},
|
||||
child: Assets.vec.editSvg.svg(
|
||||
width: 24.w,
|
||||
height: 24.h,
|
||||
colorFilter: ColorFilter.mode(AppColor.blueNormal, BlendMode.srcIn),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Padding(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 12.0, vertical: 8.0),
|
||||
child: Column(
|
||||
spacing: 2,
|
||||
children: [
|
||||
itemList(
|
||||
title: 'نام صنفی',
|
||||
content: item.unitName ?? 'نامشخص',
|
||||
hasColoredBox: true,
|
||||
visible: item.unitName != null,
|
||||
),
|
||||
itemList(
|
||||
title: 'شناسنامه ملی',
|
||||
content: item.unitNationalId ?? 'نامشخص',
|
||||
visible: item.unitName != null,
|
||||
),
|
||||
itemList(
|
||||
title: 'شماره ثبت',
|
||||
content: item.unitRegistrationNumber ?? 'نامشخص',
|
||||
visible: item.unitName != null,
|
||||
),
|
||||
|
||||
itemList(
|
||||
title: 'کد اقتصادی',
|
||||
content: item.unitEconomicalNumber ?? 'نامشخص',
|
||||
visible: item.unitName != null,
|
||||
),
|
||||
itemList(
|
||||
title: 'کد پستی',
|
||||
content: item.unitPostalCode ?? 'نامشخص',
|
||||
visible: item.unitName != null,
|
||||
),
|
||||
|
||||
itemList(
|
||||
title: 'استان',
|
||||
content: item.province ?? 'نامشخص',
|
||||
visible: item.unitName != null,
|
||||
),
|
||||
itemList(
|
||||
title: 'شهر',
|
||||
content: item.city ?? 'نامشخص',
|
||||
visible: item.unitName != null,
|
||||
),
|
||||
itemList(title: 'آدرس', content: item.unitAddress ?? 'نامشخص'),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
)
|
||||
: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [Icon(CupertinoIcons.chevron_down, color: AppColor.iconColor)],
|
||||
),
|
||||
),
|
||||
controller.isUnitInformationOpen,
|
||||
),
|
||||
),
|
||||
ObxValue(
|
||||
(isOpen) => AnimatedPositioned(
|
||||
right: 16,
|
||||
top: isOpen.value ? -2 : 11,
|
||||
duration: Duration(milliseconds: 500),
|
||||
child: Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 8, vertical: 4),
|
||||
decoration: isOpen.value
|
||||
? BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(width: 0.5, color: Color(0xFFA9A9A9)),
|
||||
)
|
||||
: null,
|
||||
child: Text(
|
||||
'اطلاعات صنفی',
|
||||
style: AppFonts.yekan16.copyWith(color: AppColor.iconColor),
|
||||
),
|
||||
),
|
||||
),
|
||||
controller.isUnitInformationOpen,
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
Widget itemList({
|
||||
required String title,
|
||||
required String content,
|
||||
String? icon,
|
||||
bool hasColoredBox = false,
|
||||
bool? visible,
|
||||
}) => Visibility(
|
||||
visible: visible ?? true,
|
||||
child: Container(
|
||||
padding: EdgeInsets.symmetric(horizontal: 12.h, vertical: 6.h),
|
||||
decoration: BoxDecoration(
|
||||
color: hasColoredBox ? AppColor.greenLight : Colors.transparent,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: hasColoredBox
|
||||
? Border.all(width: 0.25, color: AppColor.bgDark)
|
||||
: Border.all(width: 0, color: Colors.transparent),
|
||||
),
|
||||
child: Row(
|
||||
spacing: 4,
|
||||
children: [
|
||||
if (icon != null)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(left: 8.0),
|
||||
child: SvgGenImage.vec(icon).svg(
|
||||
width: 20.w,
|
||||
height: 20.h,
|
||||
colorFilter: ColorFilter.mode(AppColor.textColor, BlendMode.srcIn),
|
||||
),
|
||||
),
|
||||
Text(title, style: AppFonts.yekan14.copyWith(color: AppColor.textColor)),
|
||||
Spacer(),
|
||||
Text(content, style: AppFonts.yekan14.copyWith(color: AppColor.textColor)),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
Widget cardActionWidget({
|
||||
required String title,
|
||||
required VoidCallback onPressed,
|
||||
required String icon,
|
||||
bool selected = false,
|
||||
ColorFilter? color,
|
||||
Color? cardColor,
|
||||
Color? cardIconColor,
|
||||
Color? textColor,
|
||||
}) {
|
||||
return GestureDetector(
|
||||
onTap: onPressed,
|
||||
child: Column(
|
||||
spacing: 4,
|
||||
children: [
|
||||
Container(
|
||||
width: 52.w,
|
||||
height: 52.h,
|
||||
padding: EdgeInsets.all(6),
|
||||
decoration: ShapeDecoration(
|
||||
color: cardColor ?? AppColor.blueLight,
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
|
||||
),
|
||||
child: Container(
|
||||
padding: EdgeInsets.all(4),
|
||||
decoration: BoxDecoration(
|
||||
color: cardIconColor,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
child: SvgGenImage.vec(icon).svg(
|
||||
width: 40.w,
|
||||
height: 40.h,
|
||||
colorFilter: color ?? ColorFilter.mode(Colors.white, BlendMode.srcIn),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(height: 2),
|
||||
Text(
|
||||
title,
|
||||
style: AppFonts.yekan10.copyWith(color: AppColor.textColor),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget userInformationBottomSheet() {
|
||||
return BaseBottomSheet(
|
||||
height: 750.h,
|
||||
child: SingleChildScrollView(
|
||||
child: Column(
|
||||
spacing: 8,
|
||||
children: [
|
||||
Text(
|
||||
'ویرایش اطلاعات هویتی',
|
||||
style: AppFonts.yekan16Bold.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
),
|
||||
|
||||
Container(
|
||||
padding: EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(color: AppColor.darkGreyLight, width: 1),
|
||||
),
|
||||
child: Column(
|
||||
spacing: 12,
|
||||
children: [
|
||||
RTextField(
|
||||
controller: controller.nameController,
|
||||
label: 'نام',
|
||||
borderColor: AppColor.darkGreyLight,
|
||||
filledColor: AppColor.bgLight,
|
||||
filled: true,
|
||||
),
|
||||
RTextField(
|
||||
controller: controller.lastNameController,
|
||||
label: 'نام خانوادگی',
|
||||
borderColor: AppColor.darkGreyLight,
|
||||
filledColor: AppColor.bgLight,
|
||||
filled: true,
|
||||
),
|
||||
RTextField(
|
||||
controller: controller.nationalCodeController,
|
||||
label: 'شماره شناسنامه',
|
||||
borderColor: AppColor.darkGreyLight,
|
||||
filledColor: AppColor.bgLight,
|
||||
filled: true,
|
||||
),
|
||||
RTextField(
|
||||
controller: controller.nationalIdController,
|
||||
label: 'کد ملی',
|
||||
borderColor: AppColor.darkGreyLight,
|
||||
filledColor: AppColor.bgLight,
|
||||
filled: true,
|
||||
),
|
||||
|
||||
ObxValue((data) {
|
||||
return RTextField(
|
||||
controller: controller.birthdayController,
|
||||
label: 'تاریخ تولد',
|
||||
initText: data.value?.formatCompactDate() ?? '',
|
||||
borderColor: AppColor.darkGreyLight,
|
||||
filledColor: AppColor.bgLight,
|
||||
filled: true,
|
||||
onTap: () {},
|
||||
);
|
||||
}, controller.birthDate),
|
||||
|
||||
SizedBox(),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(),
|
||||
|
||||
Container(
|
||||
padding: EdgeInsets.all(8),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(color: AppColor.darkGreyLight, width: 1),
|
||||
),
|
||||
child: Column(
|
||||
spacing: 8,
|
||||
children: [
|
||||
Text(
|
||||
'عکس پروفایل',
|
||||
style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
ObxValue((data) {
|
||||
return Container(
|
||||
width: Get.width,
|
||||
height: 270,
|
||||
decoration: BoxDecoration(
|
||||
color: AppColor.lightGreyNormal,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(width: 1, color: AppColor.blackLight),
|
||||
),
|
||||
child: Center(
|
||||
child: data.value == null
|
||||
? Padding(
|
||||
padding: const EdgeInsets.fromLTRB(30, 10, 10, 30),
|
||||
child: Image.network(
|
||||
controller.userProfile.value.data?.image ?? '',
|
||||
),
|
||||
)
|
||||
: Image.file(File(data.value!.path), fit: BoxFit.cover),
|
||||
),
|
||||
);
|
||||
}, controller.selectedImage),
|
||||
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
RElevated(
|
||||
text: 'گالری',
|
||||
width: 150.w,
|
||||
height: 40.h,
|
||||
textStyle: AppFonts.yekan20.copyWith(color: Colors.white),
|
||||
onPressed: () async {
|
||||
controller.selectedImage.value = await controller.imagePicker.pickImage(
|
||||
source: ImageSource.gallery,
|
||||
imageQuality: 60,
|
||||
maxWidth: 1080,
|
||||
maxHeight: 720,
|
||||
);
|
||||
},
|
||||
),
|
||||
SizedBox(width: 16),
|
||||
ROutlinedElevated(
|
||||
text: 'دوربین',
|
||||
width: 150.w,
|
||||
height: 40.h,
|
||||
textStyle: AppFonts.yekan20.copyWith(color: AppColor.blueNormal),
|
||||
onPressed: () async {
|
||||
controller.selectedImage.value = await controller.imagePicker.pickImage(
|
||||
source: ImageSource.camera,
|
||||
imageQuality: 60,
|
||||
maxWidth: 1080,
|
||||
maxHeight: 720,
|
||||
);
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Row(
|
||||
spacing: 16,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
ObxValue((data) {
|
||||
return RElevated(
|
||||
height: 40.h,
|
||||
text: 'ویرایش',
|
||||
isLoading: data.value,
|
||||
onPressed: () async {
|
||||
await controller.updateUserProfile();
|
||||
controller.getUserProfile();
|
||||
Get.back();
|
||||
},
|
||||
);
|
||||
}, controller.isOnLoading),
|
||||
ROutlinedElevated(
|
||||
height: 40.h,
|
||||
text: 'انصراف',
|
||||
borderColor: AppColor.blueNormal,
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget changePasswordBottomSheet() {
|
||||
return BaseBottomSheet(
|
||||
height: 400.h,
|
||||
child: SingleChildScrollView(
|
||||
child: Form(
|
||||
key: controller.formKey,
|
||||
child: Column(
|
||||
spacing: 8,
|
||||
children: [
|
||||
Text(
|
||||
'تغییر رمز عبور',
|
||||
style: AppFonts.yekan16Bold.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
),
|
||||
SizedBox(),
|
||||
RTextField(
|
||||
controller: controller.oldPasswordController,
|
||||
hintText: 'رمز عبور قبلی',
|
||||
borderColor: AppColor.darkGreyLight,
|
||||
filledColor: AppColor.bgLight,
|
||||
filled: true,
|
||||
validator: (value) {
|
||||
if (value == null || value.isEmpty) {
|
||||
return 'رمز عبور را وارد کنید';
|
||||
} else if (controller.userProfile.value.data?.password != value) {
|
||||
return 'رمز عبور صحیح نیست';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
RTextField(
|
||||
controller: controller.newPasswordController,
|
||||
hintText: 'رمز عبور جدید',
|
||||
borderColor: AppColor.darkGreyLight,
|
||||
filledColor: AppColor.bgLight,
|
||||
filled: true,
|
||||
validator: (value) {
|
||||
if (value == null || value.isEmpty) {
|
||||
return 'رمز عبور را وارد کنید';
|
||||
} else if (value.length < 6) {
|
||||
return 'رمز عبور باید بیش از 6 کارکتر باشد.';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
RTextField(
|
||||
controller: controller.retryNewPasswordController,
|
||||
hintText: 'تکرار رمز عبور جدید',
|
||||
borderColor: AppColor.darkGreyLight,
|
||||
filledColor: AppColor.bgLight,
|
||||
filled: true,
|
||||
validator: (value) {
|
||||
if (value == null || value.isEmpty) {
|
||||
return 'رمز عبور را وارد کنید';
|
||||
} else if (value.length < 6) {
|
||||
return 'رمز عبور باید بیش از 6 کارکتر باشد.';
|
||||
} else if (controller.newPasswordController.text != value) {
|
||||
return 'رمز عبور جدید یکسان نیست';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
),
|
||||
|
||||
SizedBox(),
|
||||
|
||||
Row(
|
||||
spacing: 16,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
RElevated(
|
||||
height: 40.h,
|
||||
text: 'ویرایش',
|
||||
onPressed: () async {
|
||||
if (controller.formKey.currentState?.validate() != true) {
|
||||
return;
|
||||
}
|
||||
await controller.updatePassword();
|
||||
controller.getUserProfile();
|
||||
controller.clearPasswordForm();
|
||||
Get.back();
|
||||
},
|
||||
),
|
||||
ROutlinedElevated(
|
||||
height: 40.h,
|
||||
text: 'انصراف',
|
||||
borderColor: AppColor.blueNormal,
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget exitBottomSheet() {
|
||||
return BaseBottomSheet(
|
||||
height: 220.h,
|
||||
child: SingleChildScrollView(
|
||||
child: Form(
|
||||
key: controller.formKey,
|
||||
child: Column(
|
||||
spacing: 8,
|
||||
children: [
|
||||
Text('خروج', style: AppFonts.yekan16Bold.copyWith(color: AppColor.error)),
|
||||
SizedBox(),
|
||||
Text(
|
||||
'آیا مطمئن هستید که میخواهید از حساب کاربری خود خارج شوید؟',
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan16Bold.copyWith(color: AppColor.textColor),
|
||||
),
|
||||
|
||||
SizedBox(),
|
||||
|
||||
Row(
|
||||
spacing: 16,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
RElevated(
|
||||
height: 40.h,
|
||||
text: 'خروج',
|
||||
backgroundColor: AppColor.error,
|
||||
onPressed: () async {
|
||||
await Future.wait([
|
||||
controller.tokenService.deleteModuleTokens(Module.chicken),
|
||||
controller.gService.clearSelectedModule(),
|
||||
]).then((value) async {
|
||||
await removeChickenDI();
|
||||
Get.offAllNamed("/moduleList");
|
||||
});
|
||||
},
|
||||
),
|
||||
ROutlinedElevated(
|
||||
height: 40.h,
|
||||
text: 'انصراف',
|
||||
borderColor: AppColor.blueNormal,
|
||||
onPressed: () {
|
||||
Get.back();
|
||||
},
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Widget rolesWidget() {
|
||||
return ObxValue((data) {
|
||||
if (data.value.status == ResourceStatus.loading) {
|
||||
return CupertinoActivityIndicator();
|
||||
} else if (data.value.status == ResourceStatus.error) {
|
||||
return ErrorWidget('خطا در دریافت اطلاعات کاربر');
|
||||
} else if (data.value.status == ResourceStatus.success) {
|
||||
List<String>? item = data.value.data?.roles;
|
||||
return SingleChildScrollView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
padding: EdgeInsets.symmetric(horizontal: 8.w),
|
||||
physics: BouncingScrollPhysics(),
|
||||
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
spacing: 8.w,
|
||||
children: List.generate(item?.length ?? 0, (index) {
|
||||
Map tmpRole = getFaUserRoleWithOnTap(item?[index]);
|
||||
return CustomChip(
|
||||
isSelected: controller.gService.getRoute(Module.chicken) == tmpRole.values.first,
|
||||
title: tmpRole.keys.first,
|
||||
index: index,
|
||||
onTap: (int p1) {
|
||||
controller.changeUserRole(tmpRole.values.first);
|
||||
},
|
||||
);
|
||||
}),
|
||||
),
|
||||
);
|
||||
} else {
|
||||
return SizedBox.shrink();
|
||||
}
|
||||
}, controller.userLocal);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
class RoleLogic extends GetxController {
|
||||
TokenStorageService tokenService = Get.find<TokenStorageService>();
|
||||
GService gService = Get.find<GService>();
|
||||
RxList<String> roles = <String>[].obs;
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
List<String> items = tokenService.getUserLocal(Module.chicken)!.roles ?? [];
|
||||
if (items.isNotEmpty) {
|
||||
roles.assignAll(items);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_chicken/data/common/fa_user_role.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/base_page/view.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
import 'logic.dart';
|
||||
|
||||
class RolePage extends GetView<RoleLogic> {
|
||||
const RolePage({super.key});
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ChickenBasePage(
|
||||
isBase: true,
|
||||
child: Column(
|
||||
children: [
|
||||
Assets.images.selectRole.image(height: 212.h, width: Get.width.w, fit: BoxFit.cover),
|
||||
ObxValue((data) {
|
||||
return Expanded(
|
||||
child: GridView.builder(
|
||||
physics: BouncingScrollPhysics(),
|
||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 3,
|
||||
mainAxisSpacing: 12.h,
|
||||
crossAxisSpacing: 12.w,
|
||||
childAspectRatio: 2,
|
||||
),
|
||||
itemCount: data.length,
|
||||
hitTestBehavior: HitTestBehavior.opaque,
|
||||
itemBuilder: (BuildContext context, int index) {
|
||||
Map role = getFaUserRoleWithOnTap(data[index]);
|
||||
return roleCard(
|
||||
title: role.keys.first,
|
||||
onTap: () async {
|
||||
try {
|
||||
String route = role.values.first;
|
||||
await controller.gService.saveRoute(Module.chicken, route);
|
||||
|
||||
await controller.gService.saveRole(Module.chicken, data[index]);
|
||||
Get.offAllNamed(route);
|
||||
} catch (e) {
|
||||
eLog(
|
||||
"احتمالا در\n ``getFaUserRoleWithOnTap`` \nروت اش را تعریف نکردی 👻👻 ==>$e ",
|
||||
);
|
||||
}
|
||||
},
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}, controller.roles),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Widget roleCard({required String title, Function()? onTap, int? width, int? height}) {
|
||||
return Container(
|
||||
width: width?.w ?? 128.w,
|
||||
height: height?.h ?? 48.h,
|
||||
margin: EdgeInsets.all(8.w),
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8.r),
|
||||
border: Border.all(color: AppColor.blueNormal, width: 1.w),
|
||||
),
|
||||
child: InkWell(
|
||||
onTap: onTap,
|
||||
child: Center(
|
||||
child: Text(
|
||||
title,
|
||||
style: AppFonts.yekan12Bold.copyWith(color: AppColor.blueNormal),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
import 'package:rasadyar_chicken/features/common/presentation/page/auth/logic.dart';
|
||||
import 'package:rasadyar_chicken/features/common/presentation/page/auth/view.dart';
|
||||
import 'package:rasadyar_chicken/features/common/presentation/page/profile/logic.dart';
|
||||
import 'package:rasadyar_chicken/features/common/presentation/page/profile/view.dart';
|
||||
import 'package:rasadyar_chicken/features/common/presentation/page/role/logic.dart';
|
||||
import 'package:rasadyar_chicken/features/common/presentation/page/role/view.dart';
|
||||
import 'package:rasadyar_chicken/features/common/presentation/routes/routes.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/base_page/logic.dart';
|
||||
import 'package:rasadyar_chicken/presentation/widget/captcha/logic.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
class CommonPages {
|
||||
CommonPages._();
|
||||
|
||||
static List<GetPage> get pages => [
|
||||
GetPage(
|
||||
name: CommonRoutes.auth,
|
||||
page: () => AuthPage(),
|
||||
binding: BindingsBuilder(() {
|
||||
Get.lazyPut(() => AuthLogic());
|
||||
Get.lazyPut(() => CaptchaWidgetLogic());
|
||||
Get.lazyPut(() => ChickenBaseLogic(), fenix: true);
|
||||
}),
|
||||
),
|
||||
GetPage(
|
||||
name: CommonRoutes.role,
|
||||
page: () => RolePage(),
|
||||
binding: BindingsBuilder(() {
|
||||
Get.lazyPut(() => RoleLogic());
|
||||
Get.lazyPut(() => ChickenBaseLogic(), fenix: true);
|
||||
}),
|
||||
),
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
sealed class CommonRoutes {
|
||||
CommonRoutes._();
|
||||
|
||||
static const auth = '/AuthChicken';
|
||||
static const _base = '/chicken';
|
||||
static const role = '$_base/role';
|
||||
static const String profile = '$_base/profile';
|
||||
}
|
||||
@@ -1,13 +1,13 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_chicken/data/di/chicken_di.dart';
|
||||
import 'package:rasadyar_chicken/data/models/request/change_password/change_password_request_model.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/iran_province_city/iran_province_city_model.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/user_profile/user_profile.dart';
|
||||
import 'package:rasadyar_chicken/data/repositories/chicken/chicken_repository.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/request/change_password/change_password_request_model.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/iran_province_city/iran_province_city_model.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/user_profile/user_profile.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/repositories/common/common_repository.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
class ProfileLogic extends GetxController {
|
||||
ChickenRepository chickenRepository = diChicken.get<ChickenRepository>();
|
||||
CommonRepository commonRepository = diChicken.get<CommonRepository>();
|
||||
GService gService = Get.find<GService>();
|
||||
TokenStorageService tokenService = Get.find<TokenStorageService>();
|
||||
RxInt selectedInformationType = 0.obs;
|
||||
@@ -43,6 +43,8 @@ class ProfileLogic extends GetxController {
|
||||
RxBool isUserInformationOpen = true.obs;
|
||||
RxBool isUnitInformationOpen = false.obs;
|
||||
|
||||
ScrollController scrollController = ScrollController();
|
||||
|
||||
@override
|
||||
void onInit() {
|
||||
super.onInit();
|
||||
@@ -79,11 +81,10 @@ class ProfileLogic extends GetxController {
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Future<void> getUserProfile() async {
|
||||
userProfile.value = Resource.loading();
|
||||
await safeCall<UserProfile?>(
|
||||
call: () async => await chickenRepository.getUserProfile(
|
||||
call: () async => await commonRepository.getUserProfile(
|
||||
token: tokenService.accessToken.value!,
|
||||
),
|
||||
onSuccess: (result) {
|
||||
@@ -97,7 +98,7 @@ class ProfileLogic extends GetxController {
|
||||
|
||||
Future<void> getCites() async {
|
||||
await safeCall(
|
||||
call: () => chickenRepository.getCity(
|
||||
call: () => commonRepository.getCity(
|
||||
provinceName: selectedProvince.value?.name ?? '',
|
||||
),
|
||||
onSuccess: (result) {
|
||||
@@ -124,7 +125,7 @@ class ProfileLogic extends GetxController {
|
||||
);
|
||||
isOnLoading.value = true;
|
||||
await safeCall(
|
||||
call: () async => await chickenRepository.updateUserProfile(
|
||||
call: () async => await commonRepository.updateUserProfile(
|
||||
token: tokenService.accessToken.value!,
|
||||
userProfile: userProfile,
|
||||
),
|
||||
@@ -145,7 +146,7 @@ class ProfileLogic extends GetxController {
|
||||
);
|
||||
|
||||
await safeCall(
|
||||
call: () async => await chickenRepository.updatePassword(
|
||||
call: () async => await commonRepository.updatePassword(
|
||||
token: tokenService.accessToken.value!,
|
||||
model: model,
|
||||
),
|
||||
@@ -178,4 +179,79 @@ class ProfileLogic extends GetxController {
|
||||
|
||||
Get.offAllNamed(newRole);
|
||||
}
|
||||
|
||||
void scrollToSelectedItem(
|
||||
int index, {
|
||||
double chipWidth = 100,
|
||||
double spacing = 8,
|
||||
GlobalKey? itemKey,
|
||||
}) {
|
||||
if (!scrollController.hasClients) {
|
||||
WidgetsBinding.instance.addPostFrameCallback((_) {
|
||||
_performScroll(index, chipWidth, spacing, itemKey);
|
||||
});
|
||||
} else {
|
||||
_performScroll(index, chipWidth, spacing, itemKey);
|
||||
}
|
||||
}
|
||||
|
||||
void _performScroll(
|
||||
int index,
|
||||
double chipWidth,
|
||||
double spacing,
|
||||
GlobalKey? itemKey,
|
||||
) {
|
||||
if (!scrollController.hasClients) return;
|
||||
|
||||
double targetOffset;
|
||||
|
||||
// If we have a GlobalKey, use it for precise positioning
|
||||
if (itemKey?.currentContext != null) {
|
||||
final RenderBox? renderBox =
|
||||
itemKey!.currentContext?.findRenderObject() as RenderBox?;
|
||||
if (renderBox != null) {
|
||||
final position = renderBox.localToGlobal(Offset.zero);
|
||||
final scrollPosition = scrollController.position;
|
||||
final viewportWidth = scrollPosition.viewportDimension;
|
||||
final chipWidth = renderBox.size.width;
|
||||
|
||||
// Get the scroll position of the item
|
||||
final itemScrollPosition = position.dx - scrollPosition.pixels;
|
||||
// Center the item
|
||||
targetOffset =
|
||||
scrollPosition.pixels +
|
||||
itemScrollPosition -
|
||||
(viewportWidth / 2) +
|
||||
(chipWidth / 2);
|
||||
} else {
|
||||
// Fallback to estimated position
|
||||
targetOffset = _calculateEstimatedPosition(index, chipWidth, spacing);
|
||||
}
|
||||
} else {
|
||||
// Use estimated position
|
||||
targetOffset = _calculateEstimatedPosition(index, chipWidth, spacing);
|
||||
}
|
||||
|
||||
scrollController.animateTo(
|
||||
targetOffset.clamp(0.0, scrollController.position.maxScrollExtent),
|
||||
duration: const Duration(milliseconds: 300),
|
||||
curve: Curves.easeInOut,
|
||||
);
|
||||
}
|
||||
|
||||
double _calculateEstimatedPosition(
|
||||
int index,
|
||||
double chipWidth,
|
||||
double spacing,
|
||||
) {
|
||||
final double itemPosition = (chipWidth + spacing) * index;
|
||||
final double viewportWidth = scrollController.position.viewportDimension;
|
||||
return itemPosition - (viewportWidth / 2) + (chipWidth / 2);
|
||||
}
|
||||
|
||||
@override
|
||||
void onClose() {
|
||||
scrollController.dispose();
|
||||
super.onClose();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import 'package:flutter/cupertino.dart' hide Image;
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_chicken/data/common/fa_user_role.dart';
|
||||
import 'package:rasadyar_chicken/data/di/chicken_di.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/user_profile/user_profile.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/user_profile/user_profile.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
import 'logic.dart';
|
||||
@@ -877,6 +877,7 @@ class ProfilePage extends GetView<ProfileLogic> {
|
||||
scrollDirection: Axis.horizontal,
|
||||
padding: EdgeInsets.symmetric(horizontal: 8.w),
|
||||
physics: BouncingScrollPhysics(),
|
||||
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
spacing: 8.w,
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
abstract class ChickenRemoteDataSource {
|
||||
Future<void> getChickens();
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
import 'package:rasadyar_chicken/features/poultry_science/data/model/response/poultry_science_report/poultry_science_report.dart';
|
||||
import 'package:rasadyar_chicken/features/poultry_science/data/model/request/submit_inspection/submit_inspection_response.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
abstract class JahadRemoteDataSource {
|
||||
Future<PaginationModel<PoultryScienceReport>?> getSubmitInspectionList({
|
||||
required String token,
|
||||
Map<String, dynamic>? queryParameters,
|
||||
});
|
||||
|
||||
Future<void> submitInspection({
|
||||
required String token,
|
||||
required SubmitInspectionResponse request,
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
import 'package:rasadyar_chicken/features/poultry_science/data/model/response/poultry_science_report/poultry_science_report.dart';
|
||||
import 'package:rasadyar_chicken/features/poultry_science/data/model/request/submit_inspection/submit_inspection_response.dart';
|
||||
import 'package:rasadyar_chicken/features/jahad/data/datasources/remote/jahad_remote_data_source.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
class JahadRemoteDataSourceImpl implements JahadRemoteDataSource {
|
||||
final DioRemote _httpClient;
|
||||
|
||||
JahadRemoteDataSourceImpl(this._httpClient);
|
||||
|
||||
@override
|
||||
Future<PaginationModel<PoultryScienceReport>?> getSubmitInspectionList({
|
||||
required String token,
|
||||
Map<String, dynamic>? queryParameters,
|
||||
}) async {
|
||||
var res = await _httpClient.get(
|
||||
'/poultry_science_report/',
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
queryParameters: queryParameters,
|
||||
fromJson: (json) => PaginationModel<PoultryScienceReport>.fromJson(
|
||||
json,
|
||||
(json) => PoultryScienceReport.fromJson(json as Map<String, dynamic>),
|
||||
),
|
||||
);
|
||||
return res.data;
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> submitInspection({
|
||||
required String token,
|
||||
required SubmitInspectionResponse request,
|
||||
}) async {
|
||||
await _httpClient.post(
|
||||
'/poultry_science_report/',
|
||||
headers: {'Authorization': 'Bearer $token'},
|
||||
data: request.toJson(),
|
||||
);
|
||||
}
|
||||
}
|
||||
36
packages/chicken/lib/features/jahad/data/di/jahad_di.dart
Normal file
36
packages/chicken/lib/features/jahad/data/di/jahad_di.dart
Normal file
@@ -0,0 +1,36 @@
|
||||
import 'package:rasadyar_chicken/features/jahad/data/datasources/remote/jahad_remote_data_source.dart';
|
||||
import 'package:rasadyar_chicken/features/jahad/data/datasources/remote/jahad_remote_data_source_impl.dart';
|
||||
import 'package:rasadyar_chicken/features/jahad/data/repositories/jahad_repository.dart';
|
||||
import 'package:rasadyar_chicken/features/jahad/data/repositories/jahad_repository_impl.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
/// Setup dependency injection for jahad feature
|
||||
Future<void> setupJahadDI(GetIt di, DioRemote dioRemote) async {
|
||||
di.registerLazySingleton<JahadRemoteDataSource>(
|
||||
() => JahadRemoteDataSourceImpl(dioRemote),
|
||||
);
|
||||
|
||||
di.registerLazySingleton<JahadRepository>(
|
||||
() => JahadRepositoryImpl(di.get<JahadRemoteDataSource>()),
|
||||
);
|
||||
}
|
||||
|
||||
/// Re-register jahad dependencies (used when base URL changes)
|
||||
Future<void> reRegisterJahadDI(GetIt di, DioRemote dioRemote) async {
|
||||
await reRegister(di, () => JahadRemoteDataSourceImpl(dioRemote));
|
||||
await reRegister(
|
||||
di,
|
||||
() => JahadRepositoryImpl(di.get<JahadRemoteDataSource>()),
|
||||
);
|
||||
}
|
||||
|
||||
/// Helper function to re-register a dependency
|
||||
Future<void> reRegister<T extends Object>(
|
||||
GetIt di,
|
||||
T Function() factory,
|
||||
) async {
|
||||
if (di.isRegistered<T>()) {
|
||||
await di.unregister<T>();
|
||||
}
|
||||
di.registerLazySingleton<T>(factory);
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
import 'package:rasadyar_chicken/features/poultry_science/data/model/response/poultry_science_report/poultry_science_report.dart';
|
||||
import 'package:rasadyar_chicken/features/poultry_science/data/model/request/submit_inspection/submit_inspection_response.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
abstract class JahadRepository {
|
||||
Future<PaginationModel<PoultryScienceReport>?> getSubmitInspectionList({
|
||||
required String token,
|
||||
Map<String, dynamic>? queryParameters,
|
||||
});
|
||||
|
||||
Future<void> submitInspection({
|
||||
required String token,
|
||||
required SubmitInspectionResponse request,
|
||||
});
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
import 'package:rasadyar_chicken/features/poultry_science/data/model/response/poultry_science_report/poultry_science_report.dart';
|
||||
import 'package:rasadyar_chicken/features/poultry_science/data/model/request/submit_inspection/submit_inspection_response.dart';
|
||||
import 'package:rasadyar_chicken/features/jahad/data/datasources/remote/jahad_remote_data_source.dart';
|
||||
import 'package:rasadyar_chicken/features/jahad/data/repositories/jahad_repository.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
class JahadRepositoryImpl implements JahadRepository {
|
||||
final JahadRemoteDataSource _remote;
|
||||
|
||||
JahadRepositoryImpl(this._remote);
|
||||
|
||||
@override
|
||||
Future<PaginationModel<PoultryScienceReport>?> getSubmitInspectionList({
|
||||
required String token,
|
||||
Map<String, dynamic>? queryParameters,
|
||||
}) async {
|
||||
return await _remote.getSubmitInspectionList(
|
||||
token: token,
|
||||
queryParameters: queryParameters,
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> submitInspection({
|
||||
required String token,
|
||||
required SubmitInspectionResponse request,
|
||||
}) async {
|
||||
return await _remote.submitInspection(token: token, request: request);
|
||||
}
|
||||
}
|
||||
3
packages/chicken/lib/features/jahad/jahad.dart
Normal file
3
packages/chicken/lib/features/jahad/jahad.dart
Normal file
@@ -0,0 +1,3 @@
|
||||
export 'data/di/jahad_di.dart';
|
||||
export 'presentation/routes/routes.dart';
|
||||
export 'presentation/routes/pages.dart';
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user