Skip to content

Commit 62acb72

Browse files
committed
fix: QuillToolbarSelectLineHeightStyleDropdownButton ignores defaultDisplayText
1 parent e14689b commit 62acb72

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

lib/src/toolbar/buttons/select_line_height_dropdown_button.dart

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ class _QuillToolbarSelectLineHeightStyleDropdownButtonState
4848
Attribute<dynamic> _selectedItem = Attribute.lineHeight;
4949

5050
final _menuController = MenuController();
51+
5152
@override
5253
void initState() {
5354
super.initState();
@@ -97,9 +98,17 @@ class _QuillToolbarSelectLineHeightStyleDropdownButtonState
9798

9899
String _label(Attribute<dynamic> attribute) {
99100
var label = LineHeightAttribute.lineHeightNormal.value.toString();
101+
100102
if (attribute.value != null) {
101103
label = attribute.value.toString();
104+
} else {
105+
final defaultDisplayText = widget.options.defaultDisplayText;
106+
107+
if (defaultDisplayText != null && defaultDisplayText.isNotEmpty) {
108+
label = defaultDisplayText;
109+
}
102110
}
111+
103112
return label;
104113
}
105114

0 commit comments

Comments
 (0)