diff --git a/lib/app/features/feed/views/components/toolbar_buttons/toolbar_bold_button.dart b/lib/app/features/feed/views/components/toolbar_buttons/toolbar_bold_button.dart index 5a7cc8977..00fddf993 100644 --- a/lib/app/features/feed/views/components/toolbar_buttons/toolbar_bold_button.dart +++ b/lib/app/features/feed/views/components/toolbar_buttons/toolbar_bold_button.dart @@ -15,7 +15,8 @@ class ToolbarBoldButton extends HookWidget { @override Widget build(BuildContext context) { final fontStyles = useTextEditorFontStyles(textEditorController); - final styleManager = QuillStyleManager(textEditorController); + final styleManager = + useMemoized(() => QuillStyleManager(textEditorController), [textEditorController]); return ActionsToolbarButton( icon: Assets.svg.iconPostBoldtextOff, diff --git a/lib/app/features/feed/views/components/toolbar_buttons/toolbar_h1_button.dart b/lib/app/features/feed/views/components/toolbar_buttons/toolbar_h1_button.dart index 3b2eb2062..1282abd02 100644 --- a/lib/app/features/feed/views/components/toolbar_buttons/toolbar_h1_button.dart +++ b/lib/app/features/feed/views/components/toolbar_buttons/toolbar_h1_button.dart @@ -15,7 +15,8 @@ class ToolbarH1Button extends HookWidget { @override Widget build(BuildContext context) { final fontStyles = useTextEditorFontStyles(textEditorController); - final styleManager = QuillStyleManager(textEditorController); + final styleManager = + useMemoized(() => QuillStyleManager(textEditorController), [textEditorController]); return ActionsToolbarButton( icon: Assets.svg.iconArticleH1Off, diff --git a/lib/app/features/feed/views/components/toolbar_buttons/toolbar_h2_button.dart b/lib/app/features/feed/views/components/toolbar_buttons/toolbar_h2_button.dart index 460415532..b819da47d 100644 --- a/lib/app/features/feed/views/components/toolbar_buttons/toolbar_h2_button.dart +++ b/lib/app/features/feed/views/components/toolbar_buttons/toolbar_h2_button.dart @@ -15,7 +15,8 @@ class ToolbarH2Button extends HookWidget { @override Widget build(BuildContext context) { final fontStyles = useTextEditorFontStyles(textEditorController); - final styleManager = QuillStyleManager(textEditorController); + final styleManager = + useMemoized(() => QuillStyleManager(textEditorController), [textEditorController]); return ActionsToolbarButton( icon: Assets.svg.iconArticleH2Off, diff --git a/lib/app/features/feed/views/components/toolbar_buttons/toolbar_h3_button.dart b/lib/app/features/feed/views/components/toolbar_buttons/toolbar_h3_button.dart index 715ca5100..8817a91c9 100644 --- a/lib/app/features/feed/views/components/toolbar_buttons/toolbar_h3_button.dart +++ b/lib/app/features/feed/views/components/toolbar_buttons/toolbar_h3_button.dart @@ -15,7 +15,8 @@ class ToolbarH3Button extends HookWidget { @override Widget build(BuildContext context) { final fontStyles = useTextEditorFontStyles(textEditorController); - final styleManager = QuillStyleManager(textEditorController); + final styleManager = + useMemoized(() => QuillStyleManager(textEditorController), [textEditorController]); return ActionsToolbarButton( icon: Assets.svg.iconArticleH3Off, diff --git a/lib/app/features/feed/views/components/toolbar_buttons/toolbar_italic_button.dart b/lib/app/features/feed/views/components/toolbar_buttons/toolbar_italic_button.dart index a359ece76..ffabe4025 100644 --- a/lib/app/features/feed/views/components/toolbar_buttons/toolbar_italic_button.dart +++ b/lib/app/features/feed/views/components/toolbar_buttons/toolbar_italic_button.dart @@ -15,7 +15,8 @@ class ToolbarItalicButton extends HookWidget { @override Widget build(BuildContext context) { final fontStyles = useTextEditorFontStyles(textEditorController); - final styleManager = QuillStyleManager(textEditorController); + final styleManager = + useMemoized(() => QuillStyleManager(textEditorController), [textEditorController]); return ActionsToolbarButton( icon: Assets.svg.iconPostItalictextOff, diff --git a/lib/app/features/feed/views/components/toolbar_buttons/toolbar_link_button.dart b/lib/app/features/feed/views/components/toolbar_buttons/toolbar_link_button.dart index 766c23ae3..6b6a9dd48 100644 --- a/lib/app/features/feed/views/components/toolbar_buttons/toolbar_link_button.dart +++ b/lib/app/features/feed/views/components/toolbar_buttons/toolbar_link_button.dart @@ -1,13 +1,14 @@ // SPDX-License-Identifier: ice License 1.0 import 'package:flutter/cupertino.dart'; +import 'package:flutter_hooks/flutter_hooks.dart'; import 'package:flutter_quill/flutter_quill.dart'; import 'package:ion/app/extensions/extensions.dart'; import 'package:ion/app/features/feed/views/components/actions_toolbar_button/actions_toolbar_button.dart'; import 'package:ion/app/features/feed/views/components/text_editor/utils/quill_style_manager.dart'; import 'package:ion/generated/assets.gen.dart'; -class ToolbarLinkButton extends StatelessWidget { +class ToolbarLinkButton extends HookWidget { const ToolbarLinkButton({ required this.textEditorController, super.key, @@ -16,7 +17,8 @@ class ToolbarLinkButton extends StatelessWidget { @override Widget build(BuildContext context) { - final styleManager = QuillStyleManager(textEditorController); + final styleManager = + useMemoized(() => QuillStyleManager(textEditorController), [textEditorController]); return ActionsToolbarButton( icon: Assets.svg.iconArticleLink, diff --git a/lib/app/features/feed/views/components/toolbar_buttons/toolbar_regular_button.dart b/lib/app/features/feed/views/components/toolbar_buttons/toolbar_regular_button.dart index aa7ae042a..ffce15cec 100644 --- a/lib/app/features/feed/views/components/toolbar_buttons/toolbar_regular_button.dart +++ b/lib/app/features/feed/views/components/toolbar_buttons/toolbar_regular_button.dart @@ -15,7 +15,8 @@ class ToolbarRegularButton extends HookWidget { @override Widget build(BuildContext context) { final fontStyles = useTextEditorFontStyles(textEditorController); - final styleManager = QuillStyleManager(textEditorController); + final styleManager = + useMemoized(() => QuillStyleManager(textEditorController), [textEditorController]); return ActionsToolbarButton( icon: Assets.svg.iconPostRegulartextOff, diff --git a/lib/app/features/feed/views/components/toolbar_buttons/toolbar_underline_button.dart b/lib/app/features/feed/views/components/toolbar_buttons/toolbar_underline_button.dart index 4664e69c2..f55bd36e8 100644 --- a/lib/app/features/feed/views/components/toolbar_buttons/toolbar_underline_button.dart +++ b/lib/app/features/feed/views/components/toolbar_buttons/toolbar_underline_button.dart @@ -15,7 +15,8 @@ class ToolbarUnderlineButton extends HookWidget { @override Widget build(BuildContext context) { final fontStyles = useTextEditorFontStyles(textEditorController); - final styleManager = QuillStyleManager(textEditorController); + final styleManager = + useMemoized(() => QuillStyleManager(textEditorController), [textEditorController]); return ActionsToolbarButton( icon: Assets.svg.iconArticleUnderlineOff,