From 02db6a80527320073672f4f11831481d9c942677 Mon Sep 17 00:00:00 2001 From: LongCatIsLooong <31859944+LongCatIsLooong@users.noreply.github.com> Date: Fri, 10 Jan 2020 14:23:02 -0800 Subject: [PATCH] DiagnosticsTreeStyle.oneLine for CupertinoThemeData (#48084) --- packages/flutter/lib/src/cupertino/colors.dart | 2 +- packages/flutter/test/cupertino/theme_test.dart | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) 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) {