Search categories, packages and repositories

Package detailsv1.0.1

snappable

A Flutter library for Thanos snap effect. Use it to turn your Widgets into dust. For fun only!

30-day downloads
14
Likes
81
Pub points
40

Install package

flutter pub add snappable

Package Overview

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

Snappable is a Flutter library that brings the iconic Thanos snap effect to your widgets, transforming them into dust with a playful animation. Designed purely for fun, it adds a dramatic and entertaining visual flair to any UI element. The package leverages Flutter's animation capabilities to create a satisfying disintegration effect, ideal for whimsical or thematic app interactions. It’s lightweight and easy to integrate, requiring minimal setup. Perfect for adding a touch of humor or cinematic flair to apps where user engagement through animation is key.

Use cases

  • Adding fun effects in games
  • Enhancing interactive tutorials
  • Creating playful app transitions
  • Simulating digital destruction
  • Entertaining user feedback

Key features

  • Thanos snap animation
  • Widget disintegration effect
  • Simple integration
  • Lightweight and fun
  • No complex configuration

Suitable for

  • Developers seeking playful animations
  • Apps with gamified elements
  • Prototypes with humorous interactions
  • UI experiments
  • Fun-focused applications

Considerations

  • Not suitable for production apps requiring seriousness
  • Limited to entertainment purposes
  • May not perform well on low-end devices
  • Best used sparingly to avoid distraction
  • Does not support customization beyond basic effects

Original README

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

snappable

Thanos effect library in Flutter

Check out blog post describing the package on Fidev.

Examples

Example 1 Example 2 Example 3

Getting Started

Import it
import 'package:snappable/snappable.dart';
Wrap any widget in Snappable
@override
Widget build(BuildContext context) {
  return Snappable(
    child: Text('This will be snapped'),
  );
}
Snap with a Key

class MyWidget extends StatelessWidget {
  final key = GlobalKey<SnappableState>();
  @override
  Widget build(BuildContext context) {
    return Snappable(
      key: key,
      child: Text('This will be snapped'),
    );
  }
  
  void snap() {
    key.currentState.snap();
  }
}

Undo by currentState.reset().

or snap by tap

class MyWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Snappable(
      snapOntap: true,
      child: Text('This will be snapped'),
    );
  }
}

Undo by tapping again.

Callback for when the snap ends

class MyWidget extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Snappable(
      onSnapped: () => print("Snapped!"),
      child: Text('This will be snapped'),
    );
  }
}

Categories

Dependencies

Dependency list 1 items

Source repository

Projects using this package

No data available yet.