每当我试图运行我的颤振应用程序时,我都会得到这个错误。它只会在下面抛出错误,编译器就会退出。
../../AppData/Local/Pub/Cache/hosted/pub.dartlang.org/nb_utils-3.3.0+13/lib/src/AppTextField.dart:181:60: Error: The getter 'cursorColor'
isn't defined for the class 'ThemeData'.
- 'ThemeData' is from 'package:flutter/src/material/theme_data.dart'
('/C:/flutter%20sdk/flutter/packages/flutter/lib/src/material/theme_data.dart').
Try correcting the name to the name of an existing getter, or defining a getter or field named 'cursorColor'.
cursorColor: widget.cursorColor ?? Theme.of(context).cursorColor,
^^^^^^^^^^^
我看不到任何错误。我已经试过跑步,颤栗,医生,没有任何问题显示。我使用的是颤振3.1.0。我也已经运行了‘颤振酒吧升级’和‘颤音酒吧升级-主要版本’,但没有运气。
发布于 2022-09-09 17:38:16
我想你用的是旧版的颤音。
你可以做flutter upgrade
或flutter upgrade --force
当前版本的颤振是3.3.1
,Theme.of(context).cursorColor
已经被替换为
Theme.of(context).textSelectionTheme.cursorColor,
https://stackoverflow.com/questions/73665209
复制相似问题