How to do mouse hover in Flutter?

This Article is posted by seven.srikanth at 23-05-2019 18:22:51

Click here to support us by Subscribing to our youtube channel.

You need to Wrap your widget inside a Listner.

Listener helps to track Mouse Touch and Trackpad events.

Here is the example,

bool _animiplaying = false;

void _startanime(PointerEnterEvent _) => setState(() => _animiplaying = true);
void _stopanime(PointerExitEvent _) => setState(() => _animiplaying = false);

Listner(
onPointerEnter: _startanime(),
onPointerExit: _stopanime(),
child: ...
//assign the _animiplaying to the widget to get the action
//AnimiWidget is a user defined widged used for example here, and it should accept animeplaying property.
AnimeWidget(animeplaying: _animiplaying)
...
)

Tags: mouse hover; mouse events;


Click here to support us by Subscribing to our youtube channel.




0 Comments
Login to comment.
Recent Comments

Be the first to Comment. You can ask a Query or Share your toughts or Just say thanks.




Wave animation in Flutter




Search Results





©2018 - Fluttercentral | Email to me - Seven.srikanth@gmail.com