I forget the section I first noticed this in, but grep all code examples for “TODO;” (TODO followed by semicolon.)
While I suspect colon vs. semicolon doesn’t matter much here - I don’t know if parsers are looking for anything but “TODO” in comments - this was an inconsistency in grammar that popped out at me. You used colon most of the time.
Chapter 12. Under “Handling recipe results”, comment 3 says the
Error class is for modelling errors such as incorrect credentials.
- Created the
Error class to extend
Result and hold an exception. This will model errors that occur during an HTTP call, like using the wrong credentials or trying to fetch data without authorization.
However, when the app is run with incorrect credentials, it crashes on line 219 of
recipe_list.dart with the following message:
_CastError (type 'Null' is not a subtype of type 'Success<dynamic>' in type cast)
It looks like the
Error check isn’t working.
@jomoka @funkyboy i need your help here
That output means that the command is running correctly.
The issue is related to the formatting of pubspec.yaml
Entries should be indented like this flta-materials/pubspec.yaml at editions/2.0 · raywenderlich/flta-materials · GitHub
Thanks so much @funkyboy it has worked, but there are still red squiggles in my recipe_model.dart
By placing cursor on red line you will see error type to help you
I think there may be minor errors in the followings
Example on p53
Should the SafeArea wrap the Scaffold instead of just the body of the Scaffold so that the AppBar is also inside the SafeArea.
Example on p88
Text inside the AppBar should be wrapped by Center to match the illustrations in the book.
Example on p173, p186
import ‘…/components/components.dart’ should be ‘components.dart’ since they are in the same folder.
Example on p175
No need for top:0, - only need to specify non zero parameters.
A simpler solution is
const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 1),
Chapter 12/ Decoding JSON:
overwrite → override
Section 0: An omission
Under the Before You Begin → Introduction → How to read this book
There is no reference to the contents of Section VI and the last paragraph talks of five instead of six chapters in the sentence “Here’s a breakdown of these five main sections of the book:”
The breakdown of chapters also excludes Section VI
Thanks for reporting to this.
It’s been fixed and will be included in the upcoming release.
Chapter 13: This what I get when I search for chicken in the search box, after hot reloading my app.
Chapter 13 → Finding stored recipes and ingredients
findRecipeIngredients() why do we need to find the
recipe first by its
id then use that
recipe.id to find the ingredients, while we have the
recipeId in the first place?
Do I miss something?
Are credentials correctly set?
Yes, you are right. I am also confused as you are. An ingredient has recipe.id so why do we need to find the recipe?
I think the ‘s’ here should be
What credentials are you referring to please
I mean Edamam’s