如图:
项目需求需要实现以上效果
思路解析:
1 可以用dialog来实现
2 可以用一个新statfulWidget实现
因为不大熟悉dialog,故用了一个新的statefulWidget
来实现页面效果,直接上代码:
///
/// 功能:
/// 描述:设置密码弹框功能
/// crated by xudailong on 2020/3/10.
///
class MineDestorySetPwdPage extends StatefulWidget {
@override
_MineDestorySetPwdPageState createState() => _MineDestorySetPwdPageState();
}
class _MineDestorySetPwdPageState extends State<MineDestorySetPwdPage> {
String pwdData = '';
final GlobalKey<ScaffoldState> _scaffoldKey = GlobalKey<ScaffoldState>();
bool showError = false;
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.transparent, //把scaffold的背景色改成透明
body: Container(
color: MyColor.lightColor,
width: MediaQuery.of(context).size.width,
height: MediaQuery.of(context).size.height,
alignment