Advertisement
wildanfuady

Login Layout

Oct 13th, 2019
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 KB | None | 0 0
  1. import 'package:flutter/material.dart';
  2.  
  3. class LoginExample extends StatelessWidget {
  4.  
  5. final GlobalKey<FormState> _formKey = new GlobalKey<FormState>();
  6.  
  7. @override
  8. Widget build(BuildContext context) {
  9. final Size screenSize = MediaQuery.of(context).size;
  10.  
  11. return new Scaffold(
  12. appBar: new AppBar(
  13. title: new Text('Login'),
  14. ),
  15. body: new Container(
  16. padding: new EdgeInsets.all(20.0),
  17. child: new Form(
  18. key: this._formKey,
  19. child: new ListView(
  20. children: <Widget>[
  21. new TextFormField(
  22. keyboardType: TextInputType.emailAddress, // Use email input type for emails.
  23. decoration: new InputDecoration(
  24. hintText: 'you@example.com',
  25. labelText: 'E-mail Address'
  26. )
  27. ),
  28. new TextFormField(
  29. obscureText: true, // Use secure text for passwords.
  30. decoration: new InputDecoration(
  31. hintText: 'Password',
  32. labelText: 'Enter your password'
  33. )
  34. ),
  35. new Container(
  36. width: screenSize.width,
  37. child: new RaisedButton(
  38. child: new Text(
  39. 'Login',
  40. style: new TextStyle(
  41. color: Colors.white
  42. ),
  43. ),
  44. onPressed: () => null,
  45. color: Colors.blue,
  46. ),
  47. margin: new EdgeInsets.only(
  48. top: 20.0
  49. ),
  50. )
  51. ],
  52. ),
  53. )
  54. ),
  55. );
  56. }
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement