Flutter widget AbsorbPointer
When absorbing is true, this widget prevents its subtree from receiving pointer events by terminating hit testing at itself. It still consumes space during layout and paints its child as usual. It just prevents its children from being the target of located events, because it returns true from RenderBox.hitTest.
Constructors
Properties
- absorbing → bool
- Whether this widget absorbs pointers during hit testing.
Using
AbsorbPointer
Below is the constructor of
AbsorbPointer
along with its properties:const AbsorbPointer({Key key,this.absorbing = true,Widget child,this.ignoringSemantics,})Properties:
Key key
: The widget key, used to control if it's should be replaced.bool absorbing
: Whether this widget absorbs pointers during hit testing. Defaults totrue
.bool ignoringSemantics
: Whether the semantics of this widget is ignored when compiling the semantics tree.Widget child
: The widget to be rendered.
If
absorbing
value is true, any click inside the widget will be absorbed. If you don't passabsorbing
parameter, it will use the default value (true
) which causes any pointer inside the widget will be absorbed.The usage of
AbsorbPointer
is similar toIgnorePointer
, just changeignoring
property with absorbing.IgnorePointer(ignoring: _ignoring,child: MyWidget(),)
Flutter widget AbsorbPointer
Reviewed by Admin
on
5:02 AM
Rating:
No comments: