diff --git a/lib/features/authentication/authentication_view_model.dart b/lib/features/authentication/authentication_view_model.dart index 682108f..4ce1400 100644 --- a/lib/features/authentication/authentication_view_model.dart +++ b/lib/features/authentication/authentication_view_model.dart @@ -90,7 +90,7 @@ class AuthenticationViewModel extends ChangeNotifier { } } - void clearDefaults() { + void clearDefaultInputValues() { nationalIdController.clear(); phoneNumberController.clear(); dobController.clear(); @@ -377,6 +377,7 @@ class AuthenticationViewModel extends ChangeNotifier { _appState.setAppLoginTokenID = activation.authenticationTokenId; final request = RequestUtils.getAuthanticatedCommonRequest().toJson(); bool isUserAgreedBefore = await checkIfUserAgreedBefore(request: request); + clearDefaultInputValues(); if (isUserAgreedBefore) { navigateToHomeScreen(); } else { diff --git a/lib/presentation/authentication/register_step2.dart b/lib/presentation/authentication/register_step2.dart index 151a4c8..1e4c650 100644 --- a/lib/presentation/authentication/register_step2.dart +++ b/lib/presentation/authentication/register_step2.dart @@ -43,7 +43,7 @@ class _RegisterNew extends State { @override void dispose() { super.dispose(); - authVM!.clearDefaults(); + authVM!.clearDefaultInputValues(); } @override @@ -53,7 +53,7 @@ class _RegisterNew extends State { appBar: CustomAppBar( onBackPressed: () { Navigator.of(context).pop(); - authVM!.clearDefaults(); + authVM!.clearDefaultInputValues(); }, onLanguageChanged: (lang) {}, hideLogoAndLang: true, @@ -263,7 +263,7 @@ class _RegisterNew extends State { icon: AppAssets.cancel, onPressed: () { Navigator.of(context).pop(); - authVM!.clearDefaults(); + authVM!.clearDefaultInputValues(); }, backgroundColor: AppColors.secondaryLightRedColor, borderColor: AppColors.secondaryLightRedColor,