I want to redirect to another page after the future is resolved, this is a code sample of what I want
- FutureBuilder(
- future: _bloc.formResponse,
- builder: (context,AsyncSnapshot<Result> snapshot){
- if(snapshot.hasData){
- Navigator.pushNamed(context, "/home");
- }
- return _buildSignUpPage();
- }
- )
but the previous code returns an exception
- I/flutter (29158): ══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞═════════════════════════════════════════════
- I/flutter (29158): The following assertion was thrown building FutureBuilder<Result>(dirty, state:
- I/flutter (29158): _FutureBuilderState<Result>#de36b):
- I/flutter (29158): setState() or markNeedsBuild() called during build.
--
You received this message because you are subscribed to the Google Groups "Flutter Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flutter-dev...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.