Advertisement
Guest User

Untitled

a guest
Aug 31st, 2018
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 2.56 KB | None | 0 0
  1. import 'package:flutter/material.dart';
  2.  
  3. class Login extends StatefulWidget {
  4.   @override
  5.   _LoginState createState() => _LoginState();
  6. }
  7.  
  8. class _LoginState extends State<Login> {
  9.   final _formKey = GlobalKey<FormState>();
  10.  
  11.   @override
  12.   Widget build(BuildContext context) {
  13.     return Column(
  14.       crossAxisAlignment: CrossAxisAlignment.stretch,
  15.       children: <Widget>[
  16.         Expanded(
  17.           flex: 3,
  18.           child: Container(
  19.             padding: EdgeInsets.all(18.0),
  20.             width: 120.0,
  21.             color: Theme.of(context).primaryColorLight,
  22.               child: Form(
  23.                   autovalidate: false,
  24.                   key: _formKey,
  25.                   child: Column(
  26.                     mainAxisAlignment: MainAxisAlignment.start, // all from top
  27.  
  28.                     children: <Widget>[
  29.                       // email field
  30.                       TextFormField(
  31.                         keyboardType: TextInputType.emailAddress,
  32.                         style: TextStyle(
  33.                             fontSize: 20.0,
  34.                             color: Theme.of(context).primaryColor),
  35.                         maxLines: 1,
  36.                         autocorrect: false,
  37.                         enabled: true,
  38.                         decoration: InputDecoration(
  39.                           border: OutlineInputBorder(
  40.                               borderRadius:
  41.                                   BorderRadius.all(Radius.circular(15.0)),
  42.                               borderSide: BorderSide(
  43.                                   width: 4.0,
  44.                                   color: Theme.of(context).primaryColorDark,
  45.                                   style: BorderStyle.none)),
  46.                           filled: true,
  47.                           fillColor: Color.fromRGBO(255, 255, 255, 100.0),
  48.                           contentPadding: EdgeInsets.only(left: 20.0),
  49.                           suffixIcon: Icon(Icons.email,
  50.                               color: Theme.of(context).primaryColor),
  51.                           labelText: 'email',
  52.                         ),
  53.                         validator: (value) {
  54.                           if (value.isEmpty) {
  55.                             return 'Please enter some text';
  56.                           }
  57.                         },
  58.                       ),
  59.                       // TODO: password field
  60.                     ],
  61.                   )),
  62.           ),
  63.         ),
  64.         Expanded(
  65.             flex: 2, child: Container(color: Colors.red, child: Text('loren ipsum'))),
  66.       ],
  67.     );
  68.   }
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement