fix : chicken app login and new module logic
This commit is contained in:
@@ -17,7 +17,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 &&
|
||||||
@@ -28,7 +28,7 @@ class CustomNavigationObserver extends NavigatorObserver {
|
|||||||
} else if (!_isWorkDone &&
|
} else if (!_isWorkDone &&
|
||||||
(routeName == LiveStockRoutes.init || routeName == LiveStockRoutes.auth)) {
|
(routeName == LiveStockRoutes.init || routeName == LiveStockRoutes.auth)) {
|
||||||
|
|
||||||
}
|
}*/
|
||||||
super.didPush(route, previousRoute);
|
super.didPush(route, previousRoute);
|
||||||
// tLog('CustomNavigationObserver: didPush - $routeName');
|
// tLog('CustomNavigationObserver: didPush - $routeName');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,21 +28,20 @@ class ModulesLogic extends GetxController {
|
|||||||
tokenService.appModule.value = module;
|
tokenService.appModule.value = module;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void onTapCard(Module module, int index) async {
|
||||||
|
isLoading.value = !isLoading.value;
|
||||||
|
selectedIndex.value = index;
|
||||||
|
await Future.delayed(Duration(milliseconds: 200)); // Simulate loading delay
|
||||||
|
navigateToModule(module);
|
||||||
|
}
|
||||||
|
|
||||||
Future<void> navigateToModule(Module module) async {
|
Future<void> navigateToModule(Module module) async {
|
||||||
var target = getTargetPage(module).entries.first;
|
var target = getAuthTargetPage(module).entries.first;
|
||||||
|
|
||||||
if (target.value != null) {
|
if (target.value != null) {
|
||||||
await target.value;
|
await target.value;
|
||||||
}
|
}
|
||||||
|
isLoading.value = !isLoading.value;
|
||||||
Get.offAllNamed(target.key);
|
Get.toNamed(target.key, arguments: module);
|
||||||
}
|
|
||||||
|
|
||||||
void onTapCard(Module module, int index) async {
|
|
||||||
isLoading.value = true;
|
|
||||||
selectedIndex.value = index;
|
|
||||||
saveModule(module);
|
|
||||||
await Future.delayed(Duration(milliseconds: 500)); // Simulate loading delay
|
|
||||||
navigateToModule(module);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -154,7 +154,7 @@ class SplashLogic extends GetxController with GetTickerProviderStateMixin {
|
|||||||
if (isUpdateNeeded) return;
|
if (isUpdateNeeded) return;
|
||||||
tokenService.getModule();
|
tokenService.getModule();
|
||||||
final module = tokenService.appModule.value;
|
final module = tokenService.appModule.value;
|
||||||
final target = getTargetPage(module);
|
final target = getTargetModule(module);
|
||||||
if (target.values.first != null) {
|
if (target.values.first != null) {
|
||||||
await target.values.first;
|
await target.values.first;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import 'package:rasadyar_app/presentation/pages/system_design/system_design.dart
|
|||||||
import 'package:rasadyar_chicken/chicken.dart';
|
import 'package:rasadyar_chicken/chicken.dart';
|
||||||
import 'package:rasadyar_chicken/data/di/chicken_di.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_inspection/inspection.dart';
|
||||||
import 'package:rasadyar_livestock/injection/live_stock_di.dart';
|
import 'package:rasadyar_livestock/injection/live_stock_di.dart';
|
||||||
import 'package:rasadyar_livestock/presentation/routes/app_pages.dart';
|
import 'package:rasadyar_livestock/presentation/routes/app_pages.dart';
|
||||||
@@ -40,14 +41,28 @@ sealed class AppPages {
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, Future<void>?> getTargetPage(Module? value) {
|
|
||||||
|
Map<String, Future<void>?> getTargetModule(Module? value) {
|
||||||
switch (value) {
|
switch (value) {
|
||||||
case Module.inspection:
|
case Module.inspection:
|
||||||
return {InspectionRoutes.init:null};
|
return {InspectionRoutes.init:setupInspectionDI()};
|
||||||
case Module.liveStocks:
|
case Module.liveStocks:
|
||||||
return {LiveStockRoutes.init: setupLiveStockDI()};
|
return {LiveStockRoutes.init: setupLiveStockDI()};
|
||||||
case Module.chicken:
|
case Module.chicken:
|
||||||
return {ChickenRoutes.init : null};
|
return {ChickenRoutes.init : setupChickenDI()};
|
||||||
|
default:
|
||||||
|
return {AppPaths.moduleList : null};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, Future<void>?> getAuthTargetPage(Module? value) {
|
||||||
|
switch (value) {
|
||||||
|
case Module.inspection:
|
||||||
|
return {InspectionRoutes.auth:setupInspectionDI()};
|
||||||
|
case Module.liveStocks:
|
||||||
|
return {LiveStockRoutes.auth: setupLiveStockDI()};
|
||||||
|
case Module.chicken:
|
||||||
|
return {ChickenRoutes.auth : setupChickenDI()};
|
||||||
default:
|
default:
|
||||||
return {AppPaths.moduleList : null};
|
return {AppPaths.moduleList : null};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,6 @@ class ChickenRemoteDatasourceImp implements ChickenRemoteDatasource {
|
|||||||
required String token,
|
required String token,
|
||||||
CancelToken? cancelToken,
|
CancelToken? cancelToken,
|
||||||
}) async {
|
}) async {
|
||||||
eLog(_httpClient.baseUrl);
|
|
||||||
var res = await _httpClient.get(
|
var res = await _httpClient.get(
|
||||||
'/roles-products/?role=Steward',
|
'/roles-products/?role=Steward',
|
||||||
headers: {'Authorization': 'Bearer $token'},
|
headers: {'Authorization': 'Bearer $token'},
|
||||||
|
|||||||
@@ -1,19 +1,27 @@
|
|||||||
import 'package:rasadyar_chicken/chicken.dart';
|
import 'package:rasadyar_chicken/chicken.dart';
|
||||||
import 'package:rasadyar_chicken/data/common/dio_error_handler.dart';
|
import 'package:rasadyar_chicken/data/common/dio_error_handler.dart';
|
||||||
|
import 'package:rasadyar_chicken/data/data_source/local/chicken_local.dart';
|
||||||
|
import 'package:rasadyar_chicken/data/data_source/local/chicken_local_imp.dart';
|
||||||
import 'package:rasadyar_chicken/data/data_source/remote/auth/auth_remote.dart';
|
import 'package:rasadyar_chicken/data/data_source/remote/auth/auth_remote.dart';
|
||||||
import 'package:rasadyar_chicken/data/data_source/remote/auth/auth_remote_imp.dart';
|
import 'package:rasadyar_chicken/data/data_source/remote/auth/auth_remote_imp.dart';
|
||||||
|
import 'package:rasadyar_chicken/data/data_source/remote/chicken/chicken_remote.dart';
|
||||||
|
import 'package:rasadyar_chicken/data/data_source/remote/chicken/chicken_remote_imp.dart';
|
||||||
|
import 'package:rasadyar_chicken/data/repositories/auth/auth_repository.dart';
|
||||||
import 'package:rasadyar_chicken/data/repositories/auth/auth_repository_imp.dart';
|
import 'package:rasadyar_chicken/data/repositories/auth/auth_repository_imp.dart';
|
||||||
|
import 'package:rasadyar_chicken/data/repositories/chicken/chicken_repository.dart';
|
||||||
|
import 'package:rasadyar_chicken/data/repositories/chicken/chicken_repository_imp.dart';
|
||||||
import 'package:rasadyar_core/core.dart';
|
import 'package:rasadyar_core/core.dart';
|
||||||
|
|
||||||
GetIt diChicken = GetIt.instance;
|
GetIt diChicken = GetIt.instance;
|
||||||
|
|
||||||
Future<void> setupChickenDI() async {
|
Future<void> setupChickenDI() async {
|
||||||
|
tLog("setup 1");
|
||||||
diChicken.registerSingleton(DioErrorHandler());
|
diChicken.registerSingleton(DioErrorHandler());
|
||||||
var tokenService = Get.find<TokenStorageService>();
|
var tokenService = Get.find<TokenStorageService>();
|
||||||
|
|
||||||
diChicken.registerLazySingleton<AppInterceptor>(
|
diChicken.registerLazySingleton<AppInterceptor>(
|
||||||
() => AppInterceptor(
|
() => AppInterceptor(
|
||||||
//فعلا سامانه مرغ برای رفرش توکن چیزی ندارد
|
// سامانه مرغ فعلاً رفرش توکن ندارد
|
||||||
refreshTokenCallback: () async => null,
|
refreshTokenCallback: () async => null,
|
||||||
saveTokenCallback: (String newToken) async {
|
saveTokenCallback: (String newToken) async {
|
||||||
await tokenService.saveAccessToken(newToken);
|
await tokenService.saveAccessToken(newToken);
|
||||||
@@ -26,24 +34,43 @@ Future<void> setupChickenDI() async {
|
|||||||
instanceName: 'chickenInterceptor',
|
instanceName: 'chickenInterceptor',
|
||||||
);
|
);
|
||||||
|
|
||||||
|
var baseUrl = tokenService.baseurl.value;
|
||||||
|
|
||||||
diChicken.registerLazySingleton<DioRemote>(
|
diChicken.registerLazySingleton<DioRemote>(
|
||||||
() =>
|
() => DioRemote(
|
||||||
DioRemote(interceptors: diChicken.get<AppInterceptor>(instanceName: 'chickenInterceptor')),
|
baseUrl: baseUrl,
|
||||||
|
interceptors: diChicken.get<AppInterceptor>(instanceName: 'chickenInterceptor'),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
|
|
||||||
final dioRemote = diChicken.get<DioRemote>();
|
final dioRemote = diChicken.get<DioRemote>();
|
||||||
await dioRemote.init();
|
await dioRemote.init();
|
||||||
|
|
||||||
diChicken.registerLazySingleton<AuthRemoteDataSourceImp>(
|
diChicken.registerLazySingleton<AuthRemoteDataSource>(
|
||||||
() => AuthRemoteDataSourceImp(diChicken.get<DioRemote>()),
|
() => AuthRemoteDataSourceImp(diChicken.get<DioRemote>()),
|
||||||
);
|
);
|
||||||
|
|
||||||
diChicken.registerLazySingleton<AuthRepositoryImpl>(
|
diChicken.registerLazySingleton<AuthRepository>(
|
||||||
() => AuthRepositoryImpl(diChicken.get<AuthRemoteDataSourceImp>()),
|
() => AuthRepositoryImpl(diChicken.get<AuthRemoteDataSource>()),
|
||||||
|
instanceName: 'oldRepo',
|
||||||
|
);
|
||||||
|
|
||||||
|
diChicken.registerLazySingleton<ChickenRemoteDatasource>(
|
||||||
|
() => ChickenRemoteDatasourceImp(diChicken.get<DioRemote>()),
|
||||||
|
);
|
||||||
|
|
||||||
|
diChicken.registerLazySingleton<ChickenLocalDataSource>(() => ChickenLocalDataSourceImp());
|
||||||
|
|
||||||
|
diChicken.registerLazySingleton<ChickenRepository>(
|
||||||
|
() => ChickenRepositoryImp(
|
||||||
|
remote: diChicken.get<ChickenRemoteDatasource>(),
|
||||||
|
local: diChicken.get<ChickenLocalDataSource>(),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> newSetupAuthDI(String newUrl) async {
|
Future<void> newSetupAuthDI(String newUrl) async {
|
||||||
|
tLog("setup 2");
|
||||||
var tokenService = Get.find<TokenStorageService>();
|
var tokenService = Get.find<TokenStorageService>();
|
||||||
if (tokenService.baseurl.value == null) {
|
if (tokenService.baseurl.value == null) {
|
||||||
await tokenService.saveBaseUrl(newUrl);
|
await tokenService.saveBaseUrl(newUrl);
|
||||||
@@ -52,7 +79,10 @@ Future<void> newSetupAuthDI(String newUrl) async {
|
|||||||
if (diChicken.isRegistered<DioRemote>()) {
|
if (diChicken.isRegistered<DioRemote>()) {
|
||||||
await diChicken.unregister<DioRemote>();
|
await diChicken.unregister<DioRemote>();
|
||||||
diChicken.registerLazySingleton<DioRemote>(
|
diChicken.registerLazySingleton<DioRemote>(
|
||||||
() => DioRemote(baseUrl: newUrl, interceptors: diChicken.get<AppInterceptor>()),
|
() => DioRemote(
|
||||||
|
baseUrl: newUrl,
|
||||||
|
interceptors: diChicken.get<AppInterceptor>(instanceName: 'chickenInterceptor'),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
final dioRemote = diChicken.get<DioRemote>();
|
final dioRemote = diChicken.get<DioRemote>();
|
||||||
await dioRemote.init();
|
await dioRemote.init();
|
||||||
@@ -60,15 +90,38 @@ Future<void> newSetupAuthDI(String newUrl) async {
|
|||||||
|
|
||||||
if (diChicken.isRegistered<AuthRemoteDataSource>()) {
|
if (diChicken.isRegistered<AuthRemoteDataSource>()) {
|
||||||
await diChicken.unregister<AuthRemoteDataSource>();
|
await diChicken.unregister<AuthRemoteDataSource>();
|
||||||
diChicken.registerLazySingleton<AuthRemoteDataSourceImp>(
|
diChicken.registerLazySingleton<AuthRemoteDataSource>(
|
||||||
() => AuthRemoteDataSourceImp(diChicken.get<DioRemote>()),
|
() => AuthRemoteDataSourceImp(diChicken.get<DioRemote>()),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (diChicken.isRegistered<AuthRepositoryImpl>()) {
|
if (diChicken.isRegistered<AuthRepository>(instanceName: 'oldRepo')) {
|
||||||
await diChicken.unregister<AuthRepositoryImpl>();
|
await diChicken.unregister<AuthRepository>(instanceName: 'oldRepo');
|
||||||
diChicken.registerLazySingleton<AuthRepositoryImpl>(
|
diChicken.registerLazySingleton<AuthRepository>(
|
||||||
() => AuthRepositoryImpl(diChicken.get<AuthRemoteDataSource>()),
|
() => AuthRepositoryImpl(diChicken.get<AuthRemoteDataSource>()),
|
||||||
|
instanceName: 'newRepo',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (diChicken.isRegistered<ChickenRemoteDatasource>()) {
|
||||||
|
await diChicken.unregister<ChickenRemoteDatasource>();
|
||||||
|
diChicken.registerLazySingleton<ChickenRemoteDatasource>(
|
||||||
|
() => ChickenRemoteDatasourceImp(diChicken.get<DioRemote>()),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (diChicken.isRegistered<ChickenLocalDataSource>()) {
|
||||||
|
await diChicken.unregister<ChickenLocalDataSource>();
|
||||||
|
diChicken.registerLazySingleton<ChickenLocalDataSource>(() => ChickenLocalDataSourceImp());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (diChicken.isRegistered<ChickenRepository>()) {
|
||||||
|
await diChicken.unregister<ChickenRepository>();
|
||||||
|
diChicken.registerLazySingleton<ChickenRepository>(
|
||||||
|
() => ChickenRepositoryImp(
|
||||||
|
remote: diChicken.get<ChickenRemoteDatasource>(),
|
||||||
|
local: diChicken.get<ChickenLocalDataSource>(),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import 'package:rasadyar_chicken/data/data_source/local/chicken_local_imp.dart';
|
import 'package:rasadyar_chicken/data/data_source/local/chicken_local.dart';
|
||||||
import 'package:rasadyar_chicken/data/data_source/remote/chicken/chicken_remote_imp.dart';
|
import 'package:rasadyar_chicken/data/data_source/remote/chicken/chicken_remote.dart';
|
||||||
import 'package:rasadyar_chicken/data/models/local/widely_used_local_model.dart';
|
import 'package:rasadyar_chicken/data/models/local/widely_used_local_model.dart';
|
||||||
import 'package:rasadyar_chicken/data/models/request/change_password/change_password_request_model.dart';
|
import 'package:rasadyar_chicken/data/models/request/change_password/change_password_request_model.dart';
|
||||||
import 'package:rasadyar_chicken/data/models/request/conform_allocation/conform_allocation.dart';
|
import 'package:rasadyar_chicken/data/models/request/conform_allocation/conform_allocation.dart';
|
||||||
@@ -29,8 +29,8 @@ import 'package:rasadyar_core/core.dart';
|
|||||||
import 'chicken_repository.dart';
|
import 'chicken_repository.dart';
|
||||||
|
|
||||||
class ChickenRepositoryImp implements ChickenRepository {
|
class ChickenRepositoryImp implements ChickenRepository {
|
||||||
final ChickenRemoteDatasourceImp remote;
|
final ChickenRemoteDatasource remote;
|
||||||
final ChickenLocalDataSourceImp local;
|
final ChickenLocalDataSource local;
|
||||||
|
|
||||||
ChickenRepositoryImp({required this.remote, required this.local});
|
ChickenRepositoryImp({required this.remote, required this.local});
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:rasadyar_chicken/chicken.dart';
|
||||||
import 'package:rasadyar_chicken/data/common/dio_error_handler.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/di/chicken_di.dart';
|
||||||
import 'package:rasadyar_chicken/data/models/request/login_request/login_request_model.dart';
|
import 'package:rasadyar_chicken/data/models/request/login_request/login_request_model.dart';
|
||||||
import 'package:rasadyar_chicken/data/models/response/user_info/user_info_model.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/models/response/user_profile_model/user_profile_model.dart';
|
||||||
import 'package:rasadyar_chicken/data/repositories/auth/auth_repository_imp.dart';
|
import 'package:rasadyar_chicken/data/repositories/auth/auth_repository.dart';
|
||||||
import 'package:rasadyar_chicken/presentation/widget/captcha/logic.dart';
|
import 'package:rasadyar_chicken/presentation/widget/captcha/logic.dart';
|
||||||
import 'package:rasadyar_core/core.dart';
|
import 'package:rasadyar_core/core.dart';
|
||||||
|
|
||||||
@@ -44,7 +45,7 @@ class AuthLogic extends GetxController with GetTickerProviderStateMixin {
|
|||||||
RxInt secondsRemaining = 120.obs;
|
RxInt secondsRemaining = 120.obs;
|
||||||
Timer? _timer;
|
Timer? _timer;
|
||||||
|
|
||||||
AuthRepositoryImpl authRepository = diChicken.get<AuthRepositoryImpl>();
|
AuthRepository authRepository = diChicken.get<AuthRepository>(instanceName: 'oldRepo');
|
||||||
|
|
||||||
final Module _module = Get.arguments;
|
final Module _module = Get.arguments;
|
||||||
|
|
||||||
@@ -64,7 +65,6 @@ class AuthLogic extends GetxController with GetTickerProviderStateMixin {
|
|||||||
@override
|
@override
|
||||||
void onReady() {
|
void onReady() {
|
||||||
super.onReady();
|
super.onReady();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -118,7 +118,7 @@ class AuthLogic extends GetxController with GetTickerProviderStateMixin {
|
|||||||
|
|
||||||
Future<void> submitLoginForm() async {
|
Future<void> submitLoginForm() async {
|
||||||
if (!_isFormValid()) return;
|
if (!_isFormValid()) return;
|
||||||
AuthRepositoryImpl authTmp = diChicken.get<AuthRepositoryImpl>(instanceName: 'newUrl');
|
AuthRepository authTmp = diChicken.get<AuthRepository>(instanceName: 'newRepo');
|
||||||
isLoading.value = true;
|
isLoading.value = true;
|
||||||
await safeCall<UserProfileModel?>(
|
await safeCall<UserProfileModel?>(
|
||||||
call: () => authTmp.login(
|
call: () => authTmp.login(
|
||||||
@@ -131,6 +131,7 @@ class AuthLogic extends GetxController with GetTickerProviderStateMixin {
|
|||||||
await tokenStorageService.saveModule(_module);
|
await tokenStorageService.saveModule(_module);
|
||||||
await tokenStorageService.saveAccessToken(result?.accessToken ?? '');
|
await tokenStorageService.saveAccessToken(result?.accessToken ?? '');
|
||||||
await tokenStorageService.saveRefreshToken(result?.accessToken ?? '');
|
await tokenStorageService.saveRefreshToken(result?.accessToken ?? '');
|
||||||
|
Get.offAndToNamed(ChickenRoutes.init);
|
||||||
},
|
},
|
||||||
onError: (error, stackTrace) {
|
onError: (error, stackTrace) {
|
||||||
if (error is DioException) {
|
if (error is DioException) {
|
||||||
|
|||||||
@@ -13,31 +13,34 @@ class AuthPage extends GetView<AuthLogic> {
|
|||||||
return Scaffold(
|
return Scaffold(
|
||||||
body: Stack(
|
body: Stack(
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
|
fit: StackFit.expand,
|
||||||
|
|
||||||
children: [
|
children: [
|
||||||
Assets.vec.bgAuthSvg.svg(fit: BoxFit.fill),
|
Assets.vec.bgAuthSvg.svg(fit: BoxFit.fill),
|
||||||
|
|
||||||
Padding(
|
Center(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 10.r),
|
child: Padding(
|
||||||
child: FadeTransition(
|
padding: EdgeInsets.symmetric(horizontal: 10.r),
|
||||||
opacity: controller.textAnimation,
|
child: FadeTransition(
|
||||||
child: Column(
|
opacity: controller.textAnimation,
|
||||||
mainAxisSize: MainAxisSize.min,
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.start,
|
mainAxisSize: MainAxisSize.min,
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
spacing: 12,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
spacing: 12,
|
||||||
Text(
|
children: [
|
||||||
'به سامانه رصدیار خوش آمدید!',
|
Text(
|
||||||
textAlign: TextAlign.right,
|
'به سامانه رصدیار خوش آمدید!',
|
||||||
style: AppFonts.yekan25Bold.copyWith(color: Colors.white),
|
textAlign: TextAlign.right,
|
||||||
),
|
style: AppFonts.yekan25Bold.copyWith(color: Colors.white),
|
||||||
Text(
|
),
|
||||||
'سامانه رصد و پایش زنجیره تامین، تولید و توزیع کالا های اساسی',
|
Text(
|
||||||
textAlign: TextAlign.center,
|
'سامانه رصد و پایش زنجیره تامین، تولید و توزیع کالا های اساسی',
|
||||||
style: AppFonts.yekan16.copyWith(color: Colors.white),
|
textAlign: TextAlign.center,
|
||||||
),
|
style: AppFonts.yekan16.copyWith(color: Colors.white),
|
||||||
],
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import 'dart:async';
|
import 'dart:async';
|
||||||
|
|
||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
|
import 'package:rasadyar_chicken/data/data_source/local/chicken_local.dart';
|
||||||
import 'package:rasadyar_chicken/data/data_source/local/chicken_local_imp.dart';
|
import 'package:rasadyar_chicken/data/data_source/local/chicken_local_imp.dart';
|
||||||
import 'package:rasadyar_chicken/data/di/chicken_di.dart';
|
import 'package:rasadyar_chicken/data/di/chicken_di.dart';
|
||||||
import 'package:rasadyar_chicken/data/models/local/widely_used_local_model.dart';
|
import 'package:rasadyar_chicken/data/models/local/widely_used_local_model.dart';
|
||||||
@@ -32,7 +33,7 @@ class RootLogic extends GetxController {
|
|||||||
late DioRemote dioRemote;
|
late DioRemote dioRemote;
|
||||||
var tokenService = Get.find<TokenStorageService>();
|
var tokenService = Get.find<TokenStorageService>();
|
||||||
late ChickenRepository chickenRepository;
|
late ChickenRepository chickenRepository;
|
||||||
late ChickenLocalDataSourceImp localDatasource;
|
late ChickenLocalDataSource localDatasource;
|
||||||
|
|
||||||
RxList<ErrorLocationType> errorLocationType = RxList();
|
RxList<ErrorLocationType> errorLocationType = RxList();
|
||||||
RxMap<int, dynamic> inventoryExpandedList = RxMap();
|
RxMap<int, dynamic> inventoryExpandedList = RxMap();
|
||||||
@@ -46,8 +47,9 @@ class RootLogic extends GetxController {
|
|||||||
@override
|
@override
|
||||||
void onInit() {
|
void onInit() {
|
||||||
super.onInit();
|
super.onInit();
|
||||||
localDatasource = diChicken.get<ChickenLocalDataSourceImp>();
|
localDatasource = diChicken.get<ChickenLocalDataSource>();
|
||||||
chickenRepository = diChicken.get<ChickenRepositoryImp>();
|
chickenRepository = diChicken.get<ChickenRepository>();
|
||||||
|
|
||||||
localDatasource.openBox().then((value) async {
|
localDatasource.openBox().then((value) async {
|
||||||
widelyUsedList.value = localDatasource.getAllWidely();
|
widelyUsedList.value = localDatasource.getAllWidely();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -56,9 +56,11 @@ class TokenStorageService extends GetxService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Future<void> saveModule(Module input) async {
|
Future<void> saveModule(Module input) async {
|
||||||
|
eLog("before saveModule = ${appModule.value} ==> $input");
|
||||||
await _localStorage.save(boxName: _tokenBoxName, key: _moduleKey, value: input);
|
await _localStorage.save(boxName: _tokenBoxName, key: _moduleKey, value: input);
|
||||||
appModule.value = input;
|
appModule.value = input;
|
||||||
appModule.refresh();
|
appModule.refresh();
|
||||||
|
eLog("after saveModule = ${appModule.value} ==> $input");
|
||||||
}
|
}
|
||||||
|
|
||||||
Module? getModule() {
|
Module? getModule() {
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ class DioRemote implements IHttpClient {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Future<void> init() async {
|
Future<void> init() async {
|
||||||
|
fLog(baseUrl);
|
||||||
dio = Dio(BaseOptions(baseUrl: baseUrl ?? ''));
|
dio = Dio(BaseOptions(baseUrl: baseUrl ?? ''));
|
||||||
if (interceptors != null) {
|
if (interceptors != null) {
|
||||||
interceptors!.dio = dio;
|
interceptors!.dio = dio;
|
||||||
|
|||||||
@@ -16,13 +16,6 @@ class MapWidget extends GetView<MapWidgetLogic> {
|
|||||||
fit: StackFit.expand,
|
fit: StackFit.expand,
|
||||||
children: [
|
children: [
|
||||||
|
|
||||||
Positioned(
|
|
||||||
top: 10,
|
|
||||||
right: 0,
|
|
||||||
left: 0,
|
|
||||||
child: RMarquee(text: "This is scrolling text from right to left..."),
|
|
||||||
),
|
|
||||||
|
|
||||||
|
|
||||||
ObxValue((errorType) {
|
ObxValue((errorType) {
|
||||||
if (errorType.isNotEmpty) {
|
if (errorType.isNotEmpty) {
|
||||||
|
|||||||
Reference in New Issue
Block a user