Shimmer class

Creates simple yet beautiful shimmer animations

Shimmer is very widely used as the default animation for skeleton loaders or placeholder widgets throughout the development community. Therefore, having an easy to use, yet customizable widget ready to use for Android, iOS and Web, gives developers an advantage to focus on their actual functionality, let shimmer make the loading experience smoother.

By default, the widget will select the preset config but it can be easily customized as shown below:

Inheritance

Constructors

Shimmer({required Widget child, bool enabled = true, Color color = Colors.white, double colorOpacity = 0.3, Duration duration = const Duration(seconds: 3), Duration interval = const Duration(seconds: 0), ShimmerDirection direction = const ShimmerDirection.fromLTRB()})

Properties

child Widget
Accepts a child Widget over which the animation is to be displayed
final
color Color
Accepts a parameter of type Color and sets the color of the animation overlay. Default value is Colors.white
final
colorOpacity double
Accepts a parameter of type double and sets the Opacity of the color of the animation overlay. Default value is 0.3
final
direction ShimmerDirection
Accepts a ShimmerDirection and aligns the animation accordingly. Default value is ShimmerDirection.fromLBRT()
final
duration Duration
Accepts a Duration that would be the time period of animation. Default value is Duration(seconds: 3)
final
enabled bool
Accepts a bool which toggles the animation on/off. Default value is true
final
hashCode int
The hash code for this object.
no setterinherited
interval Duration
Accepts a Duration that would be the interval between the repeating animation. Default value is Duration(seconds: 0) i.e. no interval
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
override
createElement() StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited