diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 2f4607e0..878a1850 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -322,4 +322,4 @@ SPEC CHECKSUMS: PODFILE CHECKSUM: 649616dc336b3659ac6b2b25159d8e488e042b69 -COCOAPODS: 1.10.0.rc.1 +COCOAPODS: 1.10.1 diff --git a/lib/core/viewModel/authentication_view_model.dart b/lib/core/viewModel/authentication_view_model.dart index f33ec782..228a63e7 100644 --- a/lib/core/viewModel/authentication_view_model.dart +++ b/lib/core/viewModel/authentication_view_model.dart @@ -169,13 +169,13 @@ class AuthenticationViewModel extends BaseViewModel { } - + //TODO Elham remove it getDate(DateTime date) { final DateFormat formatter = DateFormat('dd MMM yyyy'); return formatter.format(date); } - + //TODO Elham remove it getTime(DateTime date) { final DateFormat formatter = DateFormat('HH:mm a'); diff --git a/lib/core/viewModel/doctor_profile_view_model.dart b/lib/core/viewModel/doctor_profile_view_model.dart index 24f53e5b..d336dd8d 100644 --- a/lib/core/viewModel/doctor_profile_view_model.dart +++ b/lib/core/viewModel/doctor_profile_view_model.dart @@ -36,7 +36,7 @@ class DoctorProfileViewModel extends BaseViewModel { } notifyListeners(); } - +//TODO Elham move it auth view model APP_STATUS get stutas { if (isLoading) { return APP_STATUS.LOADING; diff --git a/lib/screens/auth/login_screen.dart b/lib/screens/auth/login_screen.dart index a6eab35b..91af7a2f 100644 --- a/lib/screens/auth/login_screen.dart +++ b/lib/screens/auth/login_screen.dart @@ -28,9 +28,9 @@ import '../../lookups/auth_lookup.dart'; import '../../util/dr_app_shared_pref.dart'; import '../../widgets/auth/auth_header.dart'; import '../../widgets/shared/app_scaffold_widget.dart'; - +//TODO Elham remove it DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); - +//TODO Elham change the name class Loginsreen extends StatefulWidget { @override _LoginsreenState createState() => _LoginsreenState(); @@ -51,12 +51,13 @@ class _LoginsreenState extends State { FocusNode focusPass = FocusNode(); FocusNode focusProject = FocusNode(); // HospitalViewModel hospitalViewModel; + //TODO Elham to change it ti UserModel var userInfo = UserModel(); @override void initState() { super.initState(); - + //TODO Elham move it root page and the logic in the view model _firebaseMessaging.setAutoInitEnabled(true); if (Platform.isIOS) { _firebaseMessaging.requestNotificationPermissions(); @@ -88,6 +89,7 @@ class _LoginsreenState extends State { }); } + //TODO Elham change it to GIF void changeLoadingState(isLoading) { setState(() { _isLoading = isLoading; @@ -100,6 +102,7 @@ class _LoginsreenState extends State { return BaseView( + //TODO Elham remove it onModelReady: (model) => {}, builder: (_, model, w) => AppScaffold( @@ -457,6 +460,7 @@ class _LoginsreenState extends State { loginFormKey.currentState.save(); GifLoaderDialogUtils.showMyDialog(context); sharedPref.setInt(PROJECT_ID, userInfo.projectID); + //TODO Elham move the sharedPref to view model await model.login(userInfo); if (model.state == ViewState.ErrorLocal) { GifLoaderDialogUtils.hideDialog(context); @@ -466,6 +470,7 @@ class _LoginsreenState extends State { saveObjToString(LOGGED_IN_USER, model.loginInfo); sharedPref.remove(LAST_LOGIN_USER); sharedPref.setString(TOKEN, model.loginInfo.logInTokenID); + //TODO Elham move the sharedPref to view model GifLoaderDialogUtils.hideDialog(context); Navigator.of(context).pushReplacement( @@ -478,13 +483,13 @@ class _LoginsreenState extends State { } } } - + //TODO Elham to it view model Future setSharedPref(key, value) async { sharedPref.setString(key, value).then((success) { }); } - +//TODO Elham to it view model saveObjToString(String key, value) async { sharedPref.setObj(key, value); } diff --git a/lib/screens/auth/verification_methods_screen.dart b/lib/screens/auth/verification_methods_screen.dart index 29188194..521dd5f6 100644 --- a/lib/screens/auth/verification_methods_screen.dart +++ b/lib/screens/auth/verification_methods_screen.dart @@ -39,6 +39,7 @@ class VerificationMethodsScreen extends StatefulWidget { VerificationMethodsScreen({this.changeLoadingState, this.password}); final password; + //TODO Elham remove this fun final Function changeLoadingState; @override @@ -62,12 +63,13 @@ class _VerificationMethodsScreenState extends State { final LocalAuthentication auth = LocalAuthentication(); + //TODO Elham remove this fun @override void initState() { super.initState(); } - +//TODO Elham remove this fun @override void didChangeDependencies() async{ super.didChangeDependencies(); @@ -229,11 +231,7 @@ class _VerificationMethodsScreenState extends State { child: InkWell( onTap: () => { // TODO check this logic it seem it will create bug to us - - authenticateUser( - AuthMethodTypes - .Fingerprint, - true) + authenticateUser(AuthMethodTypes.Fingerprint, true) }, child: MethodCard( authMethodType: model.user @@ -337,6 +335,7 @@ class _VerificationMethodsScreenState extends State { ], ), ), + //TODO Elham move it to bottom sheet Column( mainAxisAlignment: MainAxisAlignment.end, children: [ @@ -473,7 +472,7 @@ class _VerificationMethodsScreenState extends State { }, ).displayDialog(context); } - +//TODO Elham move it to view model loginWithFingerPrintOrFaceID(AuthMethodTypes authMethodTypes, isActive) async { if (isActive) { @@ -505,17 +504,15 @@ class _VerificationMethodsScreenState extends State { checkActivationCode({value}) async { - await model - .checkActivationCodeForDoctorApp(activationCode:value ); + await model.checkActivationCodeForDoctorApp(activationCode:value ); if (model.state == ViewState.ErrorLocal) { Navigator.pop(context); Helpers.showErrorToast(model.error); } else { sharedPref.setString( - TOKEN, - model - .checkActivationCodeForDoctorAppRes.authenticationTokenID); + TOKEN, model.checkActivationCodeForDoctorAppRes.authenticationTokenID); + //TODO Elham check the logic if (model.checkActivationCodeForDoctorAppRes.listDoctorsClinic.isNotEmpty) { loginProcessCompleted(model.checkActivationCodeForDoctorAppRes.list_DoctorProfile[0]); sharedPref.setObj( @@ -532,7 +529,7 @@ class _VerificationMethodsScreenState extends State { } } } - + //TODO Elham move it to view model loginProcessCompleted(Map profile) { var doctor = DoctorProfileModel.fromJson(profile); doctorProfileViewModel.setDoctorProfile(doctor); @@ -546,7 +543,7 @@ class _VerificationMethodsScreenState extends State { ), (r) => false); } - +//TODO Elham move it to view model getDocProfiles(ClinicModel clinicInfo) { ProfileReqModel docInfo = new ProfileReqModel( doctorID: clinicInfo.doctorID, diff --git a/lib/widgets/auth/auth_header.dart b/lib/widgets/auth/auth_header.dart index 47e128be..27396980 100644 --- a/lib/widgets/auth/auth_header.dart +++ b/lib/widgets/auth/auth_header.dart @@ -6,7 +6,7 @@ import 'package:hexcolor/hexcolor.dart'; import '../../config/size_config.dart'; import '../../lookups/auth_lookup.dart'; - +//TODO Elham delete this widget class AuthHeader extends StatelessWidget { var userType; AuthHeader(this.userType); diff --git a/lib/widgets/auth/method_card.dart b/lib/widgets/auth/method_card.dart index 94bd261b..79721381 100644 --- a/lib/widgets/auth/method_card.dart +++ b/lib/widgets/auth/method_card.dart @@ -20,6 +20,7 @@ class MethodCard extends StatefulWidget { class _MethodCardState extends State { + //TODO Elham change it to list Enum var _availableBiometrics; final LocalAuthentication auth = LocalAuthentication(); @@ -65,6 +66,7 @@ class _MethodCardState extends State { case AuthMethodTypes.WhatsApp: return InkWell( onTap: () => {widget.authenticateUser(AuthMethodTypes.WhatsApp, true)}, + //TODO Elham change it to widget child: Container( margin: EdgeInsets.all(10), decoration: BoxDecoration( diff --git a/lib/widgets/auth/sms-popup.dart b/lib/widgets/auth/sms-popup.dart index 61329758..6cbeab49 100644 --- a/lib/widgets/auth/sms-popup.dart +++ b/lib/widgets/auth/sms-popup.dart @@ -8,7 +8,7 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; - +//TODO Elham check it class SMSOTP { final AuthMethodTypes type; final mobileNo;