From e71289045612211aad98dffb420acb9798913000 Mon Sep 17 00:00:00 2001 From: Aleksei <130981115+MacDeveloper1@users.noreply.github.com> Date: Thu, 7 Dec 2023 10:13:29 +0100 Subject: [PATCH] Fix argument exception --- lib/src/widgets/raw_editor/raw_editor_state.dart | 7 +++++++ lib/src/widgets/text_block.dart | 12 ++++++++++++ 2 files changed, 19 insertions(+) diff --git a/lib/src/widgets/raw_editor/raw_editor_state.dart b/lib/src/widgets/raw_editor/raw_editor_state.dart index dc13082f..9d732205 100644 --- a/lib/src/widgets/raw_editor/raw_editor_state.dart +++ b/lib/src/widgets/raw_editor/raw_editor_state.dart @@ -808,6 +808,13 @@ class QuillRawEditorState extends EditorState return defaultStyles!.h2!.verticalSpacing; case 3: return defaultStyles!.h3!.verticalSpacing; + case 4: + return defaultStyles!.h4!.verticalSpacing; + case 5: + return defaultStyles!.h5!.verticalSpacing; + case 6: + return defaultStyles!.h6!.verticalSpacing; + default: throw ArgumentError('Invalid level $level'); } diff --git a/lib/src/widgets/text_block.dart b/lib/src/widgets/text_block.dart index 1f70c9af..4824bab7 100644 --- a/lib/src/widgets/text_block.dart +++ b/lib/src/widgets/text_block.dart @@ -312,6 +312,18 @@ class EditableTextBlock extends StatelessWidget { top = defaultStyles!.h3!.verticalSpacing.top; bottom = defaultStyles.h3!.verticalSpacing.bottom; break; + case 4: + top = defaultStyles!.h4!.verticalSpacing.top; + bottom = defaultStyles.h4!.verticalSpacing.bottom; + break; + case 5: + top = defaultStyles!.h5!.verticalSpacing.top; + bottom = defaultStyles.h5!.verticalSpacing.bottom; + break; + case 6: + top = defaultStyles!.h6!.verticalSpacing.top; + bottom = defaultStyles.h6!.verticalSpacing.bottom; + break; default: throw ArgumentError('Invalid level $level'); }