Errata for Flutter Apprentice 2nd Edition

3.3 Setting a theme

It’s already included pubspec.yaml

Missing “in” for your intended meaning:
It’s already included in pubspec.yaml

1 Like

In 3.3 Setting a theme you treat “declares” and “defines” as synonyms. I highlighted them in bold here:


This code does the following:

  1. Declares a TextTheme called lightTextTheme, which uses the Google font Open Sans and has a predefined font size and weight. Most importantly, the color of the text is black.

  2. Then it defines darkTextTheme. In this case, the text is white.

  3. Next, it defines a static method, light, which returns the color tones for a light theme using the lightTextTheme you created in step 1.

  4. Finally, it declares a static method, dark, which returns the color tones for a dark theme using the darkTextTheme you created in step 2.


That’s fine for casual conversations, but please consider that these two words have specific and precise meanings in C, and most certainly they are not synonyms of each other in C. A book on any computer language should use these kinds of keywords with great care.

I’m sure you’ll be able to find a useful synonym for your intended use that doesn’t have the keyword baggage that these two have.

I’ll leave that choice as an exercise for the writer :wink:

You use these terms throughout the book, so this is quite a challenge.

One elegant possibility would be to use only “define” (as in an axiomatic mathematical system) and to avoid using “declare”.

1 Like

legit way of explaining with diagram

1 Like

As already reported in 2020, the divisions property of the Slider widget in Chapter 2.5 should be 9 instead of 10.

The symptom is that the middle tick can’t be selected, because it belongs to 5.5, which is rounded to 6, but when we set the slider’s value to 6, it’s closest to the next tick at 6.4.

@nflnfl thanks we will log this issue, evaluate, and fix the issue in the next update.

Uploading: IMG_20211017_201657_596.jpg…
Please i need help, my images aren’t uploading and my asset folder is in the same path with other folders

@iphie_flutter can’t see your image, can you please reupload?

On 7.11 Creating the router, on subsection Handling pop events you have…

Locate // TOOD: Add _handlePopPage and replace it with the following:

It should be TODO instead of TOOD.

Regards!

1 Like

IMG_20211017_201657_596

IMG_20211017_201734_250

@iphie_flutter
Did you add the asset folder in the pubspec.yaml?

Screen Shot 2021-10-18 at 4.21.30 PM

Yes I did , I added the assets/ to pubspec.yaml
IMG_20211018_192212_699

@iphie_flutter did you make sure your assets folders have those images?

You can get them at the root folder of /02-hello-folder

Here:

If this doesn’t work, I would check the final project to see if you have the same issue. Thanks!

Of course yes, the asset folder has the images and I copied the asset folder from the GitHub link you just posted which is part of the book materials.
IMG_20211019_095429_694

@iphie_flutter please try running the final project to see if it works. If it doesn’t you can upload your github project and i’ll check it out.

Sorry for late response, I have uploaded it on my GitHub , my username:ify1101.
16347911795367701225860810808666

@iphie_flutter I just tested your project here GitHub - ify1101/recipes and it works fine in the emulator. Are you trying to run it on a device?

@iphie_flutter … did you run flutter pub get in the terminal after adding your assets folder in pubspec.yaml? That could explain why it does NOT work for you but does work for @funkyboy.

1 Like

Thanks @jefff9511 i just ran flutter pub get and its working :dancer: :dancer: :dancer:, thanks also @jomoka

2 Likes

Chapter -1
1.2 Flutter’s history
It runs directly on the GPU using Vulcan on Android
It should be Vulkan.