Block UI is a amazing package that helps you add an overlay loader during all your async operations.
- BlockUi.show(context) - Shows loader overlay✨
- BlockUi.hide(context) - Hides the overlay after operation✨
- Fully Customizable Overlays
- Image Background Support
- Use a custom loader
ElevatedButton(
onPressed:(){
BlockUi.show(context);
//Async Operation (For e.g Future.delayed(Duration(milliseconds: 1000))
BlockUi.hide(context);
}
)
ElevatedButton(
onPressed:(){
BlockUi.show(
context,
backgroundColor: Colors.black, // Change Background Color
child: Text("Please Wait..."), // Change the center widget
);
//Async Operation (For e.g Future.delayed(Duration(milliseconds: 1000))
BlockUi.hide(context);
}
)
Check out examples section, for more examples of block_ui.
Here are the different properties of block_ui that you can use to customise it.
Properties | Description |
---|---|
context | Buildcontext context |
child | Add a different widget in the center. You can also add custom loaders/text/images, etc. |
backgroundColor | Change background color |
backgroundWidget | Change background widget |
Want to contribute? Great! Contribute Here
MIT