gskinner / gskinner/flutter_animate

Allow for declarative tween defaults using an `InheritedWidget`

Open
#69 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Dart
Stars
1.1k
Forks
103
PR merge metrics
No merged PRs in 30d

Description

In some cases you want a group of tweens to share some default duration, curve, or delay. It might be nice if this could be declared in the widget tree:
```dart
return AnimateDefaults(
duration: 1.seconds,
delay: .5.seconds,
curve: Curves.easeInOut,
child: Column(
children: [
childA.animate().fadeIn();
childB.animate().fadeIn().scale(...);
childC.animate().fadeIn().slide(...);
]
)
);
```

These would simply act as new defaults, nothing more fancy than that.

This could be accomplished by with `class AnimateDefaults extends InheritedWidget`, and then calling `AnimateDefaults.maybeOf(context)` from within `Animate` to look up the closest ancestor with default overrides (if any).

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.