【发布时间】:2022-01-09 10:16:11
【问题描述】:
我在我的应用程序中使用动画图标来打开和关闭侧边菜单。我需要将关闭图标颜色更改为红色,打开图标颜色将变为白色。
AnimatedIcon(
progress: _animationController.view,
icon: menuClose,
color: menuIconColor, >need to apply condition here
size: 25.sp,
)
按钮的完整代码如下
Align(
alignment: Alignment(0, .99),
child: GestureDetector(
onTap: () {
onIconPressed();
},
child: ClipRRect(
borderRadius: BorderRadius.circular(80),
child: Container(
width: 50.w,
height: 45.h,
color: colorAnimatedButton,
alignment: Alignment.center,
child: AnimatedIcon(
progress: _animationController.view,
icon: menuClose,
color: iconColor,
size: 25.sp,
),
),
),
),
)
【问题讨论】: