How can the cursor appearance be changed within Flutter? I know that with the Listener() Widget we can listen for Mouse-Events, but I haven\'t found any information regarding h
From Flutter beta version 1.19.0-4.1.pre
, add id to body
and set cursor of that doesn't work. Because flt-glass-pane
is replacing the cursor.
So the solution is that set cursor directly to flt-glass-pane
.
Below is the update that is working.
class HandCursor extends MouseRegion {
static final appContainer = html.window.document.querySelectorAll('flt-glass-pane')[0];
HandCursor({Widget child}) : super(
onHover: (PointerHoverEvent evt) {
appContainer.style.cursor='pointer';
},
onExit: (PointerExitEvent evt) {
appContainer.style.cursor='default';
},
child: child
);
}