Refactor code

pull/295/head
Xin Yao 4 years ago
parent 3d6e259078
commit 2aa577ca58
  1. 10
      lib/src/widgets/toolbar/clear_format_button.dart

@ -33,14 +33,14 @@ class _ClearFormatButtonState extends State<ClearFormatButton> {
icon: Icon(widget.icon, size: widget.iconSize, color: iconColor), icon: Icon(widget.icon, size: widget.iconSize, color: iconColor),
fillColor: fillColor, fillColor: fillColor,
onPressed: () { onPressed: () {
final keys = <Attribute>{}; final attrs = <Attribute>{};
for (final style in widget.controller.getAllSelectionStyles()) { for (final style in widget.controller.getAllSelectionStyles()) {
for (final k in style.attributes.values) { for (final attr in style.attributes.values) {
keys.add(k); attrs.add(attr);
} }
} }
for (final k in keys) { for (final attr in attrs) {
widget.controller.formatSelection(Attribute.clone(k, null)); widget.controller.formatSelection(Attribute.clone(attr, null));
} }
}); });
} }

Loading…
Cancel
Save