Update lib/widgets/editor/editor_toolbar.dart

Co-authored-by: Marcin Wojnarowski <xmarcinmarcin@gmail.com>
This commit is contained in:
Filip Krawczyk 2022-08-25 17:29:28 +02:00 committed by GitHub
parent b39d6b06d7
commit 90553794b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 8 deletions

View File

@ -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,