当前在 Linux 下,因为 stable 通道的 flutter 有问题,所以使用 fvm 切换到 3.19.5,但是在运行 example 时,提示以下错误:
fvm flutter run -d linux
Launching lib/main.dart on Linux in debug mode...
ERROR: ../../../.pub-cache/hosted/pub.dev/preference_list-0.0.2/lib/src/preference_list_item.dart:68:44: Error: The getter 'surfaceContainerHigh' isn't defined for the class 'ColorScheme'.
ERROR: - 'ColorScheme' is from 'package:flutter/src/material/color_scheme.dart' ('../../../.fvm/versions/3.19.5/packages/flutter/lib/src/material/color_scheme.dart').
ERROR: Try correcting the name to the name of an existing getter, or defining a getter or field named 'surfaceContainerHigh'.
ERROR: color: Theme.of(context).colorScheme.surfaceContainerHigh,
ERROR: ^^^^^^^^^^^^^^^^^^^^
ERROR: Target kernel_snapshot failed: Exception
Building Linux application...
Error: Build process failed
fvm flutter --version
Flutter 3.19.5 • channel stable • https://github.com/flutter/flutter.git
Framework • revision 300451adae (4 个月前) • 2024-03-27 21:54:07 -0500
Engine • revision e76c956498
Tools • Dart 3.3.3 • DevTools 2.31.1
fvm flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.19.5, on Arch Linux 6.9.10-1-lily, locale zh_CN.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Chrome - develop for the web
[✓] Linux toolchain - develop for Linux desktop
[✓] Android Studio (version 2023.3)
[✓] Connected device (2 available)
[✓] Network resources
当前在 Linux 下,因为 stable 通道的 flutter 有问题,所以使用 fvm 切换到 3.19.5,但是在运行 example 时,提示以下错误: