diff --git a/packages/flutter/lib/src/cupertino/colors.dart b/packages/flutter/lib/src/cupertino/colors.dart index 282a4abcd7..b0c22ca0fd 100644 --- a/packages/flutter/lib/src/cupertino/colors.dart +++ b/packages/flutter/lib/src/cupertino/colors.dart @@ -1086,7 +1086,7 @@ DiagnosticsProperty createCupertinoColorProperty( Color value, { bool showName = true, Object defaultValue = kNoDefaultValue, - DiagnosticsTreeStyle style = DiagnosticsTreeStyle.shallow, + DiagnosticsTreeStyle style = DiagnosticsTreeStyle.singleLine, DiagnosticLevel level = DiagnosticLevel.info, }) { if (value is CupertinoDynamicColor) { diff --git a/packages/flutter/test/cupertino/theme_test.dart b/packages/flutter/test/cupertino/theme_test.dart index 2f3d4dfaee..b874f0548c 100644 --- a/packages/flutter/test/cupertino/theme_test.dart +++ b/packages/flutter/test/cupertino/theme_test.dart @@ -190,13 +190,24 @@ void main() { 'navLargeTitleTextStyle', 'navActionTextStyle', 'pickerTextStyle', - 'dateTimePickerTextStyle' + 'dateTimePickerTextStyle', } ), isTrue, ); }); + testWidgets('CupertinoTheme.toStringDeep uses single-line style', (WidgetTester tester) async { + // Regression test for https://github.com/flutter/flutter/issues/47651. + expect( + const CupertinoTheme( + data: CupertinoThemeData(primaryColor: Color(0x00000000)), + child: SizedBox(), + ).toStringDeep().trimRight(), + isNot(contains('\n')), + ); + }); + Brightness currentBrightness; void colorMatches(Color componentColor, CupertinoDynamicColor expectedDynamicColor) { switch (currentBrightness) {