Skip to content

Commit

Permalink
Back out Animate.enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
gskinner committed Nov 20, 2023
1 parent bd11127 commit 6c140a0
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions lib/src/animate.dart
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,6 @@ class Animate extends StatefulWidget with AnimateManager<Animate> {
this.controller,
this.adapter,
this.target,
this.enabled = true,
}) : autoPlay = autoPlay ?? true,
delay = delay ?? Duration.zero {
warn(
Expand All @@ -143,10 +142,6 @@ class Animate extends StatefulWidget with AnimateManager<Animate> {
/// The widget to apply animated effects to.
final Widget child;

/// Setting [enabled] to `false` will bypass the animation entirely and
/// simply return the unaltered child.
final bool enabled;

/// Called immediately after the controller is fully initialized, before
/// the [Animate.delay] or the animation starts playing (see: [onPlay]).
/// This is not called if an external [controller] is provided.
Expand Down Expand Up @@ -372,10 +367,6 @@ class _AnimateState extends State<Animate> with SingleTickerProviderStateMixin {
@override
Widget build(BuildContext context) {
Widget child = widget.child, parent = child;

if (!widget.enabled) {
return child;
}
ReparentChildBuilder? reparent = Animate.reparentTypes[child.runtimeType];
if (reparent != null) child = (child as dynamic).child;
for (EffectEntry entry in widget._entries) {
Expand All @@ -399,7 +390,6 @@ extension AnimateWidgetExtensions on Widget {
AnimationController? controller,
Adapter? adapter,
double? target,
bool enabled = true,
}) =>
Animate(
key: key,
Expand All @@ -412,7 +402,6 @@ extension AnimateWidgetExtensions on Widget {
controller: controller,
adapter: adapter,
target: target,
enabled: enabled,
child: this,
);
}
Expand Down

0 comments on commit 6c140a0

Please sign in to comment.