mirror of
https://git.meshkee.com/applications/cssd.git
synced 2026-10-13 03:08:55 +03:30
1.7.1
This commit is contained in:
+159
-157
@@ -43,7 +43,7 @@ class _RePassScreenState extends State<RePassScreen> {
|
||||
builder: (ctx) => AlertDialog(
|
||||
content: Text(message),
|
||||
actions: <Widget>[
|
||||
FlatButton(
|
||||
TextButton(
|
||||
child: Text('Ok'),
|
||||
onPressed: () {
|
||||
Navigator.of(ctx).pop();
|
||||
@@ -79,163 +79,165 @@ class _RePassScreenState extends State<RePassScreen> {
|
||||
// final double _pixelRatio = (_media.size.height / _media.size.width * 7 / 5);
|
||||
final double _devicewidth = _media.size.width;
|
||||
final double _deviceBlockSize = _devicewidth / 100;
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
title: Text('CSSD'),
|
||||
),
|
||||
body: Selector<ConnectivityProvider, String>(
|
||||
builder: (ctx, value, _) => value != 'offline'
|
||||
? _isLoading
|
||||
? Center(
|
||||
child: CircularProgressIndicator(),
|
||||
)
|
||||
: Form(
|
||||
key: _form,
|
||||
child: ListView(
|
||||
padding: EdgeInsets.symmetric(horizontal: 20),
|
||||
children: <Widget>[
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(vertical: 20),
|
||||
child: Text(
|
||||
'CHANGE PASSWORD',
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 6 * _deviceBlockSize,
|
||||
letterSpacing: 3,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
),
|
||||
TextFormField(
|
||||
validator: (value) {
|
||||
if (value.isEmpty) {
|
||||
return 'Password is required.';
|
||||
}
|
||||
if (value.length < 8) {
|
||||
return 'Password at least is 8 characters.';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
obscureText: _hidePass,
|
||||
controller: passwordController,
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(
|
||||
FontAwesomeIcons.starOfLife,
|
||||
size: 6 * _deviceBlockSize,
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
fontWeight: FontWeight.w100,
|
||||
fontSize: 4 * _deviceBlockSize,
|
||||
),
|
||||
labelText: 'Password',
|
||||
isDense: true,
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 2, horizontal: 3),
|
||||
suffixIcon: InkWell(
|
||||
child: Icon(FontAwesomeIcons.eye),
|
||||
onTap: () {
|
||||
setState(() {
|
||||
_hidePass = !_hidePass;
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
textInputAction: TextInputAction.done,
|
||||
onFieldSubmitted: (_) {
|
||||
_sendRePass();
|
||||
},
|
||||
keyboardType: TextInputType.visiblePassword,
|
||||
),
|
||||
SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
TextFormField(
|
||||
validator: (value) {
|
||||
if (value.length < 8) {
|
||||
return 'Password at least is 8 characters.';
|
||||
}
|
||||
if (value != passwordController.text) {
|
||||
return 'Password doesnt match!';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
obscureText: _hideRePass,
|
||||
controller: rePasswordController,
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(
|
||||
FontAwesomeIcons.starOfLife,
|
||||
size: 6 * _deviceBlockSize,
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
fontWeight: FontWeight.w100,
|
||||
fontSize: 4 * _deviceBlockSize,
|
||||
),
|
||||
labelText: 'Confirm Password',
|
||||
isDense: true,
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 2, horizontal: 3),
|
||||
suffixIcon: InkWell(
|
||||
child: Icon(FontAwesomeIcons.eye),
|
||||
onTap: () {
|
||||
setState(() {
|
||||
_hideRePass = !_hideRePass;
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
textInputAction: TextInputAction.done,
|
||||
onFieldSubmitted: (_) {
|
||||
_sendRePass();
|
||||
},
|
||||
keyboardType: TextInputType.visiblePassword,
|
||||
),
|
||||
SizedBox(height: 40),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
InkWell(
|
||||
onTap: () => _sendRePass(),
|
||||
child: Container(
|
||||
width: 40 * _deviceBlockSize,
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 5 * _deviceBlockSize,
|
||||
vertical: 10,
|
||||
),
|
||||
// margin:
|
||||
// EdgeInsets.symmetric(horizontal: 35, vertical: 15),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: [Colors.blue, Colors.green],
|
||||
),
|
||||
borderRadius: BorderRadius.circular(7),
|
||||
),
|
||||
child: Text(
|
||||
'Change',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
return SafeArea(
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
centerTitle: true,
|
||||
title: Text('CSSD'),
|
||||
),
|
||||
body: Selector<ConnectivityProvider, String>(
|
||||
builder: (ctx, value, _) => value != 'offline'
|
||||
? _isLoading
|
||||
? Center(
|
||||
child: CircularProgressIndicator(),
|
||||
)
|
||||
: Form(
|
||||
key: _form,
|
||||
child: ListView(
|
||||
padding: EdgeInsets.symmetric(horizontal: 20),
|
||||
children: <Widget>[
|
||||
Container(
|
||||
padding: EdgeInsets.symmetric(vertical: 20),
|
||||
child: Text(
|
||||
'CHANGE PASSWORD',
|
||||
textAlign: TextAlign.left,
|
||||
style: TextStyle(
|
||||
color: Colors.black,
|
||||
fontSize: 6 * _deviceBlockSize,
|
||||
letterSpacing: 3,
|
||||
fontWeight: FontWeight.w700,
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
],
|
||||
),
|
||||
)
|
||||
: ConnectionErrorBox(),
|
||||
selector: (_, connectivity) => connectivity.conStatus,
|
||||
));
|
||||
),
|
||||
TextFormField(
|
||||
validator: (value) {
|
||||
if (value.isEmpty) {
|
||||
return 'Password is required.';
|
||||
}
|
||||
if (value.length < 8) {
|
||||
return 'Password at least is 8 characters.';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
obscureText: _hidePass,
|
||||
controller: passwordController,
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(
|
||||
FontAwesomeIcons.starOfLife,
|
||||
size: 6 * _deviceBlockSize,
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
fontWeight: FontWeight.w100,
|
||||
fontSize: 4 * _deviceBlockSize,
|
||||
),
|
||||
labelText: 'Password',
|
||||
isDense: true,
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 2, horizontal: 3),
|
||||
suffixIcon: InkWell(
|
||||
child: Icon(FontAwesomeIcons.eye),
|
||||
onTap: () {
|
||||
setState(() {
|
||||
_hidePass = !_hidePass;
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
textInputAction: TextInputAction.done,
|
||||
onFieldSubmitted: (_) {
|
||||
_sendRePass();
|
||||
},
|
||||
keyboardType: TextInputType.visiblePassword,
|
||||
),
|
||||
SizedBox(
|
||||
height: 30,
|
||||
),
|
||||
TextFormField(
|
||||
validator: (value) {
|
||||
if (value.length < 8) {
|
||||
return 'Password at least is 8 characters.';
|
||||
}
|
||||
if (value != passwordController.text) {
|
||||
return 'Password doesnt match!';
|
||||
}
|
||||
return null;
|
||||
},
|
||||
obscureText: _hideRePass,
|
||||
controller: rePasswordController,
|
||||
decoration: InputDecoration(
|
||||
icon: Icon(
|
||||
FontAwesomeIcons.starOfLife,
|
||||
size: 6 * _deviceBlockSize,
|
||||
),
|
||||
labelStyle: TextStyle(
|
||||
fontWeight: FontWeight.w100,
|
||||
fontSize: 4 * _deviceBlockSize,
|
||||
),
|
||||
labelText: 'Confirm Password',
|
||||
isDense: true,
|
||||
contentPadding: EdgeInsets.symmetric(
|
||||
vertical: 2, horizontal: 3),
|
||||
suffixIcon: InkWell(
|
||||
child: Icon(FontAwesomeIcons.eye),
|
||||
onTap: () {
|
||||
setState(() {
|
||||
_hideRePass = !_hideRePass;
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.w700,
|
||||
fontSize: 5 * _deviceBlockSize,
|
||||
),
|
||||
textInputAction: TextInputAction.done,
|
||||
onFieldSubmitted: (_) {
|
||||
_sendRePass();
|
||||
},
|
||||
keyboardType: TextInputType.visiblePassword,
|
||||
),
|
||||
SizedBox(height: 40),
|
||||
Row(
|
||||
children: <Widget>[
|
||||
InkWell(
|
||||
onTap: () => _sendRePass(),
|
||||
child: Container(
|
||||
width: 40 * _deviceBlockSize,
|
||||
padding: EdgeInsets.symmetric(
|
||||
horizontal: 5 * _deviceBlockSize,
|
||||
vertical: 10,
|
||||
),
|
||||
// margin:
|
||||
// EdgeInsets.symmetric(horizontal: 35, vertical: 15),
|
||||
decoration: BoxDecoration(
|
||||
gradient: LinearGradient(
|
||||
colors: [Colors.blue, Colors.green],
|
||||
),
|
||||
borderRadius: BorderRadius.circular(7),
|
||||
),
|
||||
child: Text(
|
||||
'Change',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
),
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
),
|
||||
),
|
||||
Spacer(),
|
||||
],
|
||||
),
|
||||
SizedBox(height: 10),
|
||||
],
|
||||
),
|
||||
)
|
||||
: ConnectionErrorBox(),
|
||||
selector: (_, connectivity) => connectivity.conStatus,
|
||||
)),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user