Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import 'package:flutter/material.dart';
- class Login extends StatefulWidget {
- @override
- _LoginState createState() => _LoginState();
- }
- class _LoginState extends State<Login> {
- final _formKey = GlobalKey<FormState>();
- @override
- Widget build(BuildContext context) {
- return Column(
- crossAxisAlignment: CrossAxisAlignment.stretch,
- children: <Widget>[
- Expanded(
- flex: 3,
- child: Container(
- padding: EdgeInsets.all(18.0),
- width: 120.0,
- color: Theme.of(context).primaryColorLight,
- child: Form(
- autovalidate: false,
- key: _formKey,
- child: Column(
- mainAxisAlignment: MainAxisAlignment.start, // all from top
- children: <Widget>[
- // email field
- TextFormField(
- keyboardType: TextInputType.emailAddress,
- style: TextStyle(
- fontSize: 20.0,
- color: Theme.of(context).primaryColor),
- maxLines: 1,
- autocorrect: false,
- enabled: true,
- decoration: InputDecoration(
- border: OutlineInputBorder(
- borderRadius:
- BorderRadius.all(Radius.circular(15.0)),
- borderSide: BorderSide(
- width: 4.0,
- color: Theme.of(context).primaryColorDark,
- style: BorderStyle.none)),
- filled: true,
- fillColor: Color.fromRGBO(255, 255, 255, 100.0),
- contentPadding: EdgeInsets.only(left: 20.0),
- suffixIcon: Icon(Icons.email,
- color: Theme.of(context).primaryColor),
- labelText: 'email',
- ),
- validator: (value) {
- if (value.isEmpty) {
- return 'Please enter some text';
- }
- },
- ),
- // TODO: password field
- ],
- )),
- ),
- ),
- Expanded(
- flex: 2, child: Container(color: Colors.red, child: Text('loren ipsum'))),
- ],
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement