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)
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.
Appendix B
A simpler solution is
const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 1),
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
Chapter 13 → Finding stored recipes and ingredients
In 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?