I have tried resizeToAvoidBottomInset: false , as a solution, but it doesn't work. When the keyboard is open, the bottom navigation bar still sticks to the top of the keyboard. How can I stop this? The code for the bottom navigation bar is given below. How can I fix this?
@override
Widget build(BuildContext context) {
return Scaffold(
resizeToAvoidBottomInset: false,
key: _scaffoldKey,
bottomNavigationBar: Theme(
data: ThemeData(
canvasColor: Color.fromARGB(255, 0, 0, 0),
),
child: BottomNavigationBar(
type: BottomNavigationBarType.fixed,
iconSize: 30,
items: <BottomNavigationBarItem>[
BottomNavigationBarItem(
icon: Text(
currentDay.toString(),
style: TextStyle(
fontSize: 22,
fontWeight: FontWeight.w700,
color: _currentIndex == 0 ? Colors.blue : Colors.white,
),
),
label: '',
),
BottomNavigationBarItem(
icon: Icon(Icons.folder),
label: '',
),
BottomNavigationBarItem(
icon: Icon(Icons.add),
label: '',
),
BottomNavigationBarItem(
icon: Icon(Icons.list),
label: '',
),
BottomNavigationBarItem(
icon: Icon(Icons.person),
label: '',
),
],
selectedItemColor: Colors.blue, // Color of the selected item
unselectedItemColor: Colors.white, // Color of unselected items
currentIndex: _currentIndex,
onTap: (int index) {
setState(() {
_currentIndex = index;
});
},
),
),
);
}
I've reproduced your code and everything is working fine. Can you give some more details about the body of the Scaffold? What kind of Widget is used? Furthermore, what kind of device is used?
My solution with
TextFormFieldworks fine. When focus is moved to the input field. TheBottomNavigationBarremains in the bottom area.