Shimmer class
A widget that applies a shimmering effect to its child. Useful for loading placeholders.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- Shimmer
- Available extensions
Constructors
-
Shimmer.new({Key? key, required Widget child, Duration duration = const Duration(seconds: 2), double speedFactor = 1.0, Color baseColor = const Color(0xFFE0E0E0), Color highlightColor = const Color(0xFFF5F5F5), List<
Color> ? gradientColors, ShimmerDirection direction = ShimmerDirection.leftToRight, ShimmerEffect effect = ShimmerEffect.classic, Duration? disableAfter, double? shimmerAngle, double shimmerSizeFactor = 1.0}) -
const
Properties
- baseColor → Color
-
The base color of the shimmer effect.
final
- child → Widget
-
The widget to which the shimmer effect will be applied.
final
- direction → ShimmerDirection
-
The direction in which the shimmer effect moves.
final
- disableAfter → Duration?
-
Optional duration after which the shimmer effect is disabled.
final
- duration → Duration
-
The duration of the shimmer animation.
final
- effect → ShimmerEffect
-
The shimmer effect style (classic, wave, pulse, etc.).
final
-
gradientColors
→ List<
Color> ? -
Optional custom gradient colors for the shimmer effect.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- highlightColor → Color
-
The highlight color of the shimmer effect.
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
- shimmerAngle → double?
-
Optional angle (in degrees) for diagonal shimmering.
final
- shimmerSizeFactor → double
-
The size factor to scale the shimmer effect.
final
- speedFactor → double
-
The speed factor to control the shimmer animation speed.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → ShimmerState -
Creates the mutable state for this widget at a given location in the tree.
override
-
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
-
shimmer(
{bool shimmer = true, double? shimmerAngle, double? width, double? height, Duration? duration, double? speedFactor, Color? baseColor, Color? highlightColor, List< Color> ? gradientColors, ShimmerDirection? direction, ShimmerEffect? effect, Duration? disableAfter, double borderRadius = 8.0}) → Widget -
Available on Widget, provided by the ShimmerExtension extension
Wraps the widget with a shimmer effect. -
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, int wrapWidth = 65}) → 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