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 โจ