@override Widget build(BuildContext context) { return Scaffold( resizeToAvoidBottomInset: false,
body: Container(
padding: EdgeInsets.only(bottom: 30),
child: Column(
children: <Widget>[
HeaderContainer("Login"),
Expanded(
flex: 1,
child: Container(
margin: EdgeInsets.only(left: 20, right: 20, top: 30),
child: Column(
mainAxisSize: MainAxisSize.max,
children: <Widget>[
_textInput( controller: _emailcontroller, hint: "Email", icon: Icons.email),
_textInput( controller: _passwordcontroller,hint: "Password", icon: Icons.vpn_key),
Container(
margin: EdgeInsets.only(top: 10),
alignment: Alignment.centerRight,
child: Text(
"Forgot Password?",
),
),
Expanded(
child: Center(
child: ButtonWidget(
onClick: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => IntroPage()));
},
btnText: "LOGIN",
),
),
),
RichText(
text: TextSpan(children: [
TextSpan(
text: "Don't have an account ? ",
style: TextStyle(color: Colors.black)),
TextSpan(
text: "Register",
style: TextStyle(color: redColors),
recognizer: TapGestureRecognizer()
..onTap= () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => RegPage()));
},
),
]),
)
],
),
),
)
],
),
),
);
}
小部件_textInput({控制器,提示,图标}){返回容器(边距:EdgeInsets.only(顶部:10),装饰:BoxDecoration(borderRadius:BorderRadius.all(Radius.circular(20)),颜色:Colors.white, ), padding: EdgeInsets.only(left: 10), child: TextFormField(controller: controller, decoration: InputDecoration(border: InputBorder.none, hintText: hint, prefixIcon: Icon(icon), ), ), ); } }