diff --git a/packages/flutter/test/painting/text_style_test.dart b/packages/flutter/test/painting/text_style_test.dart index 1658eb5913..6480a7f822 100644 --- a/packages/flutter/test/painting/text_style_test.dart +++ b/packages/flutter/test/painting/text_style_test.dart @@ -450,6 +450,13 @@ void main() { }); test('backgroundColor', () { + // TODO(matanlurey): Remove when https://github.com/flutter/engine/pull/44705 rolls into the framework. + // Currently, dithering is disabled by default, but it's about to be flipped (enabled by default), + // and deprecated. This avoids #44705 causing a breakage in this test. + // + // ignore: deprecated_member_use + Paint.enableDithering = true; + const TextStyle s1 = TextStyle(); expect(s1.backgroundColor, isNull); expect(s1.toString(), 'TextStyle()'); @@ -459,7 +466,16 @@ void main() { expect(s2.toString(), 'TextStyle(inherit: true, backgroundColor: Color(0xff00ff00))'); final ui.TextStyle ts2 = s2.getTextStyle(); - expect(ts2.toString(), contains('background: Paint(Color(0xff00ff00))')); + + // TODO(matanlurey): Remove when https://github.com/flutter/flutter/issues/133698 is resolved. + // There are 5+ implementations of Paint, so we should either align the toString() or stop + // testing it, IMO. + if (kIsWeb) { + // The web implementation never includes "dither: ..." as a property. + expect(ts2.toString(), contains('background: Paint(Color(0xff00ff00))')); + } else { + expect(ts2.toString(), contains('background: Paint(Color(0xff00ff00); dither: true)')); + } }); test('TextStyle background and backgroundColor combos', () {