[Flutter] 움직이는 아이콘

LOCKED·2020년 7월 7일
1
post-thumbnail
post-custom-banner

아이콘들 목록

AnimatedIcons.add_event,
AnimatedIcons.arrow_menu,
AnimatedIcons.close_menu,
AnimatedIcons.ellipsis_search,
AnimatedIcons.event_add,
AnimatedIcons.home_menu,
AnimatedIcons.list_view,
AnimatedIcons.menu_arrow,
AnimatedIcons.menu_close,
AnimatedIcons.menu_home,
AnimatedIcons.pause_play,
AnimatedIcons.play_pause,
AnimatedIcons.search_ellipsis,
AnimatedIcons.view_list,

사용 방법


class _IconHomeState extends State<IconHome>
    with SingleTickerProviderStateMixin {
// [initState()]
controller = AnimationController(
        vsync: this, duration: Duration(milliseconds: 1500));
// [build()]
IconButton(
  onPressed: () {
    (isClicked = !isClicked)
        ? controller.forward()
        : controller.reverse();
  },
  icon: AnimatedIcon(
    progress: controller,
    icon: icon,
  ),
),

AnimatedIcon 글 수정 예정

profile
Flutter 개발자 :'>
post-custom-banner

0개의 댓글