Just copy and past my source code:
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
// This widget is the root of your application.
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Render text after change input',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(),
);
}
}
class MyHomePage extends StatefulWidget {
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
TextEditingController inputController = TextEditingController();
var giveInput="";
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('Render text after change input'),
centerTitle: true,
),
body: Padding(
padding: const EdgeInsets.all(16.0),
child:Column(
children: [
Column(
children: <Widget>[
Center(
child: Container(
width: MediaQuery.of(context).size.width * 0.8,
height: 40,
child: TextField(
textAlign: TextAlign.center,
textAlignVertical: TextAlignVertical.bottom,
// controller: passwordController..text="omor06799",
decoration: InputDecoration(
border: OutlineInputBorder(),
labelText: 'Enter Input',
hintText: 'type input here',
),
autofocus: true,
onChanged: (text) {
setState(() {
giveInput=text;
print("First text field: $text");
});
},
)),
),
Container(
padding: EdgeInsets.all(10),
),
giveInput==null?Text("Your type input is :"):Text("your type input is : "+giveInput),
],
)
],
)
),
);
}
}
it will be worked 100%.
You can add `Container` and `ListView` in `Column`.
```dart
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
@override
void initState() {
// TODO: implement initState
super.initState();
}
@override
Widget build(BuildContext context) {
return MaterialApp(
debugShowCheckedModeBanner: false,
home: Scaffold(
appBar: AppBar(
title: Text("Demo App1"),
),
body: Column(
children: <Widget>[
Container(
height: 40.0,
child: Row(
children: <Widget>[
Container(
padding: EdgeInsets.all(4.0),
width: 100.0,
child: Text(
"Name",
style: TextStyle(fontSize: 18),
)),
Container(
padding: EdgeInsets.all(4.0),
width: 100.0,
child: Text(
"Age",
style: TextStyle(fontSize: 18),
)),
],
),
),
Expanded(
child: ListView.builder(
itemCount: 100,
itemBuilder: (BuildContext context, int index) {
return Row(
children: <Widget>[
Container(
padding: EdgeInsets.all(4.0),
width: 100.0,
child: Text(
"Name $index",
style: TextStyle(fontSize: 18),
)),
Container(
padding: EdgeInsets.all(4.0),
width: 100.0,
child: Text(
"Age $index",
style: TextStyle(fontSize: 18),
),
)
],
);
},
),
),
],
),
),
);
}
}
```