styleWithHeight property

TextStyle styleWithHeight

Returns a TextStyle merged from style and height.

This needs to be done because TextStyle with existing height cannot be copied with height=null. See flutter/flutter#58765.

Implementation

TextStyle get styleWithHeight =>
    height != null && height >= 0 ? style.copyWith(height: height) : style;