refactor : apply some analyze
This commit is contained in:
@@ -1,11 +1,5 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:rasadyar_chicken/chicken.dart';
|
|
||||||
import 'package:rasadyar_chicken/data/di/chicken_di.dart';
|
|
||||||
import 'package:rasadyar_core/core.dart';
|
import 'package:rasadyar_core/core.dart';
|
||||||
import 'package:rasadyar_inspection/injection/inspection_di.dart';
|
|
||||||
import 'package:rasadyar_inspection/inspection.dart';
|
|
||||||
import 'package:rasadyar_livestock/injection/live_stock_di.dart';
|
|
||||||
import 'package:rasadyar_livestock/presentation/routes/app_pages.dart';
|
|
||||||
|
|
||||||
class CustomNavigationObserver extends NavigatorObserver {
|
class CustomNavigationObserver extends NavigatorObserver {
|
||||||
bool _isWorkDone = false;
|
bool _isWorkDone = false;
|
||||||
@@ -17,7 +11,7 @@ class CustomNavigationObserver extends NavigatorObserver {
|
|||||||
@override
|
@override
|
||||||
void didPush(Route route, Route? previousRoute) async {
|
void didPush(Route route, Route? previousRoute) async {
|
||||||
final routeName = route.settings.name;
|
final routeName = route.settings.name;
|
||||||
/* if (!_isWorkDone && (routeName == ChickenRoutes.init || routeName == ChickenRoutes.auth)) {
|
/* if (!_isWorkDone && (routeName == ChickenRoutes.init || routeName == ChickenRoutes.auth)) {
|
||||||
_isWorkDone = true;
|
_isWorkDone = true;
|
||||||
await setupChickenDI();
|
await setupChickenDI();
|
||||||
} else if (!_isWorkDone &&
|
} else if (!_isWorkDone &&
|
||||||
@@ -30,7 +24,7 @@ class CustomNavigationObserver extends NavigatorObserver {
|
|||||||
|
|
||||||
}*/
|
}*/
|
||||||
super.didPush(route, previousRoute);
|
super.didPush(route, previousRoute);
|
||||||
// tLog('CustomNavigationObserver: didPush - $routeName');
|
// tLog('CustomNavigationObserver: didPush - $routeName');
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -42,12 +36,12 @@ class CustomNavigationObserver extends NavigatorObserver {
|
|||||||
@override
|
@override
|
||||||
void didPop(Route route, Route? previousRoute) {
|
void didPop(Route route, Route? previousRoute) {
|
||||||
super.didPop(route, previousRoute);
|
super.didPop(route, previousRoute);
|
||||||
// tLog('CustomNavigationObserver: didPop - ${route.settings.name}');
|
// tLog('CustomNavigationObserver: didPop - ${route.settings.name}');
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void didRemove(Route route, Route? previousRoute) {
|
void didRemove(Route route, Route? previousRoute) {
|
||||||
super.didRemove(route, previousRoute);
|
super.didRemove(route, previousRoute);
|
||||||
// tLog('CustomNavigationObserver: didRemove - ${route.settings.name}');
|
// tLog('CustomNavigationObserver: didRemove - ${route.settings.name}');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:rasadyar_core/core.dart' hide LinearGradient;
|
import 'package:rasadyar_core/core.dart';
|
||||||
|
|
||||||
import 'logic.dart';
|
import 'logic.dart';
|
||||||
|
|
||||||
class ModulesPage extends GetView<ModulesLogic> {
|
class ModulesPage extends GetView<ModulesLogic> {
|
||||||
|
|||||||
@@ -161,15 +161,14 @@ class InspectionPoultryScienceLogic extends GetxController {
|
|||||||
Future<void> submitInspectionReport({required int id}) async {
|
Future<void> submitInspectionReport({required int id}) async {
|
||||||
isOnUpload.value = true;
|
isOnUpload.value = true;
|
||||||
|
|
||||||
DioFormData formData = DioFormData();
|
var tmpFiles = [];
|
||||||
var ls = [];
|
|
||||||
|
|
||||||
for (var element in pickedImages) {
|
for (var element in pickedImages) {
|
||||||
ls.add(await MultipartFile.fromFile(element.path, filename: element.name));
|
tmpFiles.add(await MultipartFile.fromFile(element.path, filename: element.name));
|
||||||
}
|
}
|
||||||
|
|
||||||
var data = FormData.fromMap({
|
var data = FormData.fromMap({
|
||||||
'file': ls,
|
'file': tmpFiles,
|
||||||
'hatching_id': id.toString(),
|
'hatching_id': id.toString(),
|
||||||
'lat': currentLocation.value.latitude.toString(),
|
'lat': currentLocation.value.latitude.toString(),
|
||||||
'log': currentLocation.value.longitude.toString(),
|
'log': currentLocation.value.longitude.toString(),
|
||||||
|
|||||||
@@ -132,11 +132,11 @@ class InspectionPoultrySciencePage extends GetView<InspectionPoultryScienceLogic
|
|||||||
buildRow(title: 'شماره مجوز جوجه ریزی', value: item.licenceNumber ?? 'N/A'),
|
buildRow(title: 'شماره مجوز جوجه ریزی', value: item.licenceNumber ?? 'N/A'),
|
||||||
buildRow(
|
buildRow(
|
||||||
title: 'حجم جوجه ریزی',
|
title: 'حجم جوجه ریزی',
|
||||||
value: item.quantity.separatedByComma ?? 'N/A',
|
value: item.quantity.separatedByComma,
|
||||||
valueStyle: AppFonts.yekan14.copyWith(color: AppColor.blueNormal),
|
valueStyle: AppFonts.yekan14.copyWith(color: AppColor.blueNormal),
|
||||||
),
|
),
|
||||||
buildRow(title: 'مانده در سالن', value: item.leftOver.separatedByComma ?? 'N/A'),
|
buildRow(title: 'مانده در سالن', value: item.leftOver.separatedByComma ),
|
||||||
buildRow(title: 'تلفات', value: item.losses.separatedByComma ?? 'N/A'),
|
buildRow(title: 'تلفات', value: item.losses.separatedByComma ),
|
||||||
buildRow(
|
buildRow(
|
||||||
title: 'دامپزشک فارم',
|
title: 'دامپزشک فارم',
|
||||||
value: '${item.vetFarm?.vetFarmFullName}(${item.vetFarm?.vetFarmMobile})',
|
value: '${item.vetFarm?.vetFarmFullName}(${item.vetFarm?.vetFarmMobile})',
|
||||||
@@ -152,7 +152,7 @@ class InspectionPoultrySciencePage extends GetView<InspectionPoultryScienceLogic
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
Visibility(
|
Visibility(
|
||||||
visible: (item.reportInfo?.image == false ?? false),
|
visible: (item.reportInfo?.image == false),
|
||||||
child: RElevated(
|
child: RElevated(
|
||||||
text: 'ثبت بازرسی',
|
text: 'ثبت بازرسی',
|
||||||
isFullWidth: true,
|
isFullWidth: true,
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:rasadyar_chicken/presentation/pages/role/view.dart';
|
import 'package:rasadyar_chicken/presentation/widget/app_bar.dart';
|
||||||
import 'package:rasadyar_core/core.dart';
|
import 'package:rasadyar_core/core.dart';
|
||||||
|
|
||||||
import '../../../widget/app_bar.dart';
|
|
||||||
import 'logic.dart';
|
import 'logic.dart';
|
||||||
|
|
||||||
class PoultryActionPage extends GetView<PoultryActionLogic> {
|
class PoultryActionPage extends GetView<PoultryActionLogic> {
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ Future<void> setupAllCoreProvider() async {
|
|||||||
await diCore.allReady();
|
await diCore.allReady();
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _setUpLogger() async {}
|
|
||||||
|
|
||||||
Future<void> _setupLocalStorage() async {
|
Future<void> _setupLocalStorage() async {
|
||||||
var localStorage = diCore.registerSingleton<HiveLocalStorage>(HiveLocalStorage());
|
var localStorage = diCore.registerSingleton<HiveLocalStorage>(HiveLocalStorage());
|
||||||
|
|||||||
Reference in New Issue
Block a user