DiagnosticsTreeStyle.oneLine for CupertinoThemeData (#48084)

This commit is contained in:
LongCatIsLooong
2020-01-10 14:23:02 -08:00
committed by Flutter GitHub Bot
parent 47bba44920
commit 02db6a8052
2 changed files with 13 additions and 2 deletions

View File

@@ -1086,7 +1086,7 @@ DiagnosticsProperty<Color> 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) {

View File

@@ -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) {