https://www.youtube.com/watch?v=vsyjMrZa5OU
오늘은 Flutter의 Flare 라이브러리를 이용한다.
Flare 라이브러리가 설치돼있을 수 있지만 설치가 안돼있을 경우에는
https://pub.dev/packages/flare_flutter
flare_flutter | Flutter Package
Vector design and runtime animation for Flutter.
pub.dev
해당 링크를 통해 설치를 할 수 있다.
설치 후 pubspec.yaml 에서
dependencies:
flutter:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^0.1.3
flare_flutter: any
이렇게 버전을 지정해주면 된다.
그리고 assets의
flutter:
# The following line ensures that the Material Icons font is
# included with your application, so that you can use the icons in
# the material Icons class.
uses-material-design: true
# To add assets to your application, add an assets section, like this:
assets:
- assets/buttonAnimation.flr
butttonAnimation.flr 를 추가가 필수적이다.
GestureDetector는 말그대로 제스처를 감지한다.
onTap은 한번 클릭이고 onDoubleTap은 두번 클릭을 한 것이다.
생각보다 이해하기 쉽다.
enum AnimationToPlay {
Activate,
Deactivate,
CameraTapped,
PulseTapped,
ImageTapped
}
Flutter도 자바처럼 enum이 있다.
'공부 > Flutter' 카테고리의 다른 글
Flutter Navigate (0) | 2022.07.16 |
---|---|
안드로이드 스튜디오 에뮬레이터 바로 실행하기 (0) | 2022.07.02 |
Flutter UI (0) | 2022.06.26 |
Flutter 설치방법 (0) | 2022.06.25 |
댓글