Advertisement
wildanfuady

Untitled

Oct 14th, 2019
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.90 KB | None | 0 0
  1. import 'package:flutter/material.dart';
  2.  
  3. class TextFieldExample extends StatelessWidget {
  4.  
  5. final _formKey = GlobalKey<FormState>();
  6. @override
  7. Widget build(BuildContext context){
  8. return Scaffold(
  9. appBar: AppBar(
  10. title: Text('Text Field Example'),
  11. ),
  12. body: Form(
  13. key: _formKey,
  14. child: Padding(
  15. padding: const EdgeInsets.all(8.0),
  16. child: Column(
  17. children: <Widget>[
  18. Expanded(
  19. child: TextFormField(
  20. textInputAction: TextInputAction.next,
  21. decoration: const InputDecoration(
  22. icon: Icon(Icons.person),
  23. labelText: 'Nama Siswa',
  24. hintText: 'Masukan nama siswa',
  25. ),
  26. ),
  27. ),
  28. TextFormField(
  29. textInputAction: TextInputAction.next,
  30. decoration: const InputDecoration(
  31. icon: Icon(Icons.phone),
  32. labelText: 'Telp',
  33. hintText: '08-- ---- ----',
  34. ),
  35. ),
  36. TextFormField(
  37. textInputAction: TextInputAction.next,
  38. decoration: const InputDecoration(
  39. icon: Icon(Icons.email),
  40. labelText: 'Email',
  41. hintText: 'email@example.com',
  42. ),
  43. ),
  44. TextFormField(
  45. textInputAction: TextInputAction.next,
  46. keyboardType: TextInputType.multiline,
  47. maxLines: 3,
  48. decoration: const InputDecoration(
  49. icon: Icon(Icons.location_city),
  50. labelText: 'Alamat',
  51. hintText: 'Alamat rumah / domisili Anda',
  52. ),
  53. ),
  54. ],
  55. ),
  56. ),
  57. ),
  58. );
  59. }
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement