我已经将 Slidable 依赖项添加到我的 Flutter 项目中,然后将 Slidable 小部件添加到容器中,但是在 building.child: Slidable( startActionPane:
我已经将 Slidable 依赖项添加到我的 Flutter 项目中,然后将 Slidable 小部件添加到容器中,但是调试控制台在构建时输出了此问题。
child: Slidable(
startActionPane: ActionPane(
motion: StretchMotion(),
children: [
SlidableAction(
onPressed: deleteFunction,
icon: Icons.delete,
backgroundColor: Colors.black,
foregroundColor: Colors.white,
),
],
),
child: Container(
decoration: BoxDecoration(....
输出
../../../.pub-cache/hosted/pub.dev/flutter_slidable-1.3.2/lib/src/actions.dart:102:13: Error: No named parameter with the name 'primary'.
primary: effectiveForegroundColor,
^^^^^^^
../../../Documents/development/flutter/packages/flutter/lib/src/material/outlined_button.dart:177:22: Context: Found this candidate, but the arguments don't match.
static ButtonStyle styleFrom({
^^^^^^^^^
Failed to compile application.
这是我在项目中使用的 ThemeData:
ThemeData mainTheme = ThemeData(
primaryColor: bcgColor,
buttonTheme: ButtonThemeData(),
//colorScheme: ColorScheme.fromSeed(seedColor: Color(0Xfff7f2ef)),
appBarTheme: AppBarTheme(
backgroundColor: bcgColor,
titleTextStyle: TextStyle(
color: mainTextColor,
fontSize: headFontSize,
)),
textTheme: TextTheme(
bodyMedium: TextStyle(
color: mainTextColor,
fontSize: bodyFontSize,
),
),
checkboxTheme: CheckboxThemeData(
fillColor: WidgetStateProperty.resolveWith((states) {
if (states.contains(WidgetState.hovered)) {
return Colors.white;
} else if (states.contains(WidgetState.selected)) {
return Colors.white;
}
return null;
}),
checkColor: WidgetStateProperty.resolveWith(
(states) {
if (states.contains(WidgetState.selected)) {
return Colors.black;
}
return null;
},
),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(4.5),
),
),
);
请告知我可以进行哪些更改。
我尝试添加一些新的主题信息,但没有成功