Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import 'package:flutter/material.dart';
- class TextFieldExample extends StatelessWidget {
- final _formKey = GlobalKey<FormState>();
- @override
- Widget build(BuildContext context){
- return Scaffold(
- appBar: AppBar(
- title: Text('Text Field Example'),
- ),
- body: Form(
- key: _formKey,
- child: SingleChildScrollView(
- padding: const EdgeInsets.all(8.0),
- // child: Center(
- child: Column(
- mainAxisAlignment: MainAxisAlignment.start,
- crossAxisAlignment: CrossAxisAlignment.start,
- children: <Widget>[
- TextFormField(
- textInputAction: TextInputAction.next,
- decoration: const InputDecoration(
- icon: Icon(Icons.person),
- labelText: 'Nama Siswa',
- hintText: 'Masukan nama siswa',
- ),
- ),
- TextFormField(
- textInputAction: TextInputAction.next,
- decoration: const InputDecoration(
- icon: Icon(Icons.phone),
- labelText: 'Telp',
- hintText: '08-- ---- ----',
- ),
- ),
- TextFormField(
- textInputAction: TextInputAction.next,
- decoration: const InputDecoration(
- icon: Icon(Icons.email),
- labelText: 'Email',
- hintText: 'email@example.com',
- ),
- ),
- TextFormField(
- textInputAction: TextInputAction.next,
- keyboardType: TextInputType.multiline,
- maxLines: 3,
- decoration: const InputDecoration(
- icon: Icon(Icons.location_city),
- labelText: 'Alamat',
- hintText: 'Alamat rumah / domisili Anda',
- ),
- ),
- ],
- ),
- // ),
- ),
- ),
- );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement