fix: resolve import path issues and clean up unused imports across multiple files
This commit is contained in:
@@ -4,21 +4,7 @@ import 'package:flutter/services.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:rasadyar_chicken/features/common/data/datasources/local/chicken_local.dart';
|
||||
import 'package:rasadyar_chicken/data/di/chicken_di.dart';
|
||||
<<<<<<<< HEAD:packages/chicken/lib/features/steward/root/logic.dart
|
||||
import 'package:rasadyar_chicken/data/models/local/widely_used_local_model.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/iran_province_city/iran_province_city_model.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/roles_products/roles_products.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/steward_remain_weight/steward_remain_weight.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/steward_sales_info_dashboard/steward_sales_info_dashboard.dart';
|
||||
import 'package:rasadyar_chicken/data/models/response/waiting_arrival/waiting_arrival.dart'
|
||||
hide ProductModel;
|
||||
import 'package:rasadyar_chicken/data/repositories/chicken/chicken_repository.dart';
|
||||
import 'package:rasadyar_chicken/features/common/profile/view.dart';
|
||||
import 'package:rasadyar_chicken/features/steward/buy/view.dart';
|
||||
import 'package:rasadyar_chicken/features/steward/home/view.dart';
|
||||
import 'package:rasadyar_chicken/features/steward/sale/view.dart';
|
||||
import 'package:rasadyar_chicken/features/steward/segmentation/view.dart';
|
||||
========
|
||||
|
||||
import 'package:rasadyar_chicken/features/common/data/model/local/widely_used_local_model.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';
|
||||
@@ -35,7 +21,7 @@ import 'package:rasadyar_chicken/features/steward/presentation/pages/home/view.d
|
||||
import 'package:rasadyar_chicken/features/steward/presentation/pages/sale/view.dart';
|
||||
import 'package:rasadyar_chicken/features/steward/presentation/pages/segmentation/view.dart';
|
||||
import 'package:rasadyar_chicken/features/steward/presentation/routes/routes.dart';
|
||||
>>>>>>>> develop:packages/chicken/lib/features/steward/presentation/pages/root/logic.dart
|
||||
|
||||
import 'package:rasadyar_chicken/presentation/routes/routes.dart';
|
||||
import 'package:rasadyar_chicken/presentation/utils/nested_keys_utils.dart';
|
||||
import 'package:rasadyar_chicken/presentation/utils/utils.dart';
|
||||
@@ -46,27 +32,12 @@ enum ErrorLocationType { serviceDisabled, permissionDenied, none }
|
||||
class StewardRootLogic extends GetxController {
|
||||
DateTime? _lastBackPressed;
|
||||
RxInt currentPage = 2.obs;
|
||||
List<Widget> pages = [
|
||||
BuyPage(),
|
||||
SalePage(),
|
||||
HomePage(),
|
||||
SegmentationPage(),
|
||||
ProfilePage(),
|
||||
];
|
||||
List<Widget> pages = [BuyPage(), SalePage(), HomePage(), SegmentationPage(), ProfilePage()];
|
||||
|
||||
final defaultRoutes = <int, String>{
|
||||
<<<<<<<< HEAD:packages/chicken/lib/features/steward/root/logic.dart
|
||||
0: ChickenRoutes.buySteward,
|
||||
1: ChickenRoutes.saleSteward,
|
||||
========
|
||||
0: StewardRoutes.buySteward,
|
||||
1: StewardRoutes.saleSteward,
|
||||
>>>>>>>> develop:packages/chicken/lib/features/steward/presentation/pages/root/logic.dart
|
||||
};
|
||||
final defaultRoutes = <int, String>{0: StewardRoutes.buySteward, 1: StewardRoutes.saleSteward};
|
||||
RxList<ProductModel> rolesProductsModel = RxList<ProductModel>();
|
||||
Rxn<WidelyUsedLocalModel> widelyUsedList = Rxn<WidelyUsedLocalModel>();
|
||||
Rxn<StewardSalesInfoDashboard> stewardSalesInfoDashboard =
|
||||
Rxn<StewardSalesInfoDashboard>();
|
||||
Rxn<StewardSalesInfoDashboard> stewardSalesInfoDashboard = Rxn<StewardSalesInfoDashboard>();
|
||||
Rxn<StewardRemainWeight> stewardRemainWeight = Rxn<StewardRemainWeight>();
|
||||
|
||||
late DioRemote dioRemote;
|
||||
@@ -110,9 +81,7 @@ class StewardRootLogic extends GetxController {
|
||||
|
||||
if (widelyUsedList.value?.hasInit != true) {
|
||||
//TODO
|
||||
localDatasource.initWidleyUsed().then(
|
||||
(value) => localDatasource.getAllWidely(),
|
||||
);
|
||||
localDatasource.initWidleyUsed().then((value) => localDatasource.getAllWidely());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -147,17 +116,11 @@ class StewardRootLogic extends GetxController {
|
||||
// Cancel previous request if still running
|
||||
_inventoryCancelToken?.cancel();
|
||||
_inventoryCancelToken = CancelToken();
|
||||
|
||||
<<<<<<<< HEAD:packages/chicken/lib/features/steward/root/logic.dart
|
||||
await safeCall<List<ProductModel>?>(
|
||||
call: () async => await chickenRepository.getRolesProducts(
|
||||
========
|
||||
/*
|
||||
await safeCall<List<InventoryModel>?>(
|
||||
call: () async => await commonRepository.getInventory(
|
||||
>>>>>>>> develop:packages/chicken/lib/features/steward/presentation/pages/root/logic.dart
|
||||
token: tokenService.accessToken.value!,
|
||||
cancelToken: _inventoryCancelToken,
|
||||
queryParameters: buildRawQueryParams(role: 'Steward'),
|
||||
),
|
||||
onSuccess: (result) {
|
||||
if (result != null) {
|
||||
@@ -170,7 +133,7 @@ class StewardRootLogic extends GetxController {
|
||||
return;
|
||||
}
|
||||
},
|
||||
);
|
||||
);*/
|
||||
}
|
||||
|
||||
void rootErrorHandler(DioException error) {
|
||||
@@ -189,13 +152,7 @@ class StewardRootLogic extends GetxController {
|
||||
_provincesCancelToken = CancelToken();
|
||||
|
||||
try {
|
||||
<<<<<<<< HEAD:packages/chicken/lib/features/steward/root/logic.dart
|
||||
final res = await chickenRepository.getProvince(
|
||||
========
|
||||
final res = await commonRepository.getProvince(
|
||||
>>>>>>>> develop:packages/chicken/lib/features/steward/presentation/pages/root/logic.dart
|
||||
cancelToken: _provincesCancelToken,
|
||||
);
|
||||
final res = await commonRepository.getProvince(cancelToken: _provincesCancelToken);
|
||||
if (res != null) {
|
||||
provinces.clear();
|
||||
provinces.value = res;
|
||||
@@ -211,15 +168,8 @@ class StewardRootLogic extends GetxController {
|
||||
|
||||
Future<void> getRolesProducts() async {
|
||||
safeCall(
|
||||
<<<<<<<< HEAD:packages/chicken/lib/features/steward/root/logic.dart
|
||||
call: () async => await chickenRepository.getRolesProducts(
|
||||
token: tokenService.accessToken.value!,
|
||||
queryParameters: buildQueryParams(role: 'Steward'),
|
||||
========
|
||||
call: () async => await commonRepository.getRolesProducts(
|
||||
token: tokenService.accessToken.value!,
|
||||
>>>>>>>> develop:packages/chicken/lib/features/steward/presentation/pages/root/logic.dart
|
||||
),
|
||||
call: () async =>
|
||||
await commonRepository.getRolesProducts(token: tokenService.accessToken.value!),
|
||||
onSuccess: (result) {
|
||||
if (result != null) {
|
||||
rolesProductsModel.value = result;
|
||||
@@ -246,13 +196,8 @@ class StewardRootLogic extends GetxController {
|
||||
|
||||
Future<void> getStewardRemainWeightData() async {
|
||||
safeCall(
|
||||
<<<<<<<< HEAD:packages/chicken/lib/features/steward/root/logic.dart
|
||||
call: () async => await chickenRepository.getStewardRemainWeight(
|
||||
========
|
||||
call: () async => await stewardRepository.getStewardRemainWeight(
|
||||
>>>>>>>> develop:packages/chicken/lib/features/steward/presentation/pages/root/logic.dart
|
||||
token: tokenService.accessToken.value!,
|
||||
),
|
||||
call: () async =>
|
||||
await stewardRepository.getStewardRemainWeight(token: tokenService.accessToken.value!),
|
||||
onSuccess: (result) {
|
||||
if (result != null) {
|
||||
stewardRemainWeight.value = result;
|
||||
@@ -292,8 +237,7 @@ class StewardRootLogic extends GetxController {
|
||||
currentNestedKey?.currentState?.popUntil((route) => route.isFirst);
|
||||
} else {
|
||||
final now = DateTime.now();
|
||||
if (_lastBackPressed == null ||
|
||||
now.difference(_lastBackPressed!) > Duration(seconds: 2)) {
|
||||
if (_lastBackPressed == null || now.difference(_lastBackPressed!) > Duration(seconds: 2)) {
|
||||
_lastBackPressed = now;
|
||||
Get.snackbar(
|
||||
'خروج از برنامه',
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_chicken/chicken.dart';
|
||||
<<<<<<<< HEAD:packages/chicken/lib/features/steward/root/view.dart
|
||||
import 'package:rasadyar_chicken/data/models/response/kill_house_distribution_info/kill_house_distribution_info.dart';
|
||||
import 'package:rasadyar_chicken/features/steward/root/logic.dart';
|
||||
========
|
||||
import 'package:rasadyar_chicken/features/common/data/model/response/kill_house_distribution_info/kill_house_distribution_info.dart';
|
||||
import 'package:rasadyar_chicken/features/steward/presentation/pages/root/logic.dart';
|
||||
import 'package:rasadyar_chicken/features/steward/presentation/routes/routes.dart';
|
||||
>>>>>>>> develop:packages/chicken/lib/features/steward/presentation/pages/root/view.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';
|
||||
@@ -31,9 +27,8 @@ class StewardRootPage extends GetView<StewardRootLogic> {
|
||||
onGenerateRoute: (settings) {
|
||||
final page = ChickenPages.pages.firstWhere(
|
||||
(e) => e.name == settings.name,
|
||||
orElse: () => ChickenPages.pages.firstWhere(
|
||||
(e) => e.name == StewardRoutes.buySteward,
|
||||
),
|
||||
orElse: () =>
|
||||
ChickenPages.pages.firstWhere((e) => e.name == StewardRoutes.buySteward),
|
||||
);
|
||||
|
||||
return buildRouteFromGetPage(page);
|
||||
@@ -44,9 +39,8 @@ class StewardRootPage extends GetView<StewardRootLogic> {
|
||||
onGenerateRoute: (settings) {
|
||||
final page = ChickenPages.pages.firstWhere(
|
||||
(e) => e.name == settings.name,
|
||||
orElse: () => ChickenPages.pages.firstWhere(
|
||||
(e) => e.name == StewardRoutes.saleSteward,
|
||||
),
|
||||
orElse: () =>
|
||||
ChickenPages.pages.firstWhere((e) => e.name == StewardRoutes.saleSteward),
|
||||
);
|
||||
|
||||
return buildRouteFromGetPage(page);
|
||||
@@ -54,18 +48,15 @@ class StewardRootPage extends GetView<StewardRootLogic> {
|
||||
),
|
||||
Navigator(
|
||||
key: Get.nestedKey(stewardThirdKey),
|
||||
onGenerateRoute: (settings) =>
|
||||
GetPageRoute(page: () => controller.pages[2]),
|
||||
onGenerateRoute: (settings) => GetPageRoute(page: () => controller.pages[2]),
|
||||
),
|
||||
Navigator(
|
||||
key: Get.nestedKey(stewardFourthKey),
|
||||
onGenerateRoute: (settings) =>
|
||||
GetPageRoute(page: () => controller.pages[3]),
|
||||
onGenerateRoute: (settings) => GetPageRoute(page: () => controller.pages[3]),
|
||||
),
|
||||
Navigator(
|
||||
key: Get.nestedKey(stewardFifthKey),
|
||||
onGenerateRoute: (settings) =>
|
||||
GetPageRoute(page: () => controller.pages[4]),
|
||||
onGenerateRoute: (settings) => GetPageRoute(page: () => controller.pages[4]),
|
||||
),
|
||||
],
|
||||
index: data.value,
|
||||
@@ -161,10 +152,7 @@ class StewardRootPage extends GetView<StewardRootLogic> {
|
||||
return Container(
|
||||
height: 70,
|
||||
width: Get.width / 2,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(8)),
|
||||
clipBehavior: Clip.hardEdge,
|
||||
child: Row(
|
||||
children: [
|
||||
@@ -185,9 +173,7 @@ class StewardRootPage extends GetView<StewardRootLogic> {
|
||||
Text(
|
||||
'بارهای امروز',
|
||||
textAlign: TextAlign.right,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -254,9 +240,7 @@ class StewardRootPage extends GetView<StewardRootLogic> {
|
||||
Text(
|
||||
title,
|
||||
textAlign: TextAlign.right,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.mediumGreyDarkActive,
|
||||
),
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.mediumGreyDarkActive),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -279,16 +263,12 @@ class StewardRootPage extends GetView<StewardRootLogic> {
|
||||
Text(
|
||||
description,
|
||||
textAlign: TextAlign.right,
|
||||
style: AppFonts.yekan16.copyWith(
|
||||
color: AppColor.mediumGreyDarkActive,
|
||||
),
|
||||
style: AppFonts.yekan16.copyWith(color: AppColor.mediumGreyDarkActive),
|
||||
),
|
||||
Text(
|
||||
unit,
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan12.copyWith(
|
||||
color: AppColor.mediumGreyDarkActive,
|
||||
),
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.mediumGreyDarkActive),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -333,23 +313,17 @@ class StewardRootPage extends GetView<StewardRootLogic> {
|
||||
Text(
|
||||
title,
|
||||
textAlign: TextAlign.right,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.mediumGreyDarkActive,
|
||||
),
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.mediumGreyDarkActive),
|
||||
),
|
||||
Text(
|
||||
description,
|
||||
textAlign: TextAlign.right,
|
||||
style: AppFonts.yekan16.copyWith(
|
||||
color: AppColor.mediumGreyDarkActive,
|
||||
),
|
||||
style: AppFonts.yekan16.copyWith(color: AppColor.mediumGreyDarkActive),
|
||||
),
|
||||
Text(
|
||||
unit,
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan12.copyWith(
|
||||
color: AppColor.mediumGreyDarkActive,
|
||||
),
|
||||
style: AppFonts.yekan12.copyWith(color: AppColor.mediumGreyDarkActive),
|
||||
),
|
||||
],
|
||||
),
|
||||
@@ -397,18 +371,14 @@ class StewardRootPage extends GetView<StewardRootLogic> {
|
||||
padding: EdgeInsets.all(4),
|
||||
decoration: ShapeDecoration(
|
||||
color: const Color(0xFFBECDFF),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
|
||||
),
|
||||
child: Container(
|
||||
width: 40,
|
||||
height: 40,
|
||||
decoration: ShapeDecoration(
|
||||
color: AppColor.blueNormal,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
|
||||
),
|
||||
child: SvgGenImage.vec(iconPath).svg(
|
||||
width: 24,
|
||||
@@ -418,10 +388,7 @@ class StewardRootPage extends GetView<StewardRootLogic> {
|
||||
),
|
||||
),
|
||||
),
|
||||
Text(
|
||||
title,
|
||||
style: AppFonts.yekan10.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
Text(title, style: AppFonts.yekan10.copyWith(color: AppColor.blueNormal)),
|
||||
],
|
||||
);
|
||||
}
|
||||
@@ -438,24 +405,16 @@ class StewardRootPage extends GetView<StewardRootLogic> {
|
||||
padding: EdgeInsets.all(4),
|
||||
decoration: ShapeDecoration(
|
||||
color: const Color(0xFFD9F7F0),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
),
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(8)),
|
||||
),
|
||||
child: Assets.vec.messageAddSvg.svg(
|
||||
width: 40,
|
||||
height: 40,
|
||||
colorFilter: ColorFilter.mode(
|
||||
AppColor.greenNormal,
|
||||
BlendMode.srcIn,
|
||||
),
|
||||
colorFilter: ColorFilter.mode(AppColor.greenNormal, BlendMode.srcIn),
|
||||
fit: BoxFit.cover,
|
||||
),
|
||||
),
|
||||
Text(
|
||||
'افزودن',
|
||||
style: AppFonts.yekan10.copyWith(color: AppColor.greenDarkHover),
|
||||
),
|
||||
Text('افزودن', style: AppFonts.yekan10.copyWith(color: AppColor.greenDarkHover)),
|
||||
],
|
||||
);
|
||||
}
|
||||
@@ -602,9 +561,7 @@ class StewardRootPage extends GetView<StewardRootLogic> {
|
||||
child: Text(
|
||||
title,
|
||||
textAlign: TextAlign.right,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
),
|
||||
),
|
||||
Flexible(
|
||||
@@ -612,9 +569,7 @@ class StewardRootPage extends GetView<StewardRootLogic> {
|
||||
child: Text(
|
||||
value,
|
||||
textAlign: TextAlign.center,
|
||||
style: AppFonts.yekan14.copyWith(
|
||||
color: AppColor.darkGreyDarkHover,
|
||||
),
|
||||
style: AppFonts.yekan14.copyWith(color: AppColor.darkGreyDarkHover),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -640,9 +595,7 @@ class StewardRootPage extends GetView<StewardRootLogic> {
|
||||
Text(
|
||||
'اطلاعات ارسالی',
|
||||
textAlign: TextAlign.right,
|
||||
style: AppFonts.yekan16Bold.copyWith(
|
||||
color: AppColor.blueNormal,
|
||||
),
|
||||
style: AppFonts.yekan16Bold.copyWith(color: AppColor.blueNormal),
|
||||
),
|
||||
const SizedBox(height: 12),
|
||||
buildRow(
|
||||
|
||||
Reference in New Issue
Block a user