block_ui 0.0.3
block_ui: ^0.0.3 copied to clipboard

Fully customizable flutter package to disbale UI interactions using loaders during asynchronous actions.

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

8
likes
130
pub points
31%
popularity

Publisher

Unknown

Fully customizable flutter package to disbale UI interactions using loaders during asynchronous actions.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on block_ui