Shimmer Progress Bar
A highly customizable and animated linear progress bar widget for Flutter with a built-in shimmer effect and percentage indicator. Ideal for loading states, visual feedback, and active processes in modern mobile and web apps.
π± Android
π iOS
π Web
β¨ Features
- π Animated fill with smooth transitions
- β¨ Optional shimmer effect for active progress
- π Configurable percentage display (center or near progress tip)
- π¨ Customizable colors, dimensions, and text styles
- βΏ Accessibility with screen reader semantics
- π§© Theme-aware, semantic-friendly, and animation-sensitive
- π΅οΈ Efficient: shimmer stops when off-screen
- π§° Respects system "reduced motion" settings
- β Lightweight and easy to integrate
π Getting Started
Installation
Add this to your pubspec.yaml
:
dependencies:
shimmer_progress_bar: ^1.0.0
Then run:
flutter pub get
Import
import 'package:shimmer_progress_bar/shimmer_progress_bar.dart';
π§ͺ Example
ShimmerProgressBar(
value: 0.65, // 65%
height: 14.0,
valueColor: Colors.blueAccent,
backgroundColor: Colors.grey.shade300,
shimmerColor: Colors.white,
showShimmer: true,
showPercentage: true,
alignPercentageToTip: false,
percentTextStyle: TextStyle(fontSize: 10, fontWeight: FontWeight.bold),
semanticsLabel: 'Loading progress',
)
π§ Parameters
Property | Type | Default | Description |
---|---|---|---|
value |
double |
required | Progress value between 0.0 and 1.0 |
height |
double |
12.0 |
Height of the progress bar |
borderRadius |
double |
20.0 |
Rounded corners |
valueColor |
Color |
Colors.green |
Fill color of the bar |
backgroundColor |
Color |
Color(0xFFE0E0E0) |
Background color |
shimmerColor |
Color |
Color.fromARGB(80, 255, 255, 255) |
Color of the shimmer gradient |
shimmerWidth |
double |
30.0 |
Width of the shimmer sweep |
shimmerDuration |
Duration |
Duration(seconds: 2) |
Duration of shimmer cycle |
showShimmer |
bool |
true |
Whether to show shimmer animation |
animationDuration |
Duration |
Duration(milliseconds: 300) |
Bar fill animation duration |
showPercentage |
bool |
true |
Display percentage inside the bar |
alignPercentageToTip |
bool |
false |
Align percentage near the progress tip instead of center |
percentTextStyle |
TextStyle? |
Custom fallback | Style for percentage text |
percentageFontColor |
Color |
Colors.white |
Default color for text if no TextStyle is set |
minWidthForPercentage |
double |
35.0 |
Minimum width before showing percentage |
percentageBuilder |
Widget Function(BuildContext, int) |
null |
Custom widget for percentage display |
includeSemantics |
bool |
true |
Wrap in a Semantics widget for accessibility |
semanticsLabel |
String? |
'Progress bar' |
Custom label for screen readers |
onProgressComplete |
VoidCallback? |
null |
Called once when value reaches 100% |
respectReducedMotion |
bool |
true |
Auto-disables shimmer on "reduce motion" settings |
βΏ Accessibility
- Uses
Semantics
to support screen readers - Describes current progress (e.g., "75 percent complete")
- Honors system reduced motion preferences
includeSemantics: false
disables it if needed
π§ͺ Tests
This package currently ships without automated tests, but I plan to add comprehensive widget and integration tests in future updates.
Contributions are welcome! If you're interested in helping write or improve tests, feel free to submit a pull request π
π¦ Contributing
Found a bug or want to contribute a feature? Feel free to open an issue or submit a PR β especially for tests, improvements, and edge case handling. Let's make this better together π!
π Support My Work
If you find this project helpful, consider supporting me:
π License
MIT License. See LICENSE file for details.
β€οΈ Maintained by
Walid Kambagha
GitHub β’ LinkedIn
Designed for beautiful loading states and modern UI needs β¨