Skip to content

Commit

Permalink
refactor: clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
ice-hector committed Jan 8, 2025
1 parent 0c77120 commit 4184426
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:flutter_quill/flutter_quill.dart';
import 'package:ion/app/services/logger/logger.dart';

enum FontType { regular, bold, italic, h1, h2, h3, underline }

Expand All @@ -14,9 +13,6 @@ Set<FontType> useTextEditorFontStyles(QuillController textEditorController) {
final style = textEditorController.getSelectionStyle();
final activeStyles = <FontType>{};

Logger.log('style.attributes: ${style.attributes}');

// Check for header styles (h1, h2, h3)
if (style.attributes.containsKey(Attribute.header.key)) {
final headerValue = style.attributes[Attribute.header.key]!.value;
if (headerValue == 1) {
Expand All @@ -27,11 +23,9 @@ Set<FontType> useTextEditorFontStyles(QuillController textEditorController) {
activeStyles.add(FontType.h3);
}
} else {
// If no header is applied, mark it as regular
activeStyles.add(FontType.regular);
}

// Check for bold, italic, and underline styles
if (style.attributes.containsKey(Attribute.bold.key)) {
activeStyles.add(FontType.bold);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// SPDX-License-Identifier: ice License 1.0

import 'package:flutter_quill/flutter_quill.dart';
import 'package:ion/app/services/logger/logger.dart';

void toggleHeaderStyle(QuillController controller, Attribute<dynamic> headerAttribute) {
final currentStyle = controller.getSelectionStyle();
Expand All @@ -21,7 +20,6 @@ void toggleTextStyle(QuillController controller, Attribute<dynamic> textAttribut

final mutuallyExclusiveStyles = [Attribute.bold.key, Attribute.italic.key];

Logger.log('currentStyle.attributes: ${currentStyle.attributes}');
final hasHeaderOrLink = currentStyle.attributes.keys.any(
(key) => ['h1', 'h2', 'h3', Attribute.link.key].contains(key),
);
Expand Down

0 comments on commit 4184426

Please sign in to comment.