Flutter 更改密码
我想使用mysql在我的应用程序中更改密码,但我不知道如何获取特定的登录id来更改密码我有一个仪表板,上面有卡,因此当我单击带有名称更改密码的卡时,它将重定向 对于这个页面,我使用mysql作为本地数据库Flutter 更改密码,flutter,Flutter,我想使用mysql在我的应用程序中更改密码,但我不知道如何获取特定的登录id来更改密码我有一个仪表板,上面有卡,因此当我单击带有名称更改密码的卡时,它将重定向 对于这个页面,我使用mysql作为本地数据库 Widget build(BuildContext context) { return Scaffold( resizeToAvoidBottomInset: false, appBar: AppBar( tit
Widget build(BuildContext context) {
return Scaffold(
resizeToAvoidBottomInset: false,
appBar: AppBar(
title: Text('Change Password'),
backgroundColor: Color(0xff083663),
),
body: Form(
key: _key,
child: Center(
child: Column(
children: <Widget>[
SizedBox(
height: 30.0,
),
Padding(
padding: EdgeInsets.symmetric(vertical: 16.0, horizontal: 16.0),
child: Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(
'Change Password',
style: TextStyle(
fontSize: 18.0, fontWeight: FontWeight.w900),
)
],
),
),
),
SizedBox(
height: 10.0,
),
//这是验证密码的字段
Padding(
padding: EdgeInsets.symmetric(vertical: 16.0, horizontal: 16.0),
child: TextFormField(
validator: (e) {
if (e.isEmpty) {
return "Verify Password";
}
return null;
},
onSaved: (e) => c3 = e,
keyboardType: TextInputType.number,
decoration: InputDecoration(
labelText: 'Verify Password',
suffixIcon: IconButton(
onPressed: showHide3,
icon: Icon(_secureText3
? Icons.visibility_off
: Icons.visibility),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Color(0xff083663),
)),
border: OutlineInputBorder()),
),
),
Padding(
padding: EdgeInsets.symmetric(vertical: 16.0, horizontal: 16.0),
child: Divider(),
),
SizedBox(
height: 20.0,
),
Container(
height: 50,
width: 250,
child: RaisedButton(
onPressed: () {
check();
},
color: Color(0xffb5171d),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(30.0))),
textColor: Colors.white,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Icon(
Icons.vpn_key,
color: Colors.white,
),
Text(
'Save Changes',
style: TextStyle(fontSize: 15),
),
SizedBox(
height: 20,
)
],
),
),
),
],
),
),
),
);
}
}
填充(
填充:边缘组。对称(垂直:16.0,水平:16.0),
子项:TextFormField(
验证人:(e){
如果(如isEmpty){
返回“验证密码”;
}
返回null;
},
保存:(e)=>c3=e,
键盘类型:TextInputType.number,
装饰:输入装饰(
labelText:“验证密码”,
后缀:图标按钮(
onPressed:showHide3,
图标:图标(_secureText3
?图标。可见性关闭
:图标。可见性),
),
enabledBorder:OutlineInputBorder(
边界边(
颜色:颜色(0xff083663),
)),
边框:OutlineInputBorder()),
),
),
填充物(
填充:边缘组。对称(垂直:16.0,水平:16.0),
子:分隔符(),
),
大小盒子(
身高:20.0,
),
容器(
身高:50,
宽度:250,
孩子:升起按钮(
已按下:(){
检查();
},
颜色:颜色(0xffb5171d),
形状:圆形矩形边框(
borderRadius:borderRadius.all(半径.圆形(30.0)),
textColor:Colors.white,
孩子:排(
mainAxisAlignment:mainAxisAlignment.center,
儿童:[
图标(
Icons.vpn_键,
颜色:颜色,白色,
),
正文(
“保存更改”,
样式:TextStyle(字体大小:15),
),
大小盒子(
身高:20,
)
],
),
),
),
],
),
),
),
);
}
}
Padding(
padding: EdgeInsets.symmetric(vertical: 16.0, horizontal: 16.0),
child: TextFormField(
validator: (e) {
if (e.isEmpty) {
return "Verify Password";
}
return null;
},
onSaved: (e) => c3 = e,
keyboardType: TextInputType.number,
decoration: InputDecoration(
labelText: 'Verify Password',
suffixIcon: IconButton(
onPressed: showHide3,
icon: Icon(_secureText3
? Icons.visibility_off
: Icons.visibility),
),
enabledBorder: OutlineInputBorder(
borderSide: BorderSide(
color: Color(0xff083663),
)),
border: OutlineInputBorder()),
),
),
Padding(
padding: EdgeInsets.symmetric(vertical: 16.0, horizontal: 16.0),
child: Divider(),
),
SizedBox(
height: 20.0,
),
Container(
height: 50,
width: 250,
child: RaisedButton(
onPressed: () {
check();
},
color: Color(0xffb5171d),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(30.0))),
textColor: Colors.white,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Icon(
Icons.vpn_key,
color: Colors.white,
),
Text(
'Save Changes',
style: TextStyle(fontSize: 15),
),
SizedBox(
height: 20,
)
],
),
),
),
],
),
),
),
);
}
}