login fixes

merge-requests/465/head
Sultan Khan 4 years ago
parent 44baa02cfc
commit 90ad95bd63

@ -119,7 +119,7 @@ class _LoginsreenState extends State<Loginsreen> {
children: <Widget>[
AuthHeader(loginType.knownUser),
SizedBox(
height: 60,
height: 40,
),
LoginForm(
changeLoadingStata: changeLoadingStata,

@ -69,231 +69,232 @@ class _LoginFormState extends State<LoginForm> {
return Form(
key: loginFormKey,
child: Container(
width: SizeConfig.realScreenWidth * 0.90,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
buildSizedBox(),
Padding(
child: AppText(
TranslationBase.of(context).enterCredentials,
fontSize: 18,
fontWeight: FontWeight.bold,
),
padding: EdgeInsets.only(top: 10, bottom: 10)),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"),
),
color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(left: 10, top: 10),
child: AppText(
TranslationBase.of(context).enterId,
fontWeight: FontWeight.w800,
fontSize: 14,
)),
AppTextFormField(
labelText: '',
borderColor: Colors.white,
// keyboardType: TextInputType.number,
textInputAction: TextInputAction.next,
// decoration: buildInputDecoration(
// context,
// TranslationBase.of(context).enterId,
// 'assets/images/user_id_icon.png'),
validator: (value) {
if (value != null && value.isEmpty) {
return TranslationBase.of(context)
.pleaseEnterYourID;
}
return null;
},
onSaved: (value) {
if (value != null) userInfo.userID = value.trim();
},
onChanged: (value) {
if (value != null) userInfo.userID = value.trim();
},
onFieldSubmitted: (_) {
focusPass.nextFocus();
},
// onEditingComplete: () {},
// autofocus: false,
)
])),
buildSizedBox(),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"),
),
color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(left: 10, top: 10),
child: AppText(
TranslationBase.of(context).enterPassword,
fontWeight: FontWeight.w800,
fontSize: 14,
)),
AppTextFormField(
focusNode: focusPass,
obscureText: true,
borderColor: Colors.white,
textInputAction: TextInputAction.next,
// decoration: buildInputDecoration(
// context,
// TranslationBase.of(context).enterPassword,
// 'assets/images/password_icon.png'),
validator: (value) {
if (value != null && value.isEmpty) {
return TranslationBase.of(context)
.pleaseEnterPassword;
}
return null;
},
onSaved: (value) {
userInfo.password = value;
},
onFieldSubmitted: (_) {
focusPass.nextFocus();
helpers.showCupertinoPicker(context, projectsList,
'facilityName', onSelectProject);
},
onTap: () {
this.getProjects(userInfo.userID);
},
)
])),
buildSizedBox(),
projectsList.length > 0
? Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"),
),
color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(left: 10, top: 10),
child: AppText(
TranslationBase.of(context).selectYourProject,
fontWeight: FontWeight.w600,
)),
AppTextFormField(
focusNode: focusProject,
controller: projectIdController,
borderColor: Colors.white,
suffixIcon: Icons.arrow_drop_down,
onTap: () {
helpers.showCupertinoPicker(
context,
projectsList,
'facilityName',
onSelectProject);
},
// showCursor: false,
// //readOnly: true,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Container(
width: SizeConfig.realScreenWidth * 0.90,
height: SizeConfig.realScreenHeight * 0.65,
child:
Column(crossAxisAlignment: CrossAxisAlignment.start, children: [
buildSizedBox(),
Padding(
child: AppText(
TranslationBase.of(context).enterCredentials,
fontSize: 18,
fontWeight: FontWeight.bold,
),
padding: EdgeInsets.only(top: 10, bottom: 10)),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"),
),
color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(left: 10, top: 10),
child: AppText(
TranslationBase.of(context).enterId,
fontWeight: FontWeight.w800,
fontSize: 14,
)),
AppTextFormField(
labelText: '',
borderColor: Colors.white,
// keyboardType: TextInputType.number,
textInputAction: TextInputAction.next,
// decoration: buildInputDecoration(
// context,
// TranslationBase.of(context).enterId,
// 'assets/images/user_id_icon.png'),
validator: (value) {
if (value != null && value.isEmpty) {
return TranslationBase.of(context)
.pleaseEnterYourID;
}
return null;
},
onSaved: (value) {
if (value != null) userInfo.userID = value.trim();
},
onChanged: (value) {
if (value != null) userInfo.userID = value.trim();
},
onFieldSubmitted: (_) {
focusPass.nextFocus();
},
// onEditingComplete: () {},
// autofocus: false,
)
])),
buildSizedBox(),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"),
),
color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(left: 10, top: 10),
child: AppText(
TranslationBase.of(context).enterPassword,
fontWeight: FontWeight.w800,
fontSize: 14,
)),
AppTextFormField(
focusNode: focusPass,
obscureText: true,
borderColor: Colors.white,
textInputAction: TextInputAction.next,
// decoration: buildInputDecoration(
// context,
// TranslationBase.of(context).enterPassword,
// 'assets/images/password_icon.png'),
validator: (value) {
if (value != null && value.isEmpty) {
return TranslationBase.of(context)
.pleaseEnterPassword;
}
return null;
},
onSaved: (value) {
userInfo.password = value;
},
onFieldSubmitted: (_) {
focusPass.nextFocus();
helpers.showCupertinoPicker(context, projectsList,
'facilityName', onSelectProject);
},
onTap: () {
this.getProjects(userInfo.userID);
},
)
])),
buildSizedBox(),
projectsList.length > 0
? Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"),
),
color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(left: 10, top: 10),
child: AppText(
TranslationBase.of(context).selectYourProject,
fontWeight: FontWeight.w600,
)),
AppTextFormField(
focusNode: focusProject,
controller: projectIdController,
borderColor: Colors.white,
suffixIcon: Icons.arrow_drop_down,
onTap: () {
helpers.showCupertinoPicker(
context,
projectsList,
'facilityName',
onSelectProject);
},
// showCursor: false,
// //readOnly: true,
// decoration: buildInputDecoration(
// context,
// TranslationBase.of(context).selectYourProject,
// 'assets/images/password_icon.png'),
validator: (value) {
if (value != null && value.isEmpty) {
return TranslationBase.of(context)
.pleaseEnterYourProject;
}
return null;
})
]))
: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"),
),
color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(left: 10, top: 10),
child: AppText(
TranslationBase.of(context).selectYourProject,
fontWeight: FontWeight.w800,
fontSize: 14,
)),
AppTextFormField(
readOnly: true, borderColor: Colors.white,
prefix: IconButton(
icon: Icon(Icons.arrow_drop_down),
iconSize: 30,
padding: EdgeInsets.only(bottom: 30),
),
// decoration: buildInputDecoration(
// context,
// TranslationBase.of(context).selectYourProject,
// 'assets/images/password_icon.png'),
validator: (value) {
if (value != null && value.isEmpty) {
return TranslationBase.of(context)
.pleaseEnterYourProject;
}
return null;
})
]))
: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(6.0)),
border: Border.all(
width: 1.0,
color: HexColor("#CCCCCC"),
),
color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(left: 10, top: 10),
child: AppText(
TranslationBase.of(context).selectYourProject,
fontWeight: FontWeight.w800,
fontSize: 14,
)),
AppTextFormField(
readOnly: true, borderColor: Colors.white,
prefix: IconButton(
icon: Icon(Icons.arrow_drop_down),
iconSize: 30,
padding: EdgeInsets.only(bottom: 30),
),
// decoration: buildInputDecoration(
// context,
// TranslationBase.of(context)
// .pleaseEnterYourProject,
// 'assets/images/password_icon.png')
)
])),
SizedBox(
height: 100,
),
Row(
children: <Widget>[
Expanded(
child: Button(
title: TranslationBase.of(context).login,
color: Colors.red[700],
onTap: () {
login(context, authProv, widget.changeLoadingStata);
},
)),
],
)
// Row(
// mainAxisAlignment: MainAxisAlignment.end,
// children: <Widget>[
// RaisedButton(
// onPressed: () {
// login(context, authProv, widget.changeLoadingStata);
// },
// textColor: Colors.white,
// elevation: 0.0,
// padding: const EdgeInsets.all(0.0),
// shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.circular(10),
// side: BorderSide(width: 0.5, color: HexColor('#CCCCCC'))),
// child: Container(
// padding: const EdgeInsets.all(10.0),
// height: 50,
// width: SizeConfig.realScreenWidth * 0.35,
// child: ),
// )
// ],
// ),
],
),
// TranslationBase.of(context)
// .pleaseEnterYourProject,
// 'assets/images/password_icon.png')
)
])),
]),
),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Expanded(
child: Button(
title: TranslationBase.of(context).login,
color: HexColor('#D02127'),
onTap: () {
login(context, authProv, widget.changeLoadingStata);
},
)),
],
)
// Row(
// mainAxisAlignment: MainAxisAlignment.end,
// children: <Widget>[
// RaisedButton(
// onPressed: () {
// login(context, authProv, widget.changeLoadingStata);
// },
// textColor: Colors.white,
// elevation: 0.0,
// padding: const EdgeInsets.all(0.0),
// shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.circular(10),
// side: BorderSide(width: 0.5, color: HexColor('#CCCCCC'))),
// child: Container(
// padding: const EdgeInsets.all(10.0),
// height: 50,
// width: SizeConfig.realScreenWidth * 0.35,
// child: ),
// )
// ],
// ),
],
),
);
}

@ -60,20 +60,8 @@ class SMSOTP {
builder: (context) {
projectProvider = Provider.of(context);
return AlertDialog(
contentPadding: EdgeInsets.fromLTRB(24.0, 20.0, 0.0, 24.0),
title: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
IconButton(
icon: Icon(Icons.close),
onPressed: () {
this.isClosed = true;
Navigator.pop(context);
this.onFailure();
},
)
],
),
contentPadding: EdgeInsets.fromLTRB(24.0, 0.0, 0.0, 24.0),
// shape: RoundedRectangleBorder(
// borderRadius: BorderRadius.all(Radius.circular(10.0))),
content: StatefulBuilder(builder: (context, setState) {
@ -89,21 +77,44 @@ class SMSOTP {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
type == 1
? Padding(
child: Icon(
DoctorApp.verify_sms_1,
size: 40,
),
padding: EdgeInsets.only(bottom: 20),
)
: Padding(
child: Icon(
DoctorApp.verify_whtsapp,
size: 40,
),
padding: EdgeInsets.only(bottom: 20),
),
Padding(
padding: EdgeInsets.all(10),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
type == 1
? Padding(
child: Icon(
DoctorApp.verify_sms_1,
size: 40,
),
padding: EdgeInsets.only(bottom: 20),
)
: Padding(
child: Icon(
DoctorApp.verify_whtsapp,
size: 40,
),
padding: EdgeInsets.only(bottom: 20),
),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Padding(
padding: EdgeInsets.only(
left: 10, right: 10, bottom: 20),
child: IconButton(
icon: Icon(Icons.close),
iconSize: 40,
onPressed: () {
this.isClosed = true;
Navigator.pop(context);
this.onFailure();
},
))
],
)
])),
Padding(
padding: EdgeInsets.only(top: 5),
child: AppText(

Loading…
Cancel
Save