block_ui

Easily disable UI during async operation

Block UI is a amazing package that helps you add an overlay loader during all your async operations.

Here's how :

  • BlockUi.show(context) - Shows loader overlay✨
  • BlockUi.hide(context) - Hides the overlay after operation✨

Features

  • Fully Customizable Overlays
  • Image Background Support
  • Use a custom loader

Usage

1. Simple Overlay

ElevatedButton(
    onPressed:(){
        BlockUi.show(context);
        //Async Operation (For e.g Future.delayed(Duration(milliseconds: 1000))
        BlockUi.hide(context);
    }
)

2. Customised Overlay

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.

Properties

Here are the different properties of block_ui that you can use to customise it.

PropertiesDescription
contextBuildcontext context
childAdd a different widget in the center. You can also add custom loaders/text/images, etc.
backgroundColorChange background color
backgroundWidgetChange background widget

Development

Want to contribute? Great! Contribute Here

License

MIT

Libraries

block_ui