@@ -265,6 +265,7 @@ Int32List _encodeTextStyle(
265
265
TextDecoration decoration,
266
266
Color decorationColor,
267
267
TextDecorationStyle decorationStyle,
268
+ double decorationThickness,
268
269
FontWeight fontWeight,
269
270
FontStyle fontStyle,
270
271
TextBaseline textBaseline,
@@ -296,20 +297,23 @@ Int32List _encodeTextStyle(
296
297
result[0 ] | = 1 << 4 ;
297
298
result[4 ] = decorationStyle.index;
298
299
}
299
- if (fontWeight != null ) {
300
+ if (decorationThickness != null ) {
300
301
result[0 ] | = 1 << 5 ;
302
+ }
303
+ if (fontWeight != null ) {
304
+ result[0 ] | = 1 << 6 ;
301
305
result[5 ] = fontWeight.index;
302
306
}
303
307
if (fontStyle != null ) {
304
- result[0 ] | = 1 << 6 ;
308
+ result[0 ] | = 1 << 7 ;
305
309
result[6 ] = fontStyle.index;
306
310
}
307
311
if (textBaseline != null ) {
308
- result[0 ] | = 1 << 7 ;
312
+ result[0 ] | = 1 << 8 ;
309
313
result[7 ] = textBaseline.index;
310
314
}
311
315
if (fontFamily != null || (fontFamilyFallback != null && fontFamilyFallback.isNotEmpty)) {
312
- result[0 ] | = 1 << 8 ;
316
+ result[0 ] | = 1 << 9 ;
313
317
// Passed separately to native.
314
318
}
315
319
if (fontSize != null ) {
@@ -355,6 +359,7 @@ class TextStyle {
355
359
/// * `decoration` : The decorations to paint near the text (e.g., an underline).
356
360
/// * `decorationColor` : The color in which to paint the text decorations.
357
361
/// * `decorationStyle` : The style in which to paint the text decorations (e.g., dashed).
362
+ /// * `decorationThickness` : The thickness of the decoration as a muliplier on the thickness specified by the font.
358
363
/// * `fontWeight` : The typeface thickness to use when painting the text (e.g., bold).
359
364
/// * `fontStyle` : The typeface variant to use when drawing the letters (e.g., italics).
360
365
/// * `fontFamily` : The name of the font to use when painting the text (e.g., Roboto). If a `fontFamilyFallback` is
@@ -379,6 +384,7 @@ class TextStyle {
379
384
TextDecoration decoration,
380
385
Color decorationColor,
381
386
TextDecorationStyle decorationStyle,
387
+ double decorationThickness,
382
388
FontWeight fontWeight,
383
389
FontStyle fontStyle,
384
390
TextBaseline textBaseline,
@@ -401,6 +407,7 @@ class TextStyle {
401
407
decoration,
402
408
decorationColor,
403
409
decorationStyle,
410
+ decorationThickness,
404
411
fontWeight,
405
412
fontStyle,
406
413
textBaseline,
@@ -421,6 +428,7 @@ class TextStyle {
421
428
_letterSpacing = letterSpacing,
422
429
_wordSpacing = wordSpacing,
423
430
_height = height,
431
+ _decorationThickness = decorationThickness,
424
432
_locale = locale,
425
433
_background = background,
426
434
_foreground = foreground,
@@ -433,6 +441,7 @@ class TextStyle {
433
441
final double _letterSpacing;
434
442
final double _wordSpacing;
435
443
final double _height;
444
+ final double _decorationThickness;
436
445
final Locale _locale;
437
446
final Paint _background;
438
447
final Paint _foreground;
@@ -450,6 +459,7 @@ class TextStyle {
450
459
_letterSpacing != typedOther._letterSpacing ||
451
460
_wordSpacing != typedOther._wordSpacing ||
452
461
_height != typedOther._height ||
462
+ _decorationThickness != typedOther._decorationThickness ||
453
463
_locale != typedOther._locale ||
454
464
_background != typedOther._background ||
455
465
_foreground != typedOther._foreground)
@@ -466,31 +476,32 @@ class TextStyle {
466
476
}
467
477
468
478
@override
469
- int get hashCode => hashValues (hashList (_encoded), _fontFamily, _fontFamilyFallback, _fontSize, _letterSpacing, _wordSpacing, _height, _locale, _background, _foreground, _shadows);
479
+ int get hashCode => hashValues (hashList (_encoded), _fontFamily, _fontFamilyFallback, _fontSize, _letterSpacing, _wordSpacing, _height, _locale, _background, _foreground, _shadows, _decorationThickness );
470
480
471
481
@override
472
482
String toString () {
473
483
return 'TextStyle('
474
- 'color: ${ _encoded [0 ] & 0x00002 == 0x00002 ? new Color (_encoded [1 ]) : "unspecified" }, '
475
- 'decoration: ${ _encoded [0 ] & 0x00004 == 0x00004 ? new TextDecoration ._ (_encoded [2 ]) : "unspecified" }, '
476
- 'decorationColor: ${ _encoded [0 ] & 0x00008 == 0x00008 ? new Color (_encoded [3 ]) : "unspecified" }, '
477
- 'decorationStyle: ${ _encoded [0 ] & 0x00010 == 0x00010 ? TextDecorationStyle .values [_encoded [4 ]] : "unspecified" }, '
478
- 'fontWeight: ${ _encoded [0 ] & 0x00020 == 0x00020 ? FontWeight .values [_encoded [5 ]] : "unspecified" }, '
479
- 'fontStyle: ${ _encoded [0 ] & 0x00040 == 0x00040 ? FontStyle .values [_encoded [6 ]] : "unspecified" }, '
480
- 'textBaseline: ${ _encoded [0 ] & 0x00080 == 0x00080 ? TextBaseline .values [_encoded [7 ]] : "unspecified" }, '
481
- 'fontFamily: ${ _encoded [0 ] & 0x00100 == 0x00100
482
- && _fontFamily != null ? _fontFamily : "unspecified" }, '
483
- 'fontFamilyFallback: ${_encoded [0 ] & 0x00100 == 0x00100
484
- && _fontFamilyFallback != null
485
- && _fontFamilyFallback .isNotEmpty ? _fontFamilyFallback : "unspecified" }, '
486
- 'fontSize: ${ _encoded [0 ] & 0x00200 == 0x00200 ? _fontSize : "unspecified" }, '
487
- 'letterSpacing: ${ _encoded [0 ] & 0x00400 == 0x00400 ? "${_letterSpacing }x" : "unspecified" }, '
488
- 'wordSpacing: ${ _encoded [0 ] & 0x00800 == 0x00800 ? "${_wordSpacing }x" : "unspecified" }, '
489
- 'height: ${ _encoded [0 ] & 0x01000 == 0x01000 ? "${_height }x" : "unspecified" }, '
490
- 'locale: ${ _encoded [0 ] & 0x02000 == 0x02000 ? _locale : "unspecified" }, '
491
- 'background: ${ _encoded [0 ] & 0x04000 == 0x04000 ? _background : "unspecified" }, '
492
- 'foreground: ${ _encoded [0 ] & 0x08000 == 0x08000 ? _foreground : "unspecified" }, '
493
- 'shadows: ${ _encoded [0 ] & 0x10000 == 0x10000 ? _shadows : "unspecified" }'
484
+ 'color: ${ _encoded [0 ] & 0x00002 == 0x00002 ? new Color (_encoded [1 ]) : "unspecified" }, '
485
+ 'decoration: ${ _encoded [0 ] & 0x00004 == 0x00004 ? new TextDecoration ._ (_encoded [2 ]) : "unspecified" }, '
486
+ 'decorationColor: ${ _encoded [0 ] & 0x00008 == 0x00008 ? new Color (_encoded [3 ]) : "unspecified" }, '
487
+ 'decorationStyle: ${ _encoded [0 ] & 0x00010 == 0x00010 ? TextDecorationStyle .values [_encoded [4 ]] : "unspecified" }, '
488
+ 'decorationThickness: ${_encoded [0 ] & 0x00020 == 0x00020 ? _decorationThickness : "unspecified" }, '
489
+ 'fontWeight: ${ _encoded [0 ] & 0x00040 == 0x00040 ? FontWeight .values [_encoded [5 ]] : "unspecified" }, '
490
+ 'fontStyle: ${ _encoded [0 ] & 0x00080 == 0x00080 ? FontStyle .values [_encoded [6 ]] : "unspecified" }, '
491
+ 'textBaseline: ${ _encoded [0 ] & 0x00100 == 0x00100 ? TextBaseline .values [_encoded [7 ]] : "unspecified" }, '
492
+ 'fontFamily: ${ _encoded [0 ] & 0x00200 == 0x00200
493
+ && _fontFamily != null ? _fontFamily : "unspecified" }, '
494
+ 'fontFamilyFallback: ${ _encoded [0 ] & 0x00200 == 0x00200
495
+ && _fontFamilyFallback != null
496
+ && _fontFamilyFallback .isNotEmpty ? _fontFamilyFallback : "unspecified" }, '
497
+ 'fontSize: ${ _encoded [0 ] & 0x00400 == 0x00400 ? _fontSize : "unspecified" }, '
498
+ 'letterSpacing: ${ _encoded [0 ] & 0x00800 == 0x00800 ? "${_letterSpacing }x" : "unspecified" }, '
499
+ 'wordSpacing: ${ _encoded [0 ] & 0x01000 == 0x01000 ? "${_wordSpacing }x" : "unspecified" }, '
500
+ 'height: ${ _encoded [0 ] & 0x02000 == 0x02000 ? "${_height }x" : "unspecified" }, '
501
+ 'locale: ${ _encoded [0 ] & 0x04000 == 0x04000 ? _locale : "unspecified" }, '
502
+ 'background: ${ _encoded [0 ] & 0x08000 == 0x08000 ? _background : "unspecified" }, '
503
+ 'foreground: ${ _encoded [0 ] & 0x10000 == 0x10000 ? _foreground : "unspecified" }, '
504
+ 'shadows: ${ _encoded [0 ] & 0x20000 == 0x20000 ? _shadows : "unspecified" }'
494
505
')' ;
495
506
}
496
507
}
0 commit comments