Update lib/widgets/editor/editor_toolbar.dart
Co-authored-by: Marcin Wojnarowski <xmarcinmarcin@gmail.com>
This commit is contained in:
parent
b39d6b06d7
commit
90553794b2
|
@ -54,14 +54,7 @@ class EditorToolbar extends HookWidget {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final visible = useState(editorFocusNode.hasFocus);
|
final visible = useListenable(editorFocusNode).hasFocus;
|
||||||
useEffect(() {
|
|
||||||
editorFocusNode.addListener(() {
|
|
||||||
visible.value = editorFocusNode.hasFocus;
|
|
||||||
});
|
|
||||||
|
|
||||||
return;
|
|
||||||
}, [editorFocusNode]);
|
|
||||||
|
|
||||||
return MobxProvider(
|
return MobxProvider(
|
||||||
create: (context) => store,
|
create: (context) => store,
|
||||||
|
|
Loading…
Reference in New Issue