import 'package:flutter/material.dart'; class LoginScreen extends StatefulWidget { static String tag = 'login-page'; @override _LoginScreenState createState() => new _LoginScreenState(); } class _LoginScreenState extends State { @override Widget build(BuildContext context) { final email = TextFormField( keyboardType: TextInputType.emailAddress, autofocus: false, validator: (value) { if (value.isEmpty) { return 'This field is required'; } }, decoration: InputDecoration( labelText: 'Email', contentPadding: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), ), ); final password = TextFormField( autofocus: false, obscureText: true, decoration: InputDecoration( labelText: 'Password', contentPadding: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), ), ); final loginButton = Padding( padding: EdgeInsets.symmetric(vertical: 16.0), child: Material( //borderRadius: BorderRadius.circular(30.0), shadowColor: Colors.lightBlueAccent.shade100, elevation: 5.0, child: MaterialButton( minWidth: 200.0, height: 42.0, onPressed: () { //Navigator.of(context).pushNamed(HomeScreen.tag); }, color: Colors.lightBlueAccent, child: Text('Log In', style: TextStyle(color: Colors.white)), ), ), ); /* final forgotLabel = FlatButton( child: Text( 'Forgot password?', style: TextStyle(color: Colors.black54), ), onPressed: () {}, ); */ return Scaffold( //backgroundColor: Colors.white, body: Center( child: ListView( shrinkWrap: true, padding: EdgeInsets.only(left: 24.0, right: 24.0), children: [ SizedBox(height: 48.0), email, SizedBox(height: 8.0), password, SizedBox(height: 24.0), loginButton, //forgotLabel ], ), ), ); } }