Errata for Flutter Apprentice 2nd Edition

Chapter 7 :arrow_right: Adding the log out capability

In the snippet bellow, for consistency : _selectedTab = 0; should be _selectedTab = FooderlichTab.explore;

void logout() {
  // 12
  _loggedIn = false;
  _onboardingComplete = false;
  _initialized = false;
  _selectedTab = 0;

  // 13
  initializeApp();
  // 14
  notifyListeners();
}
1 Like

From mitai

Chapter 7 :arrow_right: Handling tab selection

For the // TODO: Update user’s selected tab the suggested code is

Provider.of<AppStateManager>(context, listen: false)
  	.goToTab(index);

but we already have a reference to AppStateManager in the builder closure

builder: (context, appStateManager, child) {

and we can simply use it as follow:

onTap: appStateManager.goToTab,

Excellent book.

At the page: https://www.raywenderlich.com/books/flutter-apprentice/v2.0/chapters/3-basic-widgets

item: Adding the IconButton widget

The next phone screen image shows the “smoothies” and “recipe” texts but they have not been added yet.

Misleading.

Mauricio

Stream chapter

Just a typo (underscore):

  1. _recipeStream and _ingredientStream are private fields for the streams. These will be captured the first time a stream is requested, which prevents new streams from being created for each call.

Chapter 7, under “Handling Pop Events”.

There’s a typo in the first line. “Locate // TOOD:...” should be “Locate // TODO:...”.

In the same section, in the code snippet to be copied, there’s an footnote marker // 6 but no corresponding footnote.

8. Deep Links & Web URLs :arrow_right: Converting an AppLink to a URL string

The provided implementation of toLocation() doesn’t do logic defined in the explanation section.
I have tried to implement it as the explanation suggest:

switch (location) {
      case kLoginPath:
      case kOnboardingPath:
      case kProfilePath:
        return location;
      case kHomePath:
        var loc = '$kHomePath';
        loc += currentTab == null ? '' : '?';
        loc += encodeKeyValPair(key: kTabParam, value: currentTab?.toString());
        return Uri.encodeFull(loc);
      case kItemPath:
        var loc = '$kItemPath';
        loc += itemId == null ? '' : '?';
        loc += encodeKeyValPair(key: kIdParam, value: itemId);
        return Uri.encodeFull(loc);
      default:
        return kHomePath;
    }

PS: I have declared location field as non-nullable String to simplify the logic.

in chapter 2, I can not add image. i am always receiving this error below. please help. thanks.

Could not update files on device: FileSystemException: Cannot open file, path = ‘C:\Users\user\Desktop\flutterDevFolder\recipes\assets\15452035777_294cefced5_c.jpg’ (OS Error: The system cannot find the file specified.
, errno = 2)

@jomoka @mkatz
Ch6: I was following the book example using VSCode. Section 6.9: The highlighted line in the snapshot below did not hold true for me. The squiggles remained in place and did not disappear. link.

image

Ch7: There is a missing indentation in the following code segment @ 7.11 Navigation. link.

image

1 Like

router-diagram

image

Who calls setNewRoutePath() ?

I tried testing deep link in my terminal ,this what am seeing
IMG_20211110_123351_295

Am facing this error even after adding Splash screen to the app route (p.g 295) => .The Navigator.pages must not be empty to use the Navigator.pages API.

Reference
Book chapter: 7. page 294.

Any help please.

1 Like

Thank you @alilosoft for taking the time to report this. I was previously reported on 5-October.

alilosoft

11h

Chapter 6.

// TODO 22: Add Row to group (name, date, importance)

is missing the Row widget.

thanks @moricio it has already been corrected, we are working on updated the book with the latest feedback!

@drizla yes that is expected. If you follow the rest of the instructions it should prompt you to add a new page as you build up the navigator stack.

Firebase Cloud Firestore

  • Also has a free plan, but charges for storage used, not for queries made, past the limit.
  • Extremely low latency.
  • Easy to store simple data using JSON.
  • Available for mobile only.

And web app ? So we could use it to create flutter web app ?

Chapter 10: Please what does it mean , when they said we should make sure our installed flutter is set to a path that points to it, because i added my installed flutter to the starter folder, the command isn’t running
IMG_20211113_171225_382