Actually you can run book’s projects without it’s recreating on the up-to-date version of Flutter 3.13.6.
Here is a complete list of fixes you need to make after opening a clean starter project in the code editor (tested on Windows 11 22H2 and VS Code 1.83.1):
- As suggested in this post add explicit
FavQsApiandRoutemasterDelegatetypes to the main file:
lib\main.dart
line 79
late final _favQsApi = FavQsApi(
→ (change to)
late final FavQsApi _favQsApi = FavQsApi(
line 91
late final _routerDelegate = RoutemasterDelegate(
→
late final RoutemasterDelegate _routerDelegate = RoutemasterDelegate(
- Update the
intlpackage version for two local packages:
packages\component_library\pubspec.yaml
packages\features\profile_menu\pubspec.yaml
intl: ^0.17.0
→
intl: ^0.18.1
- Bump
infinite_scroll_paginationpackage version since it uses outdatesliver_toolspackage:
packages\features\quote_list\pubspec.yaml
infinite_scroll_pagination: ^4.0.0-dev.1
→
infinite_scroll_pagination: ^4.0.0
- Update
gradleandgoogle-servicesversions to build the project correctly:
android\build.gradle
classpath 'com.android.tools.build:gradle:4.1.0'
→
classpath 'com.android.tools.build:gradle:7.4.1'
classpath 'com.google.gms:google-services:4.3.10'
→
classpath 'com.google.gms:google-services:4.3.14'
- Raise
compileSdkVersionto current value:
android\app\build.gradle
line 31
compileSdkVersion 31
→
compileSdkVersion 33
- All dependencies in
monitoringpackage need to be updated—replace wholedependenciessection with the following (leavedev_dependenciesas is):
packages\monitoring\pubspec.yaml
dependencies:
…
→
dependencies:
flutter:
sdk: flutter
firebase_core: ^2.17.0
firebase_crashlytics: ^3.3.7
firebase_dynamic_links: ^5.3.7
firebase_analytics: ^10.5.1
firebase_remote_config: ^4.2.7
- As discussed here rename (with
F2button)SearchBarclass with something different to avoid a name collision:
packages\component_library\lib\src\search_bar.dart
line 4
SearchBar
→
AppSearchBar
- Finally you can get packages:
make get
On Windows you may need to use Git Bash terminal instead of default PowerShell to run this command successfully—here are the details.
That’s all! Now you can build and run projects without problems (after fixing all the suggested in the book’s chapter issues of course if you have opened a starter project).