Errata for Flutter Apprentice 4th Edition

Creating this topic to catch any typos and bugs in the 4th Edition of Flutter Apprentice.

General issue - You are applying Flutter’s app_plugin_loader Gradle plugin imperatively using the apply script method, which is deprecated and will be removed in a future release.

I see that the code has not yet been migrated according to Deprecated imperative apply of Flutter's Gradle plugins | Flutter. I just loaded chapter 7 (that’s where I was in the 3rd edition) and I haven’t check the previous chapters.

I am running Flutter 3.19.3 and trying to get it started on Android.

Thanks for reporting this.

This has been introduced after Flutter 3.16, which we based the book on.
The app still works so it’s not a “blocking” issue per se, but the only solution is to follow the instructions here Deprecated imperative apply of Flutter's Gradle plugins | Flutter

auth.dart in chapters 8 and 9 on Github contain ChangeNotifier and notifyListeners(), but they are redundant.

The code doesn’t seem to use any of those, the class does not need to extend ChangeNotifier here, nor is it mentioned in the chapter.

EDIT: also, the variable _loggedIn is completely unnecessary here, it is set multiple times, but never used, you are not actually returning it anywhere. In fact, the return statement could be removed from the signIn() method, and it can be changed to Future<void> like it is in signOut().

Chapter 8, page 294:

You should use goNamed() instead of go() as it’s error-prone, and the actual URI format can change over time.

Then at the end of the chapter (Key Points):

With GoRouter, you navigate to other routes using goNamed() instead of go()

Yet you used go() throughout the whole chapter, and goNamed isn’t used anywhere in the book.