8. Deep Links & Web URLs Converting an AppLink to a URL string
The provided implementation of toLocation() doesnât do logic defined in the explanation section.
I have tried to implement it as the explanation suggest:
switch (location) {
case kLoginPath:
case kOnboardingPath:
case kProfilePath:
return location;
case kHomePath:
var loc = '$kHomePath';
loc += currentTab == null ? '' : '?';
loc += encodeKeyValPair(key: kTabParam, value: currentTab?.toString());
return Uri.encodeFull(loc);
case kItemPath:
var loc = '$kItemPath';
loc += itemId == null ? '' : '?';
loc += encodeKeyValPair(key: kIdParam, value: itemId);
return Uri.encodeFull(loc);
default:
return kHomePath;
}
PS: I have declared location field as non-nullable String to simplify the logic.
in chapter 2, I can not add image. i am always receiving this error below. please help. thanks.
Could not update files on device: FileSystemException: Cannot open file, path = âC:\Users\user\Desktop\flutterDevFolder\recipes\assets\15452035777_294cefced5_c.jpgâ (OS Error: The system cannot find the file specified.
, errno = 2)
@jomoka@mkatz Ch6: I was following the book example using VSCode. Section 6.9: The highlighted line in the snapshot below did not hold true for me. The squiggles remained in place and did not disappear. link.
Am facing this error even after adding Splash screen to the app route (p.g 295) => .The Navigator.pages must not be empty to use the Navigator.pages API.
Chapter 10: Please what does it mean , when they said we should make sure our installed flutter is set to a path that points to it, because i added my installed flutter to the starter folder, the command isnât running
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)