Skip to content

Commit 85f6446

Browse files
authored
Merge pull request Sub6Resources#306 from vanlooverenkoen/feature/Sub6Resources#233-line-height-support
Sub6Resources#233: Added supoort for line-height
2 parents 5cea1b4 + 1fcc047 commit 85f6446

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

lib/style.dart

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,16 @@ class Style {
152152
/// Default: normal (0)
153153
double wordSpacing;
154154

155+
/// CSS attribute "`line-height`"
156+
///
157+
/// Supported values: double values
158+
///
159+
/// Unsupported values: normal, 80%, ..
160+
///
161+
/// Inherited: no,
162+
/// Default: Unspecified (null),
163+
double lineHeight;
164+
155165
//TODO modify these to match CSS styles
156166
String before;
157167
String after;
@@ -170,6 +180,7 @@ class Style {
170180
this.fontStyle,
171181
this.fontWeight,
172182
this.height,
183+
this.lineHeight,
173184
this.letterSpacing,
174185
this.listStyleType,
175186
this.padding,
@@ -212,9 +223,9 @@ class Style {
212223
letterSpacing: letterSpacing,
213224
shadows: textShadow,
214225
wordSpacing: wordSpacing,
226+
height: lineHeight,
215227
//TODO background
216228
//TODO textBaseline
217-
//TODO height
218229
);
219230
}
220231

@@ -237,6 +248,7 @@ class Style {
237248
fontStyle: other.fontStyle,
238249
fontWeight: other.fontWeight,
239250
height: other.height,
251+
lineHeight: other.lineHeight,
240252
letterSpacing: other.letterSpacing,
241253
listStyleType: other.listStyleType,
242254
padding: other.padding,
@@ -294,6 +306,7 @@ class Style {
294306
FontStyle fontStyle,
295307
FontWeight fontWeight,
296308
double height,
309+
double lineHeight,
297310
double letterSpacing,
298311
ListStyleType listStyleType,
299312
EdgeInsets padding,
@@ -325,6 +338,7 @@ class Style {
325338
fontStyle: fontStyle ?? this.fontStyle,
326339
fontWeight: fontWeight ?? this.fontWeight,
327340
height: height ?? this.height,
341+
lineHeight: lineHeight ?? this.lineHeight,
328342
letterSpacing: letterSpacing ?? this.letterSpacing,
329343
listStyleType: listStyleType ?? this.listStyleType,
330344
padding: padding ?? this.padding,
@@ -363,6 +377,7 @@ class Style {
363377
this.letterSpacing = textStyle.letterSpacing;
364378
this.textShadow = textStyle.shadows;
365379
this.wordSpacing = textStyle.wordSpacing;
380+
this.lineHeight = textStyle.height;
366381
}
367382
}
368383

0 commit comments

Comments
 (0)