I have solved an issue thanks to stack overflow..but now getting another issue when i open keyboard it shwoing pixel overflow..i wrap column into Singlechild scroll view but not working…
class HomeScreen extends StatelessWidget {
const HomeScreen({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return SafeArea(child: Scaffold(
body: Column(children: [
Center(child: TextField()),
Container(
height: 200,
color: Colors.green,
child: Center(child: Text('B')),
),
Container(
height: 200,
color: Colors.blue,
child: Center(child: Text('C')),
),
Container(
height: 200,
color: Colors.blue,
child: Center(child: Text('C')),
),
Expanded(child: buildShowListView())
],),
));
}
Widget buildShowListView()
{
return Column(children: [
Text('Showing Data 100'),
Expanded(
child: ListView.builder(
itemCount: 100,
itemBuilder: (context,index){
return Text('$index');
}),
)
],);
}
}
2
Answers
Add shrinkWrap: true, It will solve your problem
It is possible the screen height is smaller. We can calculate height
Container(height:100*4)=> 400 + 48 + textHeight
is having less height when keyboard is visible. You can use ListView on top widget instead.And
buildShowListView