Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import 'package:flutter/material.dart';
- class LoginScreen extends StatefulWidget {
- @override
- createState() {
- return LoginScreenState();
- }
- }
- class LoginScreenState extends State<LoginScreen> {
- final reset = GlobalKey<FormState>();
- @override
- Widget build(context) {
- // TODO: implement build
- return Container(
- margin: EdgeInsets.all(20),
- child: Form(
- key: reset,
- child: Column(
- children: <Widget>[
- emailField(),
- passwordField(),
- Container(margin: EdgeInsets.only(top: 25),),
- submitButton(),
- ],
- ),
- ),
- );
- }
- Widget emailField() {
- return TextField(
- keyboardType: TextInputType.emailAddress,
- decoration: InputDecoration(
- labelText: 'Email',
- hintText: 'you@example.com',
- ),
- );
- }
- Widget passwordField() {
- return TextField(
- decoration: InputDecoration(
- labelText: 'Enter Pass',
- hintText: 'Password',
- ),
- );
- }
- Widget submitButton() {
- return RaisedButton(
- color: Colors.blue.shade400,
- child: Text('Войти'),
- onPressed: () {
- reset.currentState.reset();
- },
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement