How to do mouse hover in Flutter?

This Article is posted by seven.srikanth at 5/23/2019 6:22:51 PM



<p>You need to Wrap your widget inside a Listner. Listener helps to track Mouse Touch and Trackpad events. Here is the example, color: rgb(212, 212, 212); background-color: rgb(30, 30, 30); font-family: Consolas, "Courier New", monospace; font-size: 14px; line-height: 19px; white-space: pre;](color: #569cd6;](bool _animiplaying = color: #569cd6;](false; color: #569cd6;](void _startanime(PointerEnterEvent _) => setState(() => _animiplaying = color: #569cd6;](true);color: #569cd6;](void _stopanime(PointerExitEvent _) => setState(() => _animiplaying = color: #569cd6;](false); Listner( onPointerEnter: _startanime(), onPointerExit: _stopanime(), child: ... color: #6a9955;](//assign the _animiplaying to the widget to get the action color: #6a9955;](//AnimiWidget is a user defined widged used for example here, and it should accept animeplaying property. AnimeWidget(animeplaying: _animiplaying) ...)</p>


Tags: mouse hover; mouse events;








0 Comments
Login to comment.
Recent Comments