Skip to content

ANILSRGT/flutter_flash_curve

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

flutter_flash_curve

A Flutter package to create a flash curve animation.

opacityFlash scaleFlash translateFlash rotateFlash

📱 Usage

  1. Import package in your file
import 'package:flutter_flash_curve/flutter_flash_curve.dart';
  1. Use one of the FlashCurve | InFlashCurve | OutFlashCurve curve classes.
    //...

    final _controller = AnimationController(
        vsync: this,
        duration: const Duration(milliseconds: 500),
    );

    //...

    final curve = FlashCurve(flashes = 8);
    // or
    // final curve = InFlashCurve(flashes = 8);
    // or
    // final curve = OutFlashCurve(flashes = 8);

    final opacityTween = Tween(begin: 1.0, end: 0.2).animate(CurvedAnimation(
        parent: _controller,
        reverseCurve: curve.flipped,
        curve: curve,
    ));

    //...

    AnimatedBuilder(
        animation: _controller,
        builder: (_, child) {
            return Opacity(
                opacity: opacityTween.value,
                child: child,
            );
        },
        child: const FlutterLogo(size: 100),
    ),

    //...

🎛 Attributes

Attribute Data type Description Default
flashes int Number of flash periods 8

🎨 Flash Curve Types Enum

  • flash -> FlashCurveType.flash
  • inFlash -> FlashCurveType.inFlash
  • outFlash -> FlashCurveType.outFlash

📦 Extensions

Extension Description Result
FlashCurveType->curve Returns the curve of the FlashCurveType Curve

💻 Author

Anıl Sorgit - GitHub