fix :
1 - multi module in Auth select save selected module 2 - add flutter gen for assets builder
This commit is contained in:
@@ -3,6 +3,7 @@ import 'dart:async';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:rasadyar_auth/auth.dart';
|
||||
import 'package:rasadyar_auth/data/common/dio_error_handler.dart';
|
||||
import 'package:rasadyar_auth/data/models/local/module/module_model.dart';
|
||||
import 'package:rasadyar_auth/data/models/request/login_request/login_request_model.dart';
|
||||
import 'package:rasadyar_auth/data/models/response/auth/auth_response_model.dart';
|
||||
import 'package:rasadyar_auth/data/repositories/auth_repository_imp.dart';
|
||||
@@ -10,6 +11,8 @@ import 'package:rasadyar_auth/data/services/token_storage_service.dart';
|
||||
import 'package:rasadyar_auth/presentation/widget/captcha/logic.dart';
|
||||
import 'package:rasadyar_core/core.dart';
|
||||
|
||||
import '../../../data/models/local/user_local/user_local_model.dart';
|
||||
|
||||
enum AuthType { useAndPass, otp }
|
||||
|
||||
enum AuthStatus { init }
|
||||
@@ -42,6 +45,8 @@ class AuthLogic extends GetxController {
|
||||
|
||||
AuthRepositoryImpl authRepository = diAuth.get<AuthRepositoryImpl>();
|
||||
|
||||
final Module _module = Get.arguments;
|
||||
|
||||
void startTimer() {
|
||||
_timer?.cancel();
|
||||
secondsRemaining.value = 120;
|
||||
@@ -73,8 +78,8 @@ class AuthLogic extends GetxController {
|
||||
|
||||
@override
|
||||
void onReady() {
|
||||
// TODO: implement onReady
|
||||
super.onReady();
|
||||
iLog('module111 : ${_module.toString()}');
|
||||
}
|
||||
|
||||
@override
|
||||
@@ -106,14 +111,16 @@ class AuthLogic extends GetxController {
|
||||
|
||||
Future<void> submitLoginForm() async {
|
||||
if (!_isFormValid()) return;
|
||||
|
||||
iLog('module222 : ${_module.toString()}');
|
||||
final loginRequestModel = _buildLoginRequest();
|
||||
isLoading.value = true;
|
||||
await safeCall<AuthResponseModel?>(
|
||||
call: () => authRepository.login(authRequest: loginRequestModel.toJson()),
|
||||
onSuccess: (result) async {
|
||||
await tokenStorageService.saveRefreshToken(result!.refresh!);
|
||||
await tokenStorageService.saveAccessToken(result!.access!);
|
||||
await tokenStorageService.saveModule(_module);
|
||||
await tokenStorageService.saveRefreshToken(result?.refresh ?? '');
|
||||
await tokenStorageService.saveAccessToken(result?.access ?? '');
|
||||
|
||||
//Get.offAndToNamed(Routes.home);
|
||||
},
|
||||
onError: (error, stackTrace) {
|
||||
|
||||
@@ -109,7 +109,10 @@ class AuthPage extends GetView<AuthLogic> {
|
||||
},
|
||||
prefixIcon: Padding(
|
||||
padding: const EdgeInsets.fromLTRB(0, 8, 6, 8),
|
||||
child: vecWidget(Assets.vecCallSvg),
|
||||
child: Assets.vec.callSvg.svg(
|
||||
width: 12,
|
||||
height: 12,
|
||||
),
|
||||
),
|
||||
suffixIcon:
|
||||
phoneController.value.text
|
||||
@@ -168,7 +171,10 @@ class AuthPage extends GetView<AuthLogic> {
|
||||
labelStyle: AppFonts.yekan13,
|
||||
prefixIcon: Padding(
|
||||
padding: const EdgeInsets.fromLTRB(0, 8, 8, 8),
|
||||
child: vecWidget(Assets.vecKeySvg),
|
||||
child: Assets.vec.keySvg.svg(
|
||||
width: 12,
|
||||
height: 12,
|
||||
),
|
||||
),
|
||||
boxConstraints: const BoxConstraints(
|
||||
maxHeight: 34,
|
||||
|
||||
Reference in New Issue
Block a user