diff --git a/lib/config/config.dart b/lib/config/config.dart index ec8efe26..382e84b2 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -337,7 +337,7 @@ const TRANSACTION_NO = 0; const LANGUAGE_ID = 2; const STAMP = '2020-04-27T12:17:17.721Z'; const IP_ADDRESS = '9.9.9.9'; -const VERSION_ID = 6.0; +const VERSION_ID = 6.1; const CHANNEL = 9; const SESSION_ID = 'BlUSkYymTt'; const IS_LOGIN_FOR_DOCTOR_APP = true; diff --git a/lib/core/viewModel/authentication_view_model.dart b/lib/core/viewModel/authentication_view_model.dart index c552e40e..77f76abb 100644 --- a/lib/core/viewModel/authentication_view_model.dart +++ b/lib/core/viewModel/authentication_view_model.dart @@ -17,6 +17,7 @@ import 'package:doctor_app_flutter/core/model/hospitals/get_hospitals_response_m import 'package:doctor_app_flutter/core/service/authentication_service.dart'; import 'package:doctor_app_flutter/core/service/hospitals/hospitals_service.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/models/doctor/clinic_model.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; @@ -29,6 +30,7 @@ import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:flutter/services.dart'; import 'package:local_auth/auth_strings.dart'; import 'package:local_auth/local_auth.dart'; +import 'package:provider/provider.dart'; enum APP_STATUS { LOADING, UNAUTHENTICATED, AUTHENTICATED, UNVERIFIED } @@ -237,19 +239,6 @@ class AuthenticationViewModel extends BaseViewModel { } } - getInitUserInfo()async{ - setState(ViewState.Busy); - var localLoggedUser = await sharedPref.getObj(LOGGED_IN_USER); - if(localLoggedUser!= null) { - loggedUser = NewLoginInformationModel.fromJson(localLoggedUser); - } - var lastLogin = await sharedPref.getObj(LAST_LOGIN_USER); - if (lastLogin != null) { - user = GetIMEIDetailsModel.fromJson(lastLogin); - } - setState(ViewState.Idle); - } - setDataAfterSendActivationSuccsess(SendActivationCodeForDoctorAppResponseModel sendActivationCodeForDoctorAppResponseModel) { print("VerificationCode : " + sendActivationCodeForDoctorAppResponseModel.verificationCode); @@ -353,7 +342,7 @@ class AuthenticationViewModel extends BaseViewModel { setState(ViewState.Busy); _firebaseMessaging.getToken().then((String token) async { - if (DEVICE_TOKEN == "" && !isLogin) { + if (DEVICE_TOKEN == "" && !ProjectViewModel().isLogin) { DEVICE_TOKEN = token; await _authService.selectDeviceImei(DEVICE_TOKEN); diff --git a/lib/screens/auth/verification_methods_screen.dart b/lib/screens/auth/verification_methods_screen.dart index 9ff1f86c..afd5604c 100644 --- a/lib/screens/auth/verification_methods_screen.dart +++ b/lib/screens/auth/verification_methods_screen.dart @@ -8,6 +8,7 @@ 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/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'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; @@ -429,7 +430,6 @@ class _VerificationMethodsScreenState extends State { } startSMSService(AuthMethodTypes type) { - // TODO improve this logic new SMSOTP( context, type, @@ -438,9 +438,7 @@ class _VerificationMethodsScreenState extends State { showDialog( context: context, builder: (BuildContext context) { - return Center( - child: CircularProgressIndicator(), - ); + return AppLoaderWidget(); }); this.checkActivationCode(value: value); diff --git a/lib/screens/home/home_screen.dart b/lib/screens/home/home_screen.dart index 6fa38a43..72ffc5c5 100644 --- a/lib/screens/home/home_screen.dart +++ b/lib/screens/home/home_screen.dart @@ -229,7 +229,7 @@ class _HomeScreenState extends State { ), ], ), - isClilic: true, + isClinic: true, height: 50, ), ]) diff --git a/lib/widgets/auth/sms-popup.dart b/lib/widgets/auth/sms-popup.dart index 6cbeab49..532f9cc1 100644 --- a/lib/widgets/auth/sms-popup.dart +++ b/lib/widgets/auth/sms-popup.dart @@ -1,5 +1,6 @@ import 'dart:async'; +import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/core/enum/auth_method_types.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; @@ -20,10 +21,6 @@ class SMSOTP { Future timer; - static BuildContext _context; - - static bool _loading; - SMSOTP( this.context, this.type, @@ -285,8 +282,6 @@ class SMSOTP { InputDecoration buildInputDecoration(BuildContext context) { return InputDecoration( counterText: " ", - // ts/images/password_icon.png - // contentPadding: EdgeInsets.only(top: 20, bottom: 20), enabledBorder: OutlineInputBorder( borderRadius: BorderRadius.all(Radius.circular(10)), borderSide: BorderSide(color: Colors.grey[300]), @@ -306,6 +301,7 @@ class SMSOTP { ); } + // ignore: missing_return String validateCodeDigit(value) { if (value.isEmpty) { return ' '; @@ -317,7 +313,6 @@ class SMSOTP { } checkValue() { - //print(verifyAccountFormValue); if (verifyAccountForm.currentState.validate()) { onSuccess(digit1.text.toString() + digit2.text.toString() + @@ -343,6 +338,7 @@ class SMSOTP { startTimer(setState) { this.remainingTime--; + print(isClosed); setState(() { displayTime = this.getSecondsAsDigitalClock(this.remainingTime); }); @@ -355,34 +351,4 @@ class SMSOTP { } }); } - - static void showLoadingDialog(BuildContext context, bool _loading) async { - _context = context; - - if (_loading == false) { - Navigator.of(context).pop(); - return; - } - _loading = true; - await showDialog( - context: _context, - barrierDismissible: false, - builder: (BuildContext context) { - return SimpleDialog( - elevation: 0.0, - backgroundColor: Colors.transparent, - children: [ - Center( - child: CircularProgressIndicator( - valueColor: AlwaysStoppedAnimation(Colors.black), - ), - ) - ], - ); - }); - } - - static void hideSMSBox(context) { - Navigator.pop(context); - } } diff --git a/lib/widgets/patients/profile/profile-welcome-widget.dart b/lib/widgets/patients/profile/profile-welcome-widget.dart index 4d76fe41..53228bc2 100644 --- a/lib/widgets/patients/profile/profile-welcome-widget.dart +++ b/lib/widgets/patients/profile/profile-welcome-widget.dart @@ -5,9 +5,9 @@ import 'package:provider/provider.dart'; class ProfileWelcomeWidget extends StatelessWidget { final Widget clinicWidget; final double height; - final bool isClilic; + final bool isClinic; ProfileWelcomeWidget(this.clinicWidget, - {this.height = 150, this.isClilic = false}); + {this.height = 150, this.isClinic = false}); @override Widget build(BuildContext context) { @@ -23,33 +23,11 @@ class ProfileWelcomeWidget extends StatelessWidget { mainAxisAlignment: MainAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.start, children: [ - this.isClilic == true ? clinicWidget : SizedBox(), - // Column( - // crossAxisAlignment: CrossAxisAlignment.start, - // mainAxisAlignment: MainAxisAlignment.start, - // children: [ - // Row( - // children: [ - // AppText( - // TranslationBase.of(context).welcome, - // fontSize: SizeConfig.textMultiplier * 1.7, - // color: Colors.black, - // ) - // ], - // ), - // Row( - // mainAxisAlignment: MainAxisAlignment.end, - // children: [ - // AppText( - // // TranslationBase.of(context).dr + - // ' ${authProvider.doctorProfile.doctorName}', - // fontWeight: FontWeight.bold, - // fontSize: SizeConfig.textMultiplier * 2.5, - // color: Colors.black, - // ), + this.isClinic == true ? clinicWidget : SizedBox(), SizedBox( width: 20, ), + if(authenticationViewModel.doctorProfile!=null) CircleAvatar( // radius: (52) child: ClipRRect( @@ -63,23 +41,10 @@ class ProfileWelcomeWidget extends StatelessWidget { ), backgroundColor: Colors.transparent, ), - // ], - // ), SizedBox( height: 20, ), - /// ], - // ), - // Expanded( - // child: Column( - // mainAxisAlignment: MainAxisAlignment.start, - // crossAxisAlignment: CrossAxisAlignment.end, - // children: [ - - // ], - // ), - // ), ], )), ); diff --git a/pubspec.lock b/pubspec.lock index 1a572a0a..825db695 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -615,7 +615,7 @@ packages: name: meta url: "https://pub.dartlang.org" source: hosted - version: "1.3.0-nullsafety.4" + version: "1.3.0-nullsafety.3" mime: dependency: transitive description: @@ -907,7 +907,7 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.10.0-nullsafety.2" + version: "1.10.0-nullsafety.1" sticky_headers: dependency: "direct main" description: @@ -1098,5 +1098,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.10.0 <=2.11.0-213.1.beta" + dart: ">=2.10.0 <2.11.0" flutter: ">=1.22.0 <2.0.0"