Unverified Commit cad08149 authored by Gary Qian's avatar Gary Qian Committed by GitHub

Remove invalid assert for TextHeightBehavior (#50603)

parent 953df281
......@@ -346,7 +346,6 @@ class TextPainter {
ui.TextHeightBehavior get textHeightBehavior => _textHeightBehavior;
ui.TextHeightBehavior _textHeightBehavior;
set textHeightBehavior(ui.TextHeightBehavior value) {
assert(value != null);
if (_textHeightBehavior == value)
return;
_textHeightBehavior = value;
......
......@@ -730,6 +730,15 @@ void main() {
expect(painter.inlinePlaceholderBoxes[13], const TextBox.fromLTRBD(351, 30, 401, 60, TextDirection.ltr));
}, skip: isBrowser);
// Null values are valid. See https://github.com/flutter/flutter/pull/48346#issuecomment-584839221
test('TextPainter set TextHeightBehavior null test', () {
final TextPainter painter = TextPainter(textHeightBehavior: null)
..textDirection = TextDirection.ltr;
painter.textHeightBehavior = const TextHeightBehavior();
painter.textHeightBehavior = null;
});
test('TextPainter line metrics', () {
final TextPainter painter = TextPainter()
..textDirection = TextDirection.ltr;
......
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