Skip to content

Commit

Permalink
fix: pr comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ice-hector committed Jan 9, 2025
1 parent 8f98cfa commit 0ca3418
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
@@ -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,
Expand All @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 0ca3418

Please sign in to comment.