v1.0.1
snappable
Uma biblioteca Flutter para o efeito de snap do Thanos. Use para transformar seus Widgets em poeira. Só para diversão!
81Curtidas 7Downloads em 30 dias40Pontos Pub
Plataformas indisponíveis
Efeito de clique do Thanos no Flutter
{"sdk":"flutter"}^2.1.4{"sdk":"flutter"}Texto original em inglês. Visite o GitHub para a versão atual.
Thanos effect library in Flutter
Check out blog post describing the package on Fidev.
Example 1 Example 2 Example 3
import 'package:snappable/snappable.dart';
@override
Widget build(BuildContext context) {
return Snappable(
child: Text('This will be snapped'),
);
}
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().
class MyWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Snappable(
snapOntap: true,
child: Text('This will be snapped'),
);
}
}
Undo by tapping again.
class MyWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Snappable(
onSnapped: () => print("Snapped!"),
child: Text('This will be snapped'),
);
}
}