cool_animation_flutter 0.0.3
cool_animation_flutter: ^0.0.3 copied to clipboard
A package that makes it easy and concise to apply cool animations like SlideFadeIn in Flutter. It provides various features such as direction, delay, sequential animation, and visibility-based trigger.
cool_animation_flutter β¨
πΊπΈ English #
A package that helps you apply cool animations in Flutter very easily and concisely.
You don't need to create complex AnimationController and StatefulWidget every time; just wrap your widget to implement smooth and natural interactions.
From simple appearance effects to advanced sequential list animations, create the coolest UX with the least code.
Feature #
- Easily apply sequential animations to lists or group elements using
delayandbuildSequentialAnimations. - Configure animations to start when the widget scrolled into view (
triggerOnVisible). - Freely adjust direction, duration, curve, animation start offset, etc.
- Check the example for usage.
- For more details on SlideFadeIn, refer to the tech blog post.
Install #
Add the following to your pubspec.yaml file:
dependencies:
cool_animation_flutter: ^0.0.2
Usage #
1οΈβ£ Use SlideFadeIn
The most basic form, appearing from bottom to top with a fade-in.
import 'package:cool_animation_flutter/cool_animation_flutter.dart';
SlideFadeIn(
child: Text('Hello!'),
)
2οΈβ£ Custom Direction & Offset
Use SlideDirection to appear from 8 different directions, or use beginOffset for precise control.
SlideFadeIn(
direction: SlideDirection.fromLeft, // Appears from left to right
duration: Duration(milliseconds: 800),
curve: Curves.elasticOut,
child: MyWidget(),
)
3οΈβ£ Sequential Animation
Use buildSequentialAnimations when you want multiple elements to appear with a time difference.
Column(
children: buildSequentialAnimations(
children: [
Text('First Item'),
Text('Second Item'),
Text('Third Item'),
],
builder: (child, delay) => SlideFadeIn(
delay: delay,
child: child,
),
),
)
Reference #
SlideDirection
fromBottom,fromTop,fromLeft,fromRightfromBottomLeft,fromBottomRight,fromTopLeft,fromTopRightnone(Fade effect only)
SlideFadeIn Properties
| Property | Type | Description |
|---|---|---|
child |
Widget |
Target widget for animation (Required) |
direction |
SlideDirection |
Slide start direction preset |
beginOffset |
Offset |
Custom start position (Prioritized over direction) |
duration |
Duration |
Animation duration (Default: 400ms) |
delay |
Duration |
Delay before animation starts |
triggerOnVisible |
bool |
Whether to start when visible on screen (Default: false) |
π°π· νκ΅μ΄ #
Flutterμμ λ©μ§ μ λλ©μ΄μ
μ μμ£Ό μ½κ³ κ°κ²°νκ² μ μ©ν μ μλλ‘ λμμ£Όλ ν¨ν€μ§μ
λλ€.
볡μ‘ν AnimationControllerμ StatefulWidgetμ λ§€λ² λ§λ€ νμ μμ΄, μμ ―μ κ°μΈλ κ²λ§μΌλ‘ λΆλλ½κ³ μμ°μ€λ¬μ΄ μΈν°λμ
μ ꡬνν μ μμ΅λλ€.
λ¨μν λ±μ₯ ν¨κ³ΌλΆν° 리μ€νΈκ° μμ°¨μ μΌλ‘ μ¬λΌμ€λ κ³ κΈ μ°μΆκΉμ§, κ°μ₯ μ μ μ½λλ‘ κ°μ₯ λ©μ§ UXλ₯Ό λ§λ€μ΄λ³΄μΈμ.
Feature #
delayμbuildSequentialAnimationsλ₯Ό μ¬μ©νμ¬ λ¦¬μ€νΈλ κ·Έλ£Ή μμμ μμ°¨μ μΈ μ λλ©μ΄μ μ μ½κ² μ μ©ν μ μμ΅λλ€.- νλ©΄ λ°μ μλ μμ ―μ΄ μ€ν¬λ‘€λμ΄ νλ©΄μ λ³΄μΌ λ μ λλ©μ΄μ
μ΄ μμλλλ‘ μ€μ ν μ μμ΅λλ€ (
triggerOnVisible). - λ°©ν₯, μ§μ μκ°, 곑μ , μ λλ©μ΄μ μμ μ€νμ λ±μ μμ λ‘κ² μ‘°μ κ°λ₯ν©λλ€.
- νμ© μμλ μμ λ₯Ό νμΈν΄μ£ΌμΈμ
- SlideFadeInμ λν μμΈν λ΄μ©μ κΈ°μ λΈλ‘κ·Έ ν¬μ€ν μ μ°Έκ³ ν΄μ£ΌμΈμ
Install #
pubspec.yaml νμΌμ λ€μμ μΆκ°νμΈμ:
dependencies:
cool_animation_flutter: ^0.0.2
Usage #
1οΈβ£ SlideFadeIn
κ°μ₯ κΈ°λ³Έμ μΈ ννλ‘, νλ¨μμ μλ‘ νμ΄λ μΈλλ©° λνλ©λλ€.
import 'package:cool_animation_flutter/cool_animation_flutter.dart';
SlideFadeIn(
child: Text('μλ
νμΈμ!'),
)
2οΈβ£ λ°©ν₯ λ° μ€νμ 컀μ€ν
SlideDirectionμ μ¬μ©νμ¬ 8κ°μ§ λ°©ν₯μμ λ±μ₯νκ² νκ±°λ, beginOffsetμΌλ‘ μ λ°ν μ μ΄κ° κ°λ₯ν©λλ€.
SlideFadeIn(
direction: SlideDirection.fromLeft, // μΌμͺ½μμ μ€λ₯Έμͺ½μΌλ‘ λ±μ₯
duration: Duration(milliseconds: 800),
curve: Curves.elasticOut,
child: MyWidget(),
)
3οΈβ£ μμ°¨ μ λλ©μ΄μ
μ¬λ¬ μμλ₯Ό μκ° μ°¨λ₯Ό λκ³ λνλκ² νκ³ μΆμ λ buildSequentialAnimationsλ₯Ό μ¬μ©νλ©΄ νΈλ¦¬ν©λλ€.
Column(
children: buildSequentialAnimations(
children: [
Text('첫 λ²μ§Έ νλͺ©'),
Text('λ λ²μ§Έ νλͺ©'),
Text('μΈ λ²μ§Έ νλͺ©'),
],
builder: (child, delay) => SlideFadeIn(
delay: delay,
child: child,
),
),
)
Reference #
SlideDirection
fromBottom,fromTop,fromLeft,fromRightfromBottomLeft,fromBottomRight,fromTopLeft,fromTopRightnone(νμ΄λ ν¨κ³Όλ§ μ μ©)
SlideFadeIn Properties
| μμ± | νμ | μ€λͺ |
|---|---|---|
child |
Widget |
μ λλ©μ΄μ μ μ μ©ν λμ (νμ) |
direction |
SlideDirection |
μ¬λΌμ΄λ μμ λ°©ν₯ ν리μ |
beginOffset |
Offset |
컀μ€ν μμ μμΉ (directionλ³΄λ€ μ°μ ν¨) |
duration |
Duration |
μ λλ©μ΄μ μ¬μ μκ° (κΈ°λ³Έ 400ms) |
delay |
Duration |
μ λλ©μ΄μ μμ μ μ§μ° μκ° |
triggerOnVisible |
bool |
νλ©΄μ λ³΄μΌ λ μμ μ¬λΆ (κΈ°λ³Έ false) |