Fix argument exception

pull/1575/head
Aleksei 1 year ago
parent cb77385ad5
commit e712890456
  1. 7
      lib/src/widgets/raw_editor/raw_editor_state.dart
  2. 12
      lib/src/widgets/text_block.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');
}

@ -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');
}

Loading…
Cancel
Save