|
|
|
@ -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: ),
|
|
|
|
|
// )
|
|
|
|
|
// ],
|
|
|
|
|
// ),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|