Replies: 1 comment
-
Hello! The final focusNode = FocusNode();
@override
void initState() {
super.initState();
focusNode.addListener(() {
if (focusNode.hasFocus) print('widget got focus');
});
}
Focus(
focusNode: focusNode:
), You can also use FocusableActionDetector(
onShowFocusHighlight: (v) { v ? print('get focus') : print('lost focus';) },
), See https://api.flutter.dev/flutter/widgets/FocusableActionDetector-class.html The HoverButton(
onPressed: () { print('pressed'); },
builder: (BuildContext context, states) {
return FocusBorder(
focused: states.isFocused,
child: ...,
);
},
) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
It would help a lot if there is a way to call a function when a widget gets focus by Reveal Focus.
What I think:
Beta Was this translation helpful? Give feedback.
All reactions