Search packages, repositories and app categories

yoda cover
Package detailsv1.0.1

yoda

Flutter widget that let you slice any kind of child widget in a matrix of tiles and animate them with different kind of ways. Currently with Explode, Vortex and Flakes.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
70
Likes
57
Pub points
130

Install package

flutter pub add yoda

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

Yoda is a Flutter widget that enables developers to divide any child widget into a grid of tiles and animate them using various effects such as Explode, Vortex, and Flakes. It's designed for creating dynamic, visually engaging transitions in apps. The package supports multiple platforms including Android, iOS, Web, macOS, Windows, and Linux, making it versatile for cross-platform development. With simple integration via pub add, Yoda enhances UI interactivity through customizable animations.

Use cases

  • Creating animated splash screens
  • Designing interactive transitions between pages
  • Adding visual flair to button taps
  • Animating image or content reveals
  • Enhancing onboarding experiences

Key features

  • Tile-based animation slicing
  • Multiple animation types (Explode, Vortex, Flakes)
  • Cross-platform compatibility
  • Easy integration with pub
  • Customizable animation parameters
  • Smooth performance across devices

Suitable for

  • UI designers seeking creative animations
  • Developers building interactive app interfaces
  • Projects requiring dynamic content transitions
  • Prototyping engaging user experiences
  • Apps with strong visual storytelling

Considerations

  • May impact performance with large tile counts
  • Requires careful tuning for smooth animations
  • Limited to static child widgets unless combined with state management
  • Not ideal for simple, minimalistic designs
  • Animation complexity may increase build time

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

Yoda Flutter plugin

Flutter widget that let's you slice any kind of child widget in a matrix of tiles and animate them with different kind of ways. Currently with Explode, Vortex and Flakes. Works on all platforms.

Screenshot

Yoda Widget Properties

Yoda widget
  • [yodaEffect] Animation effect to use (see below).
  • [controller] Animation controller.
  • [duration] Animation duration.
  • [startWhenTapped] Enable tap gesture to start animation.
  • [animParameters] Parameters used to animate tiles (see below).
  • [child] Whatever widget to slice.
YodaEffect enum
  • [Explosion]
  • [Vortex]
  • [Flakes]
AnimParameters properties
  • [yodaBarrier] Define which edges are barraged (see below).
  • [hTiles] Number of horizontal tiles to divide the child widget.
  • [vTiles] Number of vertical tiles to divide the child widget.
  • [fractionalCenter] Default center where force is given when not tapping on it.
  • [gravity] Vertical force.
  • [effectPower] Effect strength.
  • [blurPower] Blur strength.
  • [randomness] Random strength.
YodaBarrier properties
  • [left] Block tiles moving over the left edge.
  • [right] Block tiles moving over the right edge.
  • [top] Block tiles moving over the top edge.
  • [bottom] Block tiles moving over the bottom edge.

How to use

If you need to control the animation status:

late YodaController _yodaControllerExplode;
  
@override
  void initState() {
    super.initState();
    _yodaControllerExplode = YodaController()
    ..addStatusListener((status) {
      if (status == AnimationStatus.completed) {
        _yodaControllerExplode.reset();
      }
    });
  }

YodaController accepts start() and reset() methods. Note: calling those methods will not work when a setState() is called at the same time.

Yoda(
  yodaEffect: YodaEffect.Explosion,
  controller: _yodaControllerExplode,
  duration: Duration(milliseconds: 2500),
  animParameters: AnimParameters(
    yodaBarrier: YodaBarrier(bottom: true, left: true, right: true),
    fractionalCenter: Offset(0.5, 1.0),
    hTiles: 20,
    vTiles: 20,
    effectPower: 0.2,
    blurPower: 5,
    gravity: 0.1,
    randomness: 30,
  ),
  startWhenTapped: true,
  child: SizedBox(
    width: 250,
    height: 180,
    child: Image.asset('assets/dash.png', fit: BoxFit.fill)
  )
)

TODO
  • Find a better way to capture the widget
  • When changing Yoda widget parameters, 2 hot reloads are needed to make it to work!

Categories

Source repository

Projects using this package

No data available yet.