getSelectionStyle method

NotusStyle getSelectionStyle()

Returns style of specified text range.

If nothing is selected but we've toggled an attribute, we also merge those in our style before returning.

Implementation

NotusStyle getSelectionStyle() {
  final start = _selection.start;
  final length = _selection.end - start;
  var lineStyle = document.collectStyle(start, length);

  lineStyle = lineStyle.mergeAll(toggledStyles);

  return lineStyle;
}