Home > Net >  setState() or markNeedsBuild() called during build error for FutureBuilder
setState() or markNeedsBuild() called during build error for FutureBuilder

Time:10-27

for my BottomNavigator Bar I am using Getx navigation like this:

else if (selectedPage == 3) {
   
      Get.to(VideoViewDetail(id: '1465'));

but I am getting following error:

The following assertion was thrown building FutureBuilder(dirty, state: _FutureBuilderState#03585): setState() or markNeedsBuild() called during build.

any help?

CodePudding user response:

As described in this answer, use

Future.microtask(() => Get.to(VideoViewDetail(id: '1465')));
  • Related