Add asseert for header style

pull/1575/head
Aleksei 1 year ago
parent a2cc5d2c7b
commit 9966d17851
  1. 7
      lib/src/widgets/toolbar/buttons/dropdown_header_style.dart

@ -251,7 +251,7 @@ class _QuillToolbarSelectHeaderStyleDropdownButtonState
header.value,
style: TextStyle(
fontSize: options.renderItemTextStyle
? _headerTextStyles![header.key]!.fontSize ??
? _headerStyle(header.key).fontSize ??
DefaultTextStyle.of(context).style.fontSize ??
14
: null,
@ -275,4 +275,9 @@ class _QuillToolbarSelectHeaderStyleDropdownButtonState
controller.formatSelection(attribute0);
afterButtonPressed?.call();
}
TextStyle _headerStyle(Attribute attribute) {
assert(_headerTextStyles!.containsKey(attribute));
return _headerTextStyles![attribute]!;
}
}

Loading…
Cancel
Save