Advertisement
wildanfuady

Untitled

Oct 14th, 2019
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.08 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: SingleChildScrollView(
  15. padding: const EdgeInsets.all(8.0),
  16. // child: Center(
  17. child: Column(
  18. mainAxisAlignment: MainAxisAlignment.start,
  19. crossAxisAlignment: CrossAxisAlignment.start,
  20. children: <Widget>[
  21. TextFormField(
  22. textInputAction: TextInputAction.next,
  23. decoration: const InputDecoration(
  24. icon: Icon(Icons.person),
  25. labelText: 'Nama Siswa',
  26. hintText: 'Masukan nama siswa',
  27. ),
  28. ),
  29. TextFormField(
  30. textInputAction: TextInputAction.next,
  31. decoration: const InputDecoration(
  32. icon: Icon(Icons.phone),
  33. labelText: 'Telp',
  34. hintText: '08-- ---- ----',
  35. ),
  36. ),
  37. TextFormField(
  38. textInputAction: TextInputAction.next,
  39. decoration: const InputDecoration(
  40. icon: Icon(Icons.email),
  41. labelText: 'Email',
  42. hintText: 'email@example.com',
  43. ),
  44. ),
  45. TextFormField(
  46. textInputAction: TextInputAction.next,
  47. keyboardType: TextInputType.multiline,
  48. maxLines: 3,
  49. decoration: const InputDecoration(
  50. icon: Icon(Icons.location_city),
  51. labelText: 'Alamat',
  52. hintText: 'Alamat rumah / domisili Anda',
  53. ),
  54. ),
  55. ],
  56. ),
  57. // ),
  58. ),
  59. ),
  60. );
  61. }
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement