fix login issues

merge-update-with-lab-changes
Mohammad Aljmma 5 years ago
parent a796e0392b
commit 54a7f98eff

@ -11,8 +11,6 @@ import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_doct
import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart';
@ -20,10 +18,12 @@ import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
import 'package:diplomaticquarterapp/widgets/input/text_field.dart'; import 'package:diplomaticquarterapp/widgets/input/text_field.dart';
import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart'; import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
class Login extends StatefulWidget { class Login extends StatefulWidget {
@override @override
@ -69,7 +69,8 @@ class _Login extends State<Login> {
padding: EdgeInsets.only(top: 10, left: 20, right: 20, bottom: 30), padding: EdgeInsets.only(top: 10, left: 20, right: 20, bottom: 30),
height: SizeConfig.realScreenHeight * .9, height: SizeConfig.realScreenHeight * .9,
width: SizeConfig.realScreenWidth, width: SizeConfig.realScreenWidth,
child: Column(children: <Widget>[ child: Column(
children: <Widget>[
Expanded( Expanded(
flex: 2, flex: 2,
child: AppText( child: AppText(
@ -125,8 +126,11 @@ class _Login extends State<Login> {
), ),
], ],
)) ))
]), ],
))); ),
),
),
);
} }
startLogin() { startLogin() {
@ -154,7 +158,6 @@ class _Login extends State<Login> {
checkUserAuthentication() { checkUserAuthentication() {
// showLoader(true); // showLoader(true);
GifLoaderDialogUtils.showMyDialog(context);
var request = CheckPatientAuthenticationReq(); var request = CheckPatientAuthenticationReq();
request.isRegister = false; request.isRegister = false;
request.patientMobileNumber = int.parse(mobileNo); request.patientMobileNumber = int.parse(mobileNo);
@ -173,7 +176,7 @@ class _Login extends State<Login> {
authService authService
.checkPatientAuthentication(request) .checkPatientAuthentication(request)
.then((value) => { .then((value) => {
//showLoader(false),GifLoaderDialogUtils.hideDialog(context), //showLoader(false),
if (value['isSMSSent']) if (value['isSMSSent'])
{ {
sharedPref.setString(LOGIN_TOKEN_ID, value['LogInTokenID']), sharedPref.setString(LOGIN_TOKEN_ID, value['LogInTokenID']),
@ -186,15 +189,11 @@ class _Login extends State<Login> {
if (value['IsAuthenticated']) {this.checkActivationCode()} if (value['IsAuthenticated']) {this.checkActivationCode()}
} }
}) })
.catchError((err) { .catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err); print(err);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
}); });
// SMSOTP.showLoadingDialog(context, false), // SMSOTP.showLoadingDialog(context, false),
AppToast.showErrorToast(message: err);
});
} }
checkActivationCode({code}) async { checkActivationCode({code}) async {
@ -254,9 +253,9 @@ class _Login extends State<Login> {
}); });
} }
// showLoader(bool isTrue) { // showLoader(bool isTrue) {
// setState(() { // setState(() {
// isLoading = isTrue; // isLoading = isTrue;
// }); // });
// } // }
} }

@ -16,7 +16,7 @@ class _GifLoaderContainerState extends State<GifLoaderContainer>
WidgetsBinding.instance.addPostFrameCallback((_) { WidgetsBinding.instance.addPostFrameCallback((_) {
controller1.repeat( controller1.repeat(
min: 0, max: 12, period: Duration(milliseconds: 750), reverse: true); min: 0, max: 11, period: Duration(milliseconds: 750), reverse: true);
}); });
super.initState(); super.initState();
} }

Loading…
Cancel
Save