v2.4.0fade_shimmer
A fade shimmer library to implement loading effects like the latest Facebook loading skeleton UI with smooth fade transitions.
quango2304/fade_shimmer open-source repository details.
{"sdk":"flutter"}{"sdk":"flutter"}English project snapshot. Visit GitHub for the latest content.
A customizable Flutter package that provides elegant shimmer loading effects with smooth fade transitions. Perfect for creating skeleton screens while your content is loading.
FadeShimmer Demo
Add fade_shimmer to your pubspec.yaml file:
dependencies:
fade_shimmer: ^2.3.0
Run the following command to install:
flutter pub get
import 'package:fade_shimmer/fade_shimmer.dart';
FadeShimmer(
height: 8,
width: 150,
radius: 4,
fadeTheme: FadeTheme.light,
)
FadeShimmer.round(
size: 60,
fadeTheme: isDarkMode ? FadeTheme.dark : FadeTheme.light,
)
FadeShimmer(
height: 8,
width: 150,
radius: 4,
highlightColor: Color(0xffF9F9FB),
baseColor: Color(0xffE6E8EB),
)
Create a wave-like loading effect by adding delays to each shimmer element:
Column(
children: [
FadeShimmer(
height: 8,
width: 150,
radius: 4,
millisecondsDelay: 0,
fadeTheme: FadeTheme.light,
),
SizedBox(height: 8),
FadeShimmer(
height: 8,
width: 170,
radius: 4,
millisecondsDelay: 300, // 300ms delay
fadeTheme: FadeTheme.light,
),
SizedBox(height: 8),
FadeShimmer(
height: 8,
width: 120,
radius: 4,
millisecondsDelay: 600, // 600ms delay
fadeTheme: FadeTheme.light,
),
],
)
You can change the global animation duration for all shimmer widgets:
// Change animation duration to 3 seconds (default is 1 second)
FadeShimmer.animationDurationInMillisecond = 3000;
Note: This change affects all FadeShimmer widgets in your application.
| Property | Type | Description |
|---|---|---|
width |
double |
Width of the shimmer container (required) |
height |
double |
Height of the shimmer container (required) |
radius |
double |
Border radius of the shimmer container (default: 0) |
fadeTheme |
FadeTheme |
Predefined theme (light or dark) |
highlightColor |
Color |
The brighter color that the shimmer transitions to |
baseColor |
Color |
The darker color that the shimmer starts with |
millisecondsDelay |
int |
Delay before the animation starts (default: 0) |
FadeTheme.light - Light gray colors suitable for light backgroundsFadeTheme.dark - Dark gray colors suitable for dark backgroundsCheck out the example directory for a complete sample application using FadeShimmer.
Contributions are welcome! If you find a bug or want a feature, please open an issue on the GitHub repository.
This project is licensed under the MIT License - see the LICENSE file for details.