Skip to content

Commit

Permalink
More super initializers
Browse files Browse the repository at this point in the history
  • Loading branch information
gskinner committed Nov 21, 2023
1 parent 044596a commit ee98671
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 14 deletions.
8 changes: 4 additions & 4 deletions lib/src/effects/custom_effect.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ import '../../flutter_animate.dart';
@immutable
class CustomEffect extends Effect<double> {
const CustomEffect({
required this.builder,
Duration? delay,
Duration? duration,
Curve? curve,
super.delay,
super.duration,
super.curve,
double? begin,
double? end,
required this.builder,
}) : super(
begin: begin ?? 0.0, // Should this use "smart" defaults?
end: end ?? 1.0,
Expand Down
10 changes: 4 additions & 6 deletions lib/src/effects/toggle_effect.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,11 @@ import '../../flutter_animate.dart';
@immutable
class ToggleEffect extends Effect<void> {
const ToggleEffect({
Duration? delay,
Duration? duration,
super.delay,
super.duration,
super.curve,
required this.builder,
}) : super(
delay: delay,
duration: duration,
);
});

final ToggleEffectBuilder builder;

Expand Down
7 changes: 3 additions & 4 deletions lib/src/effects/visibility_effect.dart
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,13 @@ class VisibilityEffect extends Effect<bool> {
static const bool defaultMaintain = true;

const VisibilityEffect({
Duration? delay,
Duration? duration,
super.delay,
super.duration,
super.curve,
bool? end,
bool? maintain,
}) : maintain = maintain ?? defaultMaintain,
super(
delay: delay,
duration: duration,
begin: !(end ?? neutralValue),
end: end ?? neutralValue,
);
Expand Down

0 comments on commit ee98671

Please sign in to comment.