|
|
|
|
@ -6,8 +6,8 @@ import 'package:doctor_app_flutter/core/enum/auth_method_types.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/authentication_view_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/util/date-utils.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/utils/date-utils.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/auth/sms-popup.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_loader_widget.dart';
|
|
|
|
|
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
|
|
|
|
|
@ -19,12 +19,12 @@ import 'package:hexcolor/hexcolor.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
|
|
|
|
|
import '../../config/size_config.dart';
|
|
|
|
|
import '../../util/dr_app_shared_pref.dart';
|
|
|
|
|
import '../../util/helpers.dart';
|
|
|
|
|
import '../../utils/dr_app_shared_pref.dart';
|
|
|
|
|
import '../../utils/utils.dart';
|
|
|
|
|
import '../../widgets/auth/verification_methods_list.dart';
|
|
|
|
|
|
|
|
|
|
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
|
|
|
|
|
Helpers helpers = Helpers();
|
|
|
|
|
Utils helpers = Utils();
|
|
|
|
|
|
|
|
|
|
///TODO Elham* check if this still in user or not
|
|
|
|
|
class VerificationMethodsScreen extends StatefulWidget {
|
|
|
|
|
@ -101,7 +101,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
|
|
|
|
|
letterSpacing: -0.72,
|
|
|
|
|
),
|
|
|
|
|
AppText(
|
|
|
|
|
Helpers.convertToTitleCase(
|
|
|
|
|
Utils.convertToTitleCase(
|
|
|
|
|
authenticationViewModel.user.doctorName),
|
|
|
|
|
fontSize: SizeConfig
|
|
|
|
|
.getTextMultiplierBasedOnWidth() *
|
|
|
|
|
@ -499,7 +499,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
|
|
|
|
|
authMethodType: authMethodType,
|
|
|
|
|
password: authenticationViewModel.userInfo.password);
|
|
|
|
|
if (authenticationViewModel.state == ViewState.ErrorLocal) {
|
|
|
|
|
Helpers.showErrorToast(authenticationViewModel.error);
|
|
|
|
|
Utils.showErrorToast(authenticationViewModel.error);
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
} else {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
@ -508,7 +508,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
|
|
|
|
|
} else {
|
|
|
|
|
// TODO route to this page with parameters to inicate we should present 2 option
|
|
|
|
|
if (Platform.isAndroid && authMethodType == AuthMethodTypes.Fingerprint) {
|
|
|
|
|
Helpers.showErrorToast('Your device not support this feature');
|
|
|
|
|
Utils.showErrorToast('Your device not support this feature');
|
|
|
|
|
} else {}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
@ -520,7 +520,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
|
|
|
|
|
|
|
|
|
|
if (authenticationViewModel.state == ViewState.ErrorLocal) {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
Helpers.showErrorToast(authenticationViewModel.error);
|
|
|
|
|
Utils.showErrorToast(authenticationViewModel.error);
|
|
|
|
|
} else {
|
|
|
|
|
await sharedPref.setString(
|
|
|
|
|
TOKEN,
|
|
|
|
|
@ -620,7 +620,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
|
|
|
|
|
activationCode: value, isSilentLogin: isSilentLogin);
|
|
|
|
|
if (authenticationViewModel.state == ViewState.ErrorLocal) {
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
Helpers.showErrorToast(authenticationViewModel.error);
|
|
|
|
|
Utils.showErrorToast(authenticationViewModel.error);
|
|
|
|
|
} else {
|
|
|
|
|
await authenticationViewModel.onCheckActivationCodeSuccess();
|
|
|
|
|
if (value != null) {
|
|
|
|
|
@ -633,7 +633,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
|
|
|
|
|
|
|
|
|
|
navigateToLandingPage() {
|
|
|
|
|
if (authenticationViewModel.state == ViewState.ErrorLocal) {
|
|
|
|
|
Helpers.showErrorToast(authenticationViewModel.error);
|
|
|
|
|
Utils.showErrorToast(authenticationViewModel.error);
|
|
|
|
|
} else {
|
|
|
|
|
authenticationViewModel.setAppStatus(APP_STATUS.AUTHENTICATED);
|
|
|
|
|
}
|
|
|
|
|
|