我已经尝试了颤动每周小部件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\nRun 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)
我尝试过使用,Tween<Color>但这是我面临的错误。
\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)