我希望制作一个可以从列表中添加和删除的项目。
我正在寻找的是具有 + 图标和 - 图标并在 2 之间设置动画以获得干净流畅的外观。
我有以下代码
Container(
padding: EdgeInsets.fromLTRB(0, 0, 20, 0),
child: AnimatedIcon(
icon: AnimatedIcons.home_menu,
progress: _animationController,
color: Colors.white,
))
Run Code Online (Sandbox Code Playgroud)
和
void _handleOnPressed() {
setState(() {
isPlaying = !isPlaying;
isPlaying
? _animationController.forward()
: _animationController.reverse();
});
}
Run Code Online (Sandbox Code Playgroud)
这对于颤振中的内置动画图标来说很好。
我希望使用 + 和 - 图标,但外观相同。
有没有办法做到这一点?