@@ -186,53 +186,57 @@ class _MainPageState extends ConsumerState<MainPage>
186186 mobileWidget: Column (
187187 children: [
188188 Expanded (child: widget.child ?? const SizedBox ()),
189- FBottomNavigationBar (
190- index: selected.value,
191- onChange: (value) {
192- if (widget.child != null ) {
193- widget.child! .goBranch (value);
194- }
195- selected.value = value;
196- },
197- children: [
198- FBottomNavigationBarItem (
199- label: Text (_navItems[0 ].text.i18n),
200- icon: HomeIcon (
201- color: selected.value == 0
202- ? themeData.colors.primary
203- : themeData.colors.mutedForeground,
204- isTriggered: selected.value == 0 ,
189+ // Hide the bottom navigation bar when the keyboard is open to
190+ // prevent its solid background from appearing as a black box
191+ // above the keyboard.
192+ if (MediaQuery .viewInsetsOf (context).bottom == 0 )
193+ FBottomNavigationBar (
194+ index: selected.value,
195+ onChange: (value) {
196+ if (widget.child != null ) {
197+ widget.child! .goBranch (value);
198+ }
199+ selected.value = value;
200+ },
201+ children: [
202+ FBottomNavigationBarItem (
203+ label: Text (_navItems[0 ].text.i18n),
204+ icon: HomeIcon (
205+ color: selected.value == 0
206+ ? themeData.colors.primary
207+ : themeData.colors.mutedForeground,
208+ isTriggered: selected.value == 0 ,
209+ ),
205210 ),
206- ),
207- FBottomNavigationBarItem (
208- label : Text (_navItems[ 1 ].text.i18n),
209- icon : CompassIcon (
210- color : selected.value == 1
211- ? themeData.colors.primary
212- : themeData.colors.mutedForeground ,
213- isTriggered : selected.value == 1 ,
211+ FBottomNavigationBarItem (
212+ label : Text (_navItems[ 1 ].text.i18n),
213+ icon : CompassIcon (
214+ color : selected.value == 1
215+ ? themeData.colors.primary
216+ : themeData.colors.mutedForeground,
217+ isTriggered : selected.value == 1 ,
218+ ) ,
214219 ),
215- ),
216- FBottomNavigationBarItem (
217- label : Text (_navItems[ 2 ].text.i18n),
218- icon : BlocksPathLoopIcon (
219- color : selected.value == 2
220- ? themeData.colors.primary
221- : themeData.colors.mutedForeground ,
222- isTriggered : selected.value == 2 ,
220+ FBottomNavigationBarItem (
221+ label : Text (_navItems[ 2 ].text.i18n),
222+ icon : BlocksPathLoopIcon (
223+ color : selected.value == 2
224+ ? themeData.colors.primary
225+ : themeData.colors.mutedForeground,
226+ isTriggered : selected.value == 2 ,
227+ ) ,
223228 ),
224- ),
225- FBottomNavigationBarItem (
226- label : Text (_navItems[ 3 ].text.i18n),
227- icon : SettingsIcon (
228- color : selected.value == 3
229- ? themeData.colors.primary
230- : themeData.colors.mutedForeground ,
231- isTriggered : selected.value == 3 ,
229+ FBottomNavigationBarItem (
230+ label : Text (_navItems[ 3 ].text.i18n),
231+ icon : SettingsIcon (
232+ color : selected.value == 3
233+ ? themeData.colors.primary
234+ : themeData.colors.mutedForeground,
235+ isTriggered : selected.value == 3 ,
236+ ) ,
232237 ),
233- ),
234- ],
235- ),
238+ ],
239+ ),
236240 ],
237241 ),
238242 desktopWidget: FScaffold (
0 commit comments