Failed to compile starter application of CH8

I just started reading Chapter 8 of the book Flutter Apprentice. I opened the starter project of this chapter in latest Android Studio (Bumblebee 2021.1.1 Patch 1). I tried running main.dart in Chrome (web), but failed. Here’s the error message in console:

Launching lib\main.dart on Chrome in debug mode…
Waiting for connection from debug service on Chrome…
…/…/…/…/…/Documents/flutter/.pub-cache/hosted/pub.dartlang.org/platform-3.0.0/lib/src/interface/local_platform.dart:46:19: Error: Member not found: ‘packageRoot’.
io.Platform.packageRoot; // ignore: deprecated_member_use
^^^^^^^^^^^
Failed to compile application.

How to solve this issue? Can anybody help? Thanks in advance!

Never mind. I found the solution from StackOverFlow. Just run “flutter pub upgrade” in the terminal will fix this.