mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
feat: lineThrough and underline can coexist
This commit is contained in:
parent
585c9f8753
commit
06d11a91d1
@ -204,12 +204,15 @@ class RichTextStyle {
|
||||
|
||||
// underline or strikethrough
|
||||
TextDecoration get textDecoration {
|
||||
var decorations = [TextDecoration.none];
|
||||
if (attributes.underline || attributes.href != null) {
|
||||
return TextDecoration.underline;
|
||||
} else if (attributes.strikethrough) {
|
||||
return TextDecoration.lineThrough;
|
||||
decorations.add(TextDecoration.underline);
|
||||
// TextDecoration.underline;
|
||||
}
|
||||
return TextDecoration.none;
|
||||
if (attributes.strikethrough) {
|
||||
decorations.add(TextDecoration.lineThrough);
|
||||
}
|
||||
return TextDecoration.combine(decorations);
|
||||
}
|
||||
|
||||
// font
|
||||
|
@ -97,11 +97,6 @@ bool formatRichTextPartialStyle(EditorState editorState, String styleKey) {
|
||||
Attributes attributes = {
|
||||
styleKey: value,
|
||||
};
|
||||
if (styleKey == StyleKey.underline && value) {
|
||||
attributes[StyleKey.strikethrough] = null;
|
||||
} else if (styleKey == StyleKey.strikethrough && value) {
|
||||
attributes[StyleKey.underline] = null;
|
||||
}
|
||||
|
||||
return formatRichTextStyle(editorState, attributes);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user