% flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.16.9, on macOS 12.7.1 21G920 darwin-x64, locale zh-Hans-CN)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 14.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2023.1)
[✓] VS Code (version 1.85.1)
[✓] Connected device (2 available)
Launching lib/main.dart on macOS in debug mode...
Building macOS application...
Invalid depfile: /path/to/project/.dart_tool/flutter_build/7bf370e92f8c1c63abe3e2ccbd009a91/kernel_snapshot.d
Invalid depfile: /path/to/project/.dart_tool/flutter_build/7bf370e92f8c1c63abe3e2ccbd009a91/kernel_snapshot.d
Error: Couldn't resolve the package 'flag' in 'package:flag/flag.dart'.
../path/to/project/lib/src/widgets/localizations.dart:1:8: Error: Not found: 'package:flag/flag.dart'
import 'package:flag/flag.dart';
^
../path/to/project/lib/src/widgets/localizations.dart:57:11: Error: The getter 'Flag' isn't defined for the class 'LocalePicker'.
- 'LocalePicker' is from 'package:/path/to/project/src/widgets/localizations.dart' ('../path/to/project/lib/src/widgets/localizations.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'Flag'.
Flag.fromString(current.countryCode!),
^^^^
Unhandled exception:
FileSystemException(uri=org-dartlang-untranslatable-uri:package%3Aflag%2Fflag.dart; message=StandardFileSystem only supports file:* and data:* URIs)
#0 StandardFileSystem.entityForUri (package:front_end/src/api_prototype/standard_file_system.dart:34:7)
#1 asFileUri (package:vm/kernel_front_end.dart:732:37)
#2 writeDepfile (package:vm/kernel_front_end.dart:870:21)
<asynchronous suspension>
#3 FrontendCompiler.compile (package:frontend_server/frontend_server.dart:676:9)
<asynchronous suspension>
#4 starter (package:frontend_server/starter.dart:102:12)
<asynchronous suspension>
#5 main (file:///Volumes/Work/s/w/ir/x/w/sdk/pkg/frontend_server/bin/frontend_server_starter.dart:13:14)
<asynchronous suspension>
Target kernel_snapshot failed: Exception
Command PhaseScriptExecution failed with a nonzero exit code
** BUILD FAILED **
Exception: Build process failed
flutter pub add successfully