manofi21
8/30/2019 - 5:50 PM

how to show textformfield in flutter

how to show textformfield in flutter

import 'package:flutter/material.dart';

void main() => runApp(MyApp());

//textfield sebuah widget yang digunakan user untuk memasukkan kalimat
class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  TextEditingController controller = TextEditingController();
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text("text field"),
        ),
        body: Column(
          children: <Widget>[
            TextFormField(
                decoration: InputDecoration(
              labelText: 'Name *',
            ))
          ],
        ),
      ),
    );
  }
}