v1.0.1
snappable
Eine Flutter-Bibliothek für den Thanos-Snap-Effekt. Verwenden Sie es, um Ihre Widgets in Staub zu verwandeln. Nur zum Spaß!
81Likes 730-Tage-Downloads40Pub-Punkte
Keine Plattformdaten
Thanos-Snap-Effekt in Flutter
{"sdk":"flutter"}^2.1.4{"sdk":"flutter"}Englischer Projektschnappschuss. Aktuelle Inhalte auf GitHub.
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'),
);
}
}