Unverified Commit e18c34ab authored by Dan Field's avatar Dan Field Committed by GitHub

Fix text direction nullability (#111513)

parent b54b5281
...@@ -222,11 +222,13 @@ class TextPainter { ...@@ -222,11 +222,13 @@ class TextPainter {
/// This is a convenience method that creates a text painter with the supplied /// This is a convenience method that creates a text painter with the supplied
/// parameters, lays it out with the supplied [minWidth] and [maxWidth], and /// parameters, lays it out with the supplied [minWidth] and [maxWidth], and
/// returns its [TextPainter.width] making sure to dispose the underlying /// returns its [TextPainter.width] making sure to dispose the underlying
/// resources. /// resources. Doing this operation is expensive and should be avoided
/// whenever it is possible to preserve the [TextPainter] to paint the
/// text or get other information about it.
static double computeWidth({ static double computeWidth({
required InlineSpan text, required InlineSpan text,
required TextDirection textDirection,
TextAlign textAlign = TextAlign.start, TextAlign textAlign = TextAlign.start,
TextDirection? textDirection,
double textScaleFactor = 1.0, double textScaleFactor = 1.0,
int? maxLines, int? maxLines,
String? ellipsis, String? ellipsis,
...@@ -262,11 +264,13 @@ class TextPainter { ...@@ -262,11 +264,13 @@ class TextPainter {
/// This is a convenience method that creates a text painter with the supplied /// This is a convenience method that creates a text painter with the supplied
/// parameters, lays it out with the supplied [minWidth] and [maxWidth], and /// parameters, lays it out with the supplied [minWidth] and [maxWidth], and
/// returns its [TextPainter.maxIntrinsicWidth] making sure to dispose the /// returns its [TextPainter.maxIntrinsicWidth] making sure to dispose the
/// underlying resources. /// underlying resources. Doing this operation is expensive and should be avoided
/// whenever it is possible to preserve the [TextPainter] to paint the
/// text or get other information about it.
static double computeMaxIntrinsicWidth({ static double computeMaxIntrinsicWidth({
required InlineSpan text, required InlineSpan text,
required TextDirection textDirection,
TextAlign textAlign = TextAlign.start, TextAlign textAlign = TextAlign.start,
TextDirection? textDirection,
double textScaleFactor = 1.0, double textScaleFactor = 1.0,
int? maxLines, int? maxLines,
String? ellipsis, String? ellipsis,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment