1

Right now I am working on the codelab step_02 from firebase-get-to-know-flutter. At step 5 "Add RSVP functionality", when running my app and pressing the "RSVP" Button on my phone, I always get the following error in the /lib/authentification.dart file "_AssertionError ('package:go_router/src/router.dart': Failed assertion: line 300 pos 12 : 'inherited != null': No GoRouter found in context)".

I made sure that I followed every instruction on this codelab to that point. Couldn't find that much on the internet, and didn't have that much ideas how to handle this, as the error is coming from a file that I didn't even touch so far.
Maybe someone has bumped into this error before and knows it's cause, or someone else has an idea what could be going wrong. Thanks for any help! Link to the codelab : https://firebase.google.com/codelabs/firebase-get-to-know-flutter#4

BBpy
  • 13
  • 2
  • I am going through the tutorial and can confirm; I just got this error as well. I suspect it has something to do with the fact that they have refactored the HomePage widget? – Philip Johnson Dec 23 '22 at 20:47

1 Answers1

1

They updated the code for this CodeLab two days ago, but have (apparently) not yet updated the instructions.

I encountered the same error but was able to solve it by copying over the main.dart, home_page.dart, and app_state.dart files from https://github.com/flutter/codelabs/tree/main/firebase-get-to-know-flutter/step_05/lib

The CodeLab instructions do not even admit to the existence of home_page.dart and app_state.dart. Reader beware!

Until they update the instructions, I advise you to simply read the codelab to get the "gist" of what they are doing, but copy over the files from the reference implementation rather than trying to do the edits manually. I do not think they are up to date.

Philip Johnson
  • 1,463
  • 2
  • 11
  • 20
  • wow thanks a lot! I thought I was up to date ... I'll follow your advice and see if it's working then. Hopefully they'll update the codelab soon. Thanks again ! – BBpy Dec 24 '22 at 00:38
  • Thank you Mr. Johnson! It actually solved the problem for me too – BBpy Dec 24 '22 at 00:50