Advertisement
Guest User

Untitled

a guest
Nov 24th, 2018
349
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 2.18 KB | None | 0 0
  1. @override
  2.   Widget build(BuildContext context) {
  3.     _ctx = context;
  4.     var loginBtn = new RaisedButton(
  5.       onPressed: _submit,
  6.       child: new Text("LOGIN"),
  7.       color: Colors.primaries[0],
  8.     );
  9.     var loginForm = new Column(
  10.       children: <Widget>[
  11.         new Text(
  12.           "Login App",
  13.           textScaleFactor: 2.0,
  14.         ),
  15.         new Form(
  16.           key: formKey,
  17.           child: new Column(
  18.             children: <Widget>[
  19.               new Padding(
  20.                 padding: const EdgeInsets.all(8.0),
  21.                 child: new TextFormField(
  22.                   onSaved: (val) => _username = val,
  23.                   validator: (val) {
  24.                     return val.length < 10
  25.                         ? "Username must have atleast 10 chars"
  26.                         : null;
  27.                   },
  28.                   decoration: new InputDecoration(labelText: "Username"),
  29.                 ),
  30.               ),
  31.               new Padding(
  32.                 padding: const EdgeInsets.all(8.0),
  33.                 child: new TextFormField(
  34.                   onSaved: (val) => _password = val,
  35.                   decoration: new InputDecoration(labelText: "Password"),
  36.                 ),
  37.               ),
  38.             ],
  39.           ),
  40.         ),
  41.         _isLoading ? new CircularProgressIndicator() : loginBtn
  42.       ],
  43.       crossAxisAlignment: CrossAxisAlignment.center,
  44.     );
  45.  
  46.     return new Scaffold(
  47.       appBar: null,
  48.       key: scaffoldKey,
  49.       body: new Container(
  50.         decoration: new BoxDecoration(
  51.           image: new DecorationImage(
  52.               image: new AssetImage("assets/login_background.jpg"),
  53.               fit: BoxFit.cover),
  54.         ),
  55.         child: new Center(
  56.           child: new ClipRect(
  57.             child: new BackdropFilter(
  58.               filter: new ImageFilter.blur(sigmaX: 10.0, sigmaY: 10.0),
  59.               child: new Container(
  60.                 child: loginForm,
  61.                 height: 300.0,
  62.                 width: 300.0,
  63.                 decoration: new BoxDecoration(
  64.                     color: Colors.grey.shade200.withOpacity(0.5)),
  65.               ),
  66.             ),
  67.           ),
  68.         ),
  69.       ),
  70.     );
  71.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement