added docs comments

pull/1972/head
CatHood0 9 months ago
parent ec671938b2
commit ad0aac57ed
  1. 8
      lib/src/models/documents/attribute.dart
  2. 2
      lib/src/widgets/quill/text_line.dart

@ -342,23 +342,23 @@ class HeaderAttribute extends Attribute<int?> {
: super('header', AttributeScope.block, level);
}
/// This attribute represents the space between text lines. The line height can be
/// adjusted using predefined constants or custom values
///
/// The attribute at the json looks like: "attributes":{"line-height": 1.5 }
class LineHeightAttribute extends Attribute<double?> {
const LineHeightAttribute({double? lineHeight})
: super('line-height', AttributeScope.block, lineHeight);
/// "attributes":{"line-height": 1.0 }
static const Attribute<double?> lineHeightNormal =
LineHeightAttribute(lineHeight: 1);
/// "attributes":{"line-height": 1.15 }
static const Attribute<double?> lineHeightTight =
LineHeightAttribute(lineHeight: 1.15);
/// "attributes":{"line-height": 1.5 }
static const Attribute<double?> lineHeightOneAndHalf =
LineHeightAttribute(lineHeight: 1.5);
/// "attributes":{"line-height": 2.0 }
static const Attribute<double?> lineHeightDouble =
LineHeightAttribute(lineHeight: 2);
}

@ -304,6 +304,8 @@ class _TextLineState extends State<TextLine> {
defaultStyles.lineHeightDouble!.style,
};
// If the lineHeight attribute isn't null, then get just the height param instead whole TextStyle
// to avoid modify the current style of the text line
textStyle =
textStyle.merge(textStyle.copyWith(height: x[lineHeight]?.height));

Loading…
Cancel
Save