change password UI
parent
f75c6376b5
commit
969bee73e1
@ -1 +1 @@
|
|||||||
enum loginType { knownUser, unknownUser }
|
enum loginType { knownUser, unknownUser, changePassword, verifyPassword }
|
||||||
|
|||||||
@ -0,0 +1,24 @@
|
|||||||
|
import 'package:doctor_app_flutter/lookups/auth_lookup.dart';
|
||||||
|
import 'package:doctor_app_flutter/widgets/auth/auth_header.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import '../../widgets/auth/change_password.dart';
|
||||||
|
class ChangePasswordScreen extends StatelessWidget {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
// return Container()];
|
||||||
|
return Scaffold(
|
||||||
|
backgroundColor: Colors.white,
|
||||||
|
body: SingleChildScrollView(
|
||||||
|
child: Container(
|
||||||
|
margin: EdgeInsetsDirectional.fromSTEB(30, 0, 0, 0),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: <Widget>[
|
||||||
|
AuthHeader(loginType.changePassword),
|
||||||
|
ChangePassword(),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,159 @@
|
|||||||
|
import 'package:doctor_app_flutter/config/size_config.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:hexcolor/hexcolor.dart';
|
||||||
|
|
||||||
|
class ChangePassword extends StatelessWidget {
|
||||||
|
final changePassFormKey = GlobalKey<FormState>();
|
||||||
|
var changePassFormValues = {
|
||||||
|
'currentPass': null,
|
||||||
|
'newPass': null,
|
||||||
|
'repeatedPass': null
|
||||||
|
};
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Form(
|
||||||
|
key: changePassFormKey,
|
||||||
|
child: Container(
|
||||||
|
width: SizeConfig.widthMultiplier * 90,
|
||||||
|
child:
|
||||||
|
Column(crossAxisAlignment: CrossAxisAlignment.start, children: <
|
||||||
|
Widget>[
|
||||||
|
buildSizedBox(),
|
||||||
|
TextFormField(
|
||||||
|
keyboardType: TextInputType.number,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
// ts/images/password_icon.png
|
||||||
|
prefixIcon: Image.asset('assets/images/password_icon.png'),
|
||||||
|
hintText: 'Current Password',
|
||||||
|
hintStyle:
|
||||||
|
TextStyle(fontSize: 2 * SizeConfig.textMultiplier),
|
||||||
|
enabledBorder: OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(20)),
|
||||||
|
borderSide: BorderSide(color: Hexcolor('#CCCCCC')),
|
||||||
|
),
|
||||||
|
focusedBorder: OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(10.0)),
|
||||||
|
borderSide:
|
||||||
|
BorderSide(color: Theme.of(context).primaryColor),
|
||||||
|
)
|
||||||
|
//BorderRadius.all(Radius.circular(20));
|
||||||
|
),
|
||||||
|
validator: (value) {
|
||||||
|
if (value.isEmpty) {
|
||||||
|
return 'Please enter your Current Password';
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
onSaved: (value) {
|
||||||
|
// changePassFormValues. = value;
|
||||||
|
},
|
||||||
|
),
|
||||||
|
buildSizedBox(40),
|
||||||
|
// buildSizedBox(),
|
||||||
|
Text(
|
||||||
|
"New Password",
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 2.8 * SizeConfig.textMultiplier,
|
||||||
|
fontWeight: FontWeight.w800),
|
||||||
|
),
|
||||||
|
buildSizedBox(10.0),
|
||||||
|
// Text()
|
||||||
|
TextFormField(
|
||||||
|
keyboardType: TextInputType.number,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
// ts/images/password_icon.png
|
||||||
|
prefixIcon: Image.asset('assets/images/password_icon.png'),
|
||||||
|
hintText: 'New Password',
|
||||||
|
hintStyle:
|
||||||
|
TextStyle(fontSize: 2 * SizeConfig.textMultiplier),
|
||||||
|
enabledBorder: OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(20)),
|
||||||
|
borderSide: BorderSide(color: Hexcolor('#CCCCCC')),
|
||||||
|
),
|
||||||
|
focusedBorder: OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(10.0)),
|
||||||
|
borderSide:
|
||||||
|
BorderSide(color: Theme.of(context).primaryColor),
|
||||||
|
)
|
||||||
|
//BorderRadius.all(Radius.circular(20));
|
||||||
|
),
|
||||||
|
validator: (value) {
|
||||||
|
if (value.isEmpty) {
|
||||||
|
return 'Please enter your New Password';
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
onSaved: (value) {
|
||||||
|
// userInfo.UserID = value;
|
||||||
|
},
|
||||||
|
),
|
||||||
|
buildSizedBox(),
|
||||||
|
TextFormField(
|
||||||
|
keyboardType: TextInputType.number,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
prefixIcon: Image.asset('assets/images/password_icon.png'),
|
||||||
|
hintText: 'Repeat Password',
|
||||||
|
hintStyle:
|
||||||
|
TextStyle(fontSize: 2 * SizeConfig.textMultiplier),
|
||||||
|
enabledBorder: OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(20)),
|
||||||
|
borderSide: BorderSide(color: Hexcolor('#CCCCCC')),
|
||||||
|
),
|
||||||
|
focusedBorder: OutlineInputBorder(
|
||||||
|
borderRadius: BorderRadius.all(Radius.circular(10.0)),
|
||||||
|
borderSide:
|
||||||
|
BorderSide(color: Theme.of(context).primaryColor),
|
||||||
|
)
|
||||||
|
//BorderRadius.all(Radius.circular(20));
|
||||||
|
),
|
||||||
|
validator: (value) {
|
||||||
|
if (value.isEmpty) {
|
||||||
|
return 'Please enter your Repeat Password';
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
onSaved: (value) {
|
||||||
|
// userInfo.UserID = value;
|
||||||
|
},
|
||||||
|
),
|
||||||
|
buildSizedBox(),
|
||||||
|
RaisedButton(
|
||||||
|
onPressed:changePass,
|
||||||
|
elevation: 0.0,
|
||||||
|
child: Container(
|
||||||
|
width: double.infinity,
|
||||||
|
height: 50,
|
||||||
|
child: Center(
|
||||||
|
child: Text(
|
||||||
|
'Change Password'
|
||||||
|
.toUpperCase(),
|
||||||
|
// textAlign: TextAlign.center,
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 2.5 * SizeConfig.textMultiplier),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
side: BorderSide(width: 0.5, color: Hexcolor('#CCCCCC'))),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
])));
|
||||||
|
}
|
||||||
|
|
||||||
|
SizedBox buildSizedBox([double height = 20]) {
|
||||||
|
return SizedBox(
|
||||||
|
height: height,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
changePass(){
|
||||||
|
if(changePassFormKey.currentState.validate()){
|
||||||
|
changePassFormKey.currentState.save();
|
||||||
|
// call Api
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue