login issue fixed

merge-update-with-lab-changes
Sultan Khan 5 years ago
parent 3edae19ad6
commit 8becd4f920

@ -154,7 +154,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
_firebaseMessaging.getToken().then((String token) async { _firebaseMessaging.getToken().then((String token) async {
sharedPref.setString(PUSH_TOKEN, token); sharedPref.setString(PUSH_TOKEN, token);
if (token != null && await sharedPref.getObject(USER_PROFILE) == null) { if (token != null && projectViewModel.isLogin == false) {
DEVICE_TOKEN = token; DEVICE_TOKEN = token;
checkUserStatus(token); checkUserStatus(token);
} else if (projectViewModel.isLogin) { } else if (projectViewModel.isLogin) {

@ -99,6 +99,7 @@ class _Login extends State<Login> {
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: Container( child: Container(
child: TextFields( child: TextFields(
keyboardType: TextInputType.number,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
controller: nationalIDorFile, controller: nationalIDorFile,
onChanged: (value) => {validateForm()}, onChanged: (value) => {validateForm()},
@ -240,7 +241,7 @@ class _Login extends State<Login> {
request['PatientID'] = int.parse(nationalIDorFile.text); request['PatientID'] = int.parse(nationalIDorFile.text);
} }
// request.isRegister = false; // request.isRegister = false;
this.authService.checkActivationCode(request, code).then((result) async{ this.authService.checkActivationCode(request, code).then((result) async {
sharedPref.remove(FAMILY_FILE); sharedPref.remove(FAMILY_FILE);
result = CheckActivationCode.fromJson(result); result = CheckActivationCode.fromJson(result);
result.list.isFamily = false; result.list.isFamily = false;
@ -282,7 +283,6 @@ class _Login extends State<Login> {
print(err); print(err);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
}); });
}); });
} }

@ -51,8 +51,7 @@ class _Register extends State<Register> {
isShowDecPage: false, isShowDecPage: false,
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
padding: padding: EdgeInsets.only(top: 10, left: 20, right: 20, bottom: 30),
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>[
@ -73,12 +72,14 @@ class _Register extends State<Register> {
{mobileNo = value, validateForm()}, {mobileNo = value, validateForm()},
onCountryChange: (value) => countryCode = value), onCountryChange: (value) => countryCode = value),
Directionality( Directionality(
textDirection:TextDirection.ltr,child:Container( textDirection: TextDirection.ltr,
child: Container(
child: TextFields( child: TextFields(
controller: nationalIDorFile, controller: nationalIDorFile,
onChanged: (value) => validateForm(), onChanged: (value) => validateForm(),
prefixIcon: keyboardType: TextInputType.number,
Icon(Icons.chrome_reader_mode, color: Color(0xFF40ACC9)), prefixIcon: Icon(Icons.chrome_reader_mode,
color: Color(0xFF40ACC9)),
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: 20, bottom: 20, left: 10, right: 10), top: 20, bottom: 20, left: 10, right: 10),
hintText: TranslationBase.of(context).nationalID, hintText: TranslationBase.of(context).nationalID,
@ -115,8 +116,7 @@ class _Register extends State<Register> {
validateForm(); validateForm();
}, },
), ),
Text(TranslationBase.of(context) Text(TranslationBase.of(context).gregorianDate),
.gregorianDate),
], ],
), ),
), ),
@ -127,7 +127,7 @@ class _Register extends State<Register> {
children: <Widget>[ children: <Widget>[
Container( Container(
width: SizeConfig.realScreenWidth * .9, width: SizeConfig.realScreenWidth * .9,
height:60, height: 60,
child: isHijri == 1 child: isHijri == 1
? TextFields( ? TextFields(
onChanged: (value) => {dob = value}, onChanged: (value) => {dob = value},
@ -137,9 +137,8 @@ class _Register extends State<Register> {
: RaisedButton.icon( : RaisedButton.icon(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(15.0), borderRadius: BorderRadius.circular(15.0),
), ),
color:Colors.white, color: Colors.white,
onPressed: () => { onPressed: () => {
if (isHijri != null) if (isHijri != null)
_selectDate(context) _selectDate(context)
@ -162,7 +161,9 @@ class _Register extends State<Register> {
color: Colors.grey, color: Colors.grey,
height: 2, height: 2,
), ),
SizedBox(height: 10,), SizedBox(
height: 10,
),
Row( Row(
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
@ -216,7 +217,8 @@ class _Register extends State<Register> {
this this
.authService .authService
.checkPatientForRegisteration(request) .checkPatientForRegisteration(request)
.then((response) => {checkUserStatus(response, request)}).catchError((err) { .then((response) => {checkUserStatus(response, request)})
.catchError((err) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
ConfirmDialog dialog = new ConfirmDialog( ConfirmDialog dialog = new ConfirmDialog(
context: context, context: context,
@ -228,11 +230,9 @@ class _Register extends State<Register> {
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
REGISTER, REGISTER,
), ),
}, },
cancelFunction: () => {ConfirmDialog.closeAlertDialog(context)}); cancelFunction: () => {ConfirmDialog.closeAlertDialog(context)});
dialog.showAlertDialog(context); dialog.showAlertDialog(context);
}); });
} }

Loading…
Cancel
Save