在使用 dart migrate 后尝试在 chrome 或 macos 上运行我的应用程序时,我在控制台中收到以下错误:
Downloading Web SDK... 2,674ms
Launching lib/web/main.dev.dart on Chrome in debug mode...
Waiting for connection from debug service on Chrome...
../../../.pub-cache/hosted/pub.dartlang.org/styled_text-3.0.1/lib/custom_style.dart:38:7: Error: Type 'ui.TextLeadingDistribution' not found.
ui.TextLeadingDistribution? leadingDistribution,
^^^^^^^^^^^^^^^^^^^^^^^^^^
../../../.pub-cache/hosted/pub.dartlang.org/styled_text-3.0.1/lib/custom_style.dart:98:7: Error: Type 'ui.TextLeadingDistribution' not found.
ui.TextLeadingDistribution? leadingDistribution,
^^^^^^^^^^^^^^^^^^^^^^^^^^
../../../.pub-cache/hosted/pub.dartlang.org/styled_text-3.0.1/lib/custom_style.dart:219:3: Error: Type 'ui.TextLeadingDistribution' not found.
ui.TextLeadingDistribution? get leadingDistribution =>
它在 Android / iPhone 模拟器上运行良好。
我尝试了以下方法,但都是徒劳的:
- 颤振 2.0.6(稳定)
- 颤振 2.5.3(稳定)
- 颤振医生显示没有错
- 颤振清洁,颤振 pub 缓存修复,颤振 pub 获取
- 重启 VSCode