Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import 'package:flutter/material.dart';
- import 'package:grouped_buttons/grouped_buttons.dart';
- class FormExample extends StatelessWidget {
- final GlobalKey<FormState> _formKey = new GlobalKey<FormState>();
- @override
- Widget build(BuildContext context) {
- final Size screenSize = MediaQuery.of(context).size;
- return new Scaffold(
- appBar: new AppBar(
- title: new Text('Form Example '),
- ),
- body: new Container(
- padding: new EdgeInsets.all(20.0),
- child: new Form(
- key: this._formKey,
- child: new ListView(
- children: <Widget>[
- new TextFormField(
- keyboardType: TextInputType.text, // Use email input type for emails.
- decoration: new InputDecoration(
- hintText: 'Enter your name',
- labelText: 'Name'
- )
- ),
- new TextFormField(
- keyboardType: TextInputType.phone, // Use email input type for emails.
- decoration: new InputDecoration(
- hintText: '0*** **** ****',
- labelText: 'Telp'
- )
- ),
- new TextFormField(
- keyboardType: TextInputType.emailAddress, // Use email input type for emails.
- decoration: new InputDecoration(
- hintText: 'email@example.com',
- labelText: 'E-mail'
- )
- ),
- new TextFormField(
- obscureText: true, // Use secure text for passwords.
- decoration: new InputDecoration(
- hintText: 'Enter your password',
- labelText: 'Password'
- )
- ),
- new TextFormField(
- obscureText: true, // Use secure text for passwords.
- decoration: new InputDecoration(
- hintText: 'Enter your age',
- labelText: 'Age'
- )
- ),
- new TextFormField(
- obscureText: true,
- keyboardType: TextInputType.multiline,
- maxLines: 3,
- decoration: new InputDecoration(
- hintText: 'Enter your address',
- labelText: 'Address'
- )
- ),
- new Container(
- width: screenSize.width,
- child: new RaisedButton(
- child: new Text(
- 'Simpan',
- style: new TextStyle(
- color: Colors.white
- ),
- ),
- onPressed: () => null,
- color: Colors.blue,
- ),
- margin: new EdgeInsets.only(
- top: 20.0
- ),
- )
- ],
- ),
- )
- ),
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement