snappable 1.0.1 copy "snappable: ^1.0.1" to clipboard
snappable: ^1.0.1 copied to clipboard

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

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 whill 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 whill 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 whill be snapped'),
    );
  }
}

Undo by tapping again.

81
likes
40
pub points
44%
popularity

Publisher

unverified uploader

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

Repository (GitHub)
View/report issues

License

BSD-2-Clause (LICENSE)

Dependencies

flutter, image

More

Packages that depend on snappable