Advertisement
Guest User

Untitled

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