A Flutter package that creates a barrier around any widget, no matter where it is.
What problem does it solve?
Sometimes we need to highlight or showcase a specific widget, that's an easy task if the widget is a direct child of a Stack, but what if we want to create a barrier around a specific widget, which is inside, for example, a Column. We can try to calculate positions and sizes, but that can get really messy, really fast.
To use this plugin, add
barrier_around as a dependency in your pubspec.yaml file.
Create a GlobalKey in order to identify which widget you want to create the barrier around.
final GlobalKey _barrierKey = GlobalKey();
Wrap the widget you want to create the barrier around, and wrap it with a
Assign the GlobalKey to the
BarrierAround( key: _barrierKey, child: yourWidget )
Whenever you want to show the barrier, just call:
To dismiss the barrier, just tap on it, this behavior is enabled by default. If you want the barrier to not dismiss on tap, you can set
false in the
If you want to dismiss the barrier from other place, just call:
||If your widget has a border radius, this is the place to put it||
||Color of the barrier||
||Barrier blur sigmaX and sigmaY||
||Padding around target widget||
||Callback for the tap event on the barrier||
||If barrier must dismiss when user taps on it||
||If show/dismiss of the barrier is animated||
||If animateBarrier is