Errata for Flutter Apprentice 2nd Edition

" 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:

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://'

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://"

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

// TODO; Add List<Recipe> here


// TODO: Add List<Recipe> here


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

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.