Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lib/shimmer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ enum ShimmerDirection { ltr, rtl, ttb, btt }
class Shimmer extends StatefulWidget {
final Widget child;
final Duration period;
final Curve curve;
final ShimmerDirection direction;
final Gradient gradient;
final int loop;
Expand All @@ -72,6 +73,7 @@ class Shimmer extends StatefulWidget {
this.period = const Duration(milliseconds: 1500),
this.loop = 0,
this.enabled = true,
this.curve = Curves.linear,
}) : super(key: key);

///
Expand All @@ -88,6 +90,7 @@ class Shimmer extends StatefulWidget {
this.direction = ShimmerDirection.ltr,
this.loop = 0,
this.enabled = true,
this.curve = Curves.linear,
}) : gradient = LinearGradient(
begin: Alignment.topLeft,
end: Alignment.centerRight,
Expand Down Expand Up @@ -161,7 +164,7 @@ class _ShimmerState extends State<Shimmer> with SingleTickerProviderStateMixin {
@override
Widget build(BuildContext context) {
return AnimatedBuilder(
animation: _controller,
animation: CurvedAnimation(parent: _controller, curve: widget.curve),
child: widget.child,
builder: (BuildContext context, Widget? child) => _Shimmer(
child: child,
Expand Down