Errata for Flutter Apprentice 2nd Edition

15.1
" Note : sqflite is a plugin and not a package because it requires platform-specific code."

That sentence is wrong because plugins are (a certain kind of) packages:

I used the code provided for us in the book, please if you know the exact line where I can add the message Dao you can help me out

Here is the link: https://www.raywenderlich.com/books/flutter-apprentice/v2.0/chapters/19-firebase-cloud-firestore#toc-chapter-025-anchor-007

Terminology is a bit blurry here, but yes, when I read

Dart packages
General packages written in Dart, for example the path package. Some of these might contain Flutter specific functionality and thus have a dependency on the Flutter framework, restricting their use to Flutter only, for example the fluro package.
Plugin packages
A specialized Dart package that contains an API written in Dart code combined with one or more platform-specific implementations.
Plugin packages can be written for Android (using Kotlin or Java), iOS (using Swift or Objective-C), web, macOS, Windows, or Linux, or any combination thereof.

I think we should amend our sentence like

sqflite is a plugin because it requires platform-specific code

Thanks for pointing this out @i3games.

Letā€™s pretend that it takes 1 minute to create an instance of the model you want (I know thatā€™s ages in the programming world).
If you tie the creation of such an instance to a widget lifecycle, every time the widget is re-painted you have to wait 1 minute.
As opposed to a case in which you create your model instance once, keep it somewhere (not connected to the widget lifecycle) and pass it to the widget when you need.

Makes sense?

I think it has to do with the formatting of the command. Try using the command on a single line. Like this

~/Library/Android/sdk/platform-tools/adb shell am start -a android.intent.action.VIEW -c android.intent.category.BROWSABLE -d 'fooderlich://raywenderlich.com/home?tab=1'

i did that still giving same issue :unamused: :unamused: :unamused:

Hello @iphie_flutter i would check if you have adb command available. If not you have to install it.

Next maybe you can try this:

adb shell am start -a android.intent.action.VIEW \
    -c android.intent.category.BROWSABLE \
    -d "fooderlich://raywenderlich.com/home?tab=1"

I donā€™t have a windows machine, sorry i canā€™t help debug :frowning:

someone should help me please :sob: :sob: :sob:

Can you post as text the full command you are using? The original picture in truncated and we might be missing some detail.

section 0, chapter 6:
ā€œYouā€™ll gain an understanding the wide range of widgets available in Flutter and put them to useā€

While creating the recipe.dart file, a semi colon has been used instead of a colon in the following comment

Replace:
// TODO; Add List<Recipe> here

With:

// TODO: Add List<Recipe> here

image

https://www.raywenderlich.com/books/flutter-apprentice/v2.0/chapters/2-hello-flutter#toc-chapter-008-anchor-004

Chapter 11: internet permission line goes where in manifest?

The text reads: ā€œOpen android/app/main/AndroidManifest.xml and add the following right before the tag:ā€

Note that it doesnā€™t say before which tag. From looking at the android developer site, it looks like it should go before the tag.

Ah. Itā€™s a rendering problem with the markup :slight_smile:
It should say ā€œbefore the <application> tagā€

Just some things I think worth mentioning in 2nd Ed. Chapter 1 Getting Started. You might mention that the user actually name their app or copy the screen shown, currently it states just click Finish. Then it describes the ā€œPub Getā€ and the get dependencies messages but those messages do not show up unless they have the main.dart file open. And there is no mention of where that file is or what it is, and it does not open automatically, at least on my system. If this was truly my first Flutter app, Iā€™d be lost alreadyā€¦

Just a minor thing !
In Chapter 15. Saving Data With SQLite , " Creating the Moor repository " part, 2nd block of code;
there are two ā€œ// 3ā€ comments and ā€œ// 5ā€ would have got missed.

Hi there. First and foremost, thanks for a great book :bowing_man:

I have two questions/corrections:

ā€œ15. Saving Data With SQLiteā€ suggests using ā€œdependency_overridesā€, but Flutter docs does not seem to approve this (I also donā€™t understand why itā€™s needed :confused:)

I also wonder why it is suggested to use Future(() async { // ... and not just mark insertRecipe as async itself

@override
Future<int> insertRecipe(Recipe recipe) {
  // 1
  return Future(() async {
    // ...

We took a little temporary shortcut because there were issues with moor_generator. See Ch-15: Problem using moor_generator for more details.

I am quite positive weā€™ll get rid of dependency_overrides in the next book update.

You are correct. Weā€™ll fix this in the next version

One thing Iā€™ve noticed in these books is that there are references to finder for mac os so Iā€™d like to humbly request the verbiage be changed for platform neutrality (in your file explorer / file manager)

Also, Consider being more explicit about whatā€™s an example and what you expect the user to type in.