Skip to content

Commit 24a10c9

Browse files
committed
Cleanup
1 parent 4a43047 commit 24a10c9

File tree

5 files changed

+9
-19
lines changed

5 files changed

+9
-19
lines changed

lib/effects/effect.dart

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,9 @@ import 'package:flutter/foundation.dart';
22
import 'package:flutter/widgets.dart';
33
import '../flutter_animate.dart';
44

5-
/// An Effect that is composed of or more other existing Effects. Provides
6-
/// syntactic sugar for calling the `composeEffects` method.
7-
abstract class CompositeEffect extends Effect {
8-
const CompositeEffect({super.delay, super.duration, super.curve});
9-
10-
@protected
11-
List<Effect> get effects;
12-
13-
@override
14-
Widget build(BuildContext context, Widget child, AnimationController controller, EffectEntry entry) =>
15-
composeEffects(effects, context, child, controller, entry);
16-
}
17-
5+
/// Used to easily create effects that are composed of one or more existing Effects. Provides
6+
/// syntactic sugar for overrideing build and calling the `composeEffects` method
7+
/// with a list of effects.
188
mixin CompositeEffectMixin on Effect {
199
List<Effect> get effects;
2010

@@ -51,7 +41,7 @@ class BeginEndEffect<T> extends Effect {
5141
///
5242
/// It can be instantiated and added to Animate, but has no visual effect.
5343
@immutable
54-
abstract class Effect<T> {
44+
class Effect<T> {
5545
const Effect({this.delay, this.duration, this.curve});
5646

5747
/// The specified delay for the effect. If null, will use the delay from the
@@ -77,7 +67,7 @@ abstract class Effect<T> {
7767
return child;
7868
}
7969

80-
/// Calls build on one or more effects, composing them together and returning the resulting widget tree
70+
/// Calls build on one or more effects, composing them together and returning the resulting widget tree.
8171
@protected
8272
Widget composeEffects(
8373
List<Effect> effects,

lib/effects/variations/blur.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class BlurXEffect extends BeginEndEffect<double> with CompositeEffectMixin {
99
const BlurXEffect({super.begin, super.end, super.delay, super.duration, super.curve});
1010

1111
@override
12-
List<BeginEndEffect> get effects => [
12+
List<Effect> get effects => [
1313
BlurEffect(
1414
begin: Offset(begin ?? BlurEffect.neutralBlur, 0),
1515
end: Offset(end ?? (begin == null ? BlurEffect.defaultBlur : BlurEffect.neutralBlur), 0),

lib/effects/variations/fade_out.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ class FadeOutEffect extends CompositeEffect {
77
const FadeOutEffect({super.delay, super.duration, super.curve});
88

99
@override
10-
List<BeginEndEffect> get effects => const [FadeEffect(begin: 1, end: 0)];
10+
List<Effect> get effects => const [FadeEffect(begin: 1, end: 0)];
1111
}
1212

1313
@immutable

lib/effects/variations/slide_in.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class SlideInUpEffect extends CompositeEffect {
99
final double? beginY;
1010

1111
@override
12-
List<BeginEndEffect> get effects => [
12+
List<Effect> get effects => [
1313
SlideEffect(begin: Offset(0, beginY ?? defaultBeginY), end: Offset.zero),
1414
];
1515
}

lib/effects/variations/slide_out.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class SlideOutUpEffect extends CompositeEffect {
99
final double? endY;
1010

1111
@override
12-
List<BeginEndEffect> get effects => [
12+
List<Effect> get effects => [
1313
SlideEffect(begin: Offset.zero, end: Offset(0, endY ?? defaultEndY)),
1414
];
1515
}

0 commit comments

Comments
 (0)