Flutter: A white screen is displayed when the number of BottomNavigationBar exceeds 3

Flutter: When the number of BottomNavigationBar exceeds 3, a white screen is displayed.
Insert picture description here
Here we use 4 BottomNavigationBar, and the bottom of the interface is found to be white at runtime.
Insert picture description here
Through the source code, we can find that when the number is less than or equal to 3, the theme color will be used in fixed mode by default. At 3, white is used in shifting mode by default.
Insert picture description here
If it only needs to be displayed, we can use the selectedItemColor property and the unselectedItemColor property to set the color, and modify the BottomNavigationBarType to fiexd mode.

Successfully displayed after running again.

Guess you like

Origin blog.csdn.net/weixin_46005137/article/details/107049867