I would not recommend using a TextField
in the bottom navigation bar, it is not thought to hold such elements.
What I would do instead is something like (:
class MyWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return SingleChildScrollView(
child: Colum(
children: [
// Your widgets
...
Spacer(),
TextField(
...
),
),
);
}
}
Here, Spacer
will push the TextField
to the bottom of the application. If you did not use a SingleChildScrollView
, you would get an overflow error since the keyboard would overlap the TextField
. However, with the SingleChildScrollView
the content will be made scrollable so there's no overlap.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…