repair back button

This commit is contained in:
kicap
2023-08-10 01:21:43 +08:00
parent 696c52efeb
commit 6c5bfde828
29 changed files with 956 additions and 845 deletions

View File

@ -40,7 +40,7 @@ class InputInformasiDiriView extends StatelessWidget {
),
body: WillPopScope(
onWillPop: () async {
if (model.easyLoading.backPressed == 1) {
if (model.globalVar.backPressed == 'backNormal') {
model.navigationService.navigateToMasukanNoHpView();
}
return false;

View File

@ -33,13 +33,13 @@ class InputInformasiDiriViewModel extends CustomBaseViewModel {
}
goToLogin() async {
easyLoading.backPressed = 0;
globalVar.backPressed = 'cantBack';
easyLoading.customLoading("Mendaftarkan Akun Anda");
await Future.delayed(const Duration(seconds: 2));
easyLoading.customLoading("Ke Halaman Login");
await Future.delayed(const Duration(seconds: 2));
easyLoading.dismissLoading();
easyLoading.backPressed = 1;
globalVar.backPressed = 'backNormal';
notifyListeners();
await navigationService.navigateToLoginUserView();
}

View File

@ -36,7 +36,7 @@ class MasukanNoHpView extends StatelessWidget {
),
body: WillPopScope(
onWillPop: () async {
if (model.easyLoading.backPressed == 1) {
if (model.globalVar.backPressed == 'backNormal') {
model.navigationService.navigateToLoginUserView();
}
return false;

View File

@ -16,9 +16,9 @@ class MasukanNoHpViewModel extends CustomBaseViewModel {
selanjutnya() async {
_easyloading.customLoading("Menghantar Kode OTP \nke WhatsApp Anda");
easyLoading.backPressed = 0;
globalVar.backPressed = 'cantBack';
await Future.delayed(const Duration(seconds: 3));
easyLoading.backPressed = 1;
globalVar.backPressed = 'backNormal';
notifyListeners();
_easyloading.dismissLoading();
await navigationService.navigateToVerifikasiNoHpView();

View File

@ -36,7 +36,7 @@ class VerifikasiNoHpView extends StatelessWidget {
),
body: WillPopScope(
onWillPop: () async {
if (model.easyLoading.backPressed == 1) {
if (model.globalVar.backPressed == 'backNormal') {
model.back();
}
return false;

View File

@ -9,11 +9,11 @@ class VerifikasiNoHpViewModel extends CustomBaseViewModel {
Future<void> init() async {}
goToInputInformasiDiri() async {
easyLoading.backPressed = 0;
globalVar.backPressed = 'cantBack';
easyLoading.customLoading("Ke Halaman Input Informasi Diri");
await Future.delayed(const Duration(seconds: 3));
easyLoading.dismissLoading();
easyLoading.backPressed = 1;
globalVar.backPressed = 'backNormal';
notifyListeners();
await navigationService.navigateToInputInformasiDiriView(
noHp: "082293246583",