You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to hide the bottomnavigation bar and getting the below error when I use Obx... Any idea how to fix this?
I/flutter ( 9567): ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════ I/flutter ( 9567): The following assertion was thrown building ValueListenableBuilder(dirty, dependencies: I/flutter ( 9567): [_LocalizationsScope-[GlobalKey#87424], _InheritedTheme], state: I/flutter ( 9567): _ValueListenableBuilderState#23ae3): I/flutter ( 9567): setState() or markNeedsBuild() called during build. I/flutter ( 9567): This Obx widget cannot be marked as needing to build because the framework is already in the process I/flutter ( 9567): of building widgets. A widget can be marked as needing to be built during the build phase only if I/flutter ( 9567): one of its ancestors is currently building. This exception is allowed because the framework builds I/flutter ( 9567): parent widgets before children, which means a dirty descendant will always be built. Otherwise, the I/flutter ( 9567): framework might not visit this widget during this build phase. I/flutter ( 9567): The widget on which setState() or markNeedsBuild() was called was: I/flutter ( 9567): Obx I/flutter ( 9567): The widget which was currently being built when the offending call was made was: I/flutter ( 9567): ValueListenableBuilder I/flutter ( 9567): I/flutter ( 9567): The relevant error-causing widget was: I/flutter ( 9567): Miniplayer
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I am trying to hide the bottomnavigation bar and getting the below error when I use Obx... Any idea how to fix this?
I/flutter ( 9567): ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═══════════════════════════════════════════════════════════ I/flutter ( 9567): The following assertion was thrown building ValueListenableBuilder(dirty, dependencies: I/flutter ( 9567): [_LocalizationsScope-[GlobalKey#87424], _InheritedTheme], state: I/flutter ( 9567): _ValueListenableBuilderState#23ae3): I/flutter ( 9567): setState() or markNeedsBuild() called during build. I/flutter ( 9567): This Obx widget cannot be marked as needing to build because the framework is already in the process I/flutter ( 9567): of building widgets. A widget can be marked as needing to be built during the build phase only if I/flutter ( 9567): one of its ancestors is currently building. This exception is allowed because the framework builds I/flutter ( 9567): parent widgets before children, which means a dirty descendant will always be built. Otherwise, the I/flutter ( 9567): framework might not visit this widget during this build phase. I/flutter ( 9567): The widget on which setState() or markNeedsBuild() was called was: I/flutter ( 9567): Obx I/flutter ( 9567): The widget which was currently being built when the offending call was made was: I/flutter ( 9567): ValueListenableBuilder I/flutter ( 9567): I/flutter ( 9567): The relevant error-causing widget was: I/flutter ( 9567): Miniplayer
Code for bottomnavigation
bottomNavigationBar: Container(
child: Obx(
() => !_videoController.showBottomNavigation.value
? SizedBox.shrink()
: BottomNavigationBar(
currentIndex: 0,
fixedColor: Colors.blue,
items: [
BottomNavigationBarItem(
icon: Icon(Icons.home),
label: 'Home',
),
BottomNavigationBarItem(
icon: Icon(Icons.mail),
label: 'Messages',
),
BottomNavigationBarItem(
icon: Icon(Icons.person),
label: 'Profile',
)
],
),
),
Beta Was this translation helpful? Give feedback.
All reactions