小编Gho*_*oSt的帖子

Flutter Icons 小部件在 vscode 中没有预览

下面显示了推荐的图标,但没有在 vscode 中显示预览。这只是最近发生的。

找不到图标

visual-studio-code flutter vscode-settings

5
推荐指数
1
解决办法
534
查看次数

ColorTween 无法在 TweenAnimationBuilder 中工作

我已经尝试了颤动每周小部件https://www.youtube.com/watch?v=l9uHB8VXZOg中提到的代码。但显然我遇到了问题。

\n
\nTweenAnimationBuilder<Color>(\n              tween: ColorTween(begin: Colors.white, end: Colors.grey), // Having errors here\n              duration: Duration(milliseconds: 500),\n              builder: (_, Color color, __) {\n                return Container(\n                  margin: EdgeInsets.symmetric(horizontal: 15),\n                  padding: EdgeInsets.all(25),\n                  decoration: BoxDecoration(\n                    image: DecorationImage(\n                      colorFilter: shouldChange\n                          ? ColorFilter.mode(color, BlendMode.modulate)\n                          : null,\n                      image: AssetImage(\'assets/someasset.png\'),\n                    ),\n                  ),\n                  child: SomeWidgetHere...\n                );\n              },\n            ),\n\n
Run Code Online (Sandbox Code Playgroud)\n

它说The argument type \'ColorTween\' can\'t be assigned to the parameter type \'Tween<Color>\'.dart(argument_type_not_assignable)

\n

我尝试过使用,Tween<Color>但这是我面临的错误。

\n
\n\xe2\x95\x90\xe2\x95\x90\xe2\x95\xa1 EXCEPTION CAUGHT BY WIDGETS LIBRARY\n\xe2\x95\x9e\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\xe2\x95\x90\nThe following assertion was thrown building\nTweenAnimationBuilder<Color>(duration: 500ms, …
Run Code Online (Sandbox Code Playgroud)

flutter flutter-animation

3
推荐指数
1
解决办法
2948
查看次数