diff --git a/packages/flutter/lib/src/material/material.dart b/packages/flutter/lib/src/material/material.dart index 847c3e6e66..fb29b43013 100644 --- a/packages/flutter/lib/src/material/material.dart +++ b/packages/flutter/lib/src/material/material.dart @@ -257,14 +257,16 @@ class Material extends StatefulWidget { /// The default value is [kThemeChangeDuration]. final Duration animationDuration; - /// If non-null, the corners of this box are rounded by this [BorderRadius]. + /// If non-null, the corners of this box are rounded by this + /// [BorderRadiusGeometry] value. + /// /// Otherwise, the corners specified for the current [type] of material are /// used. /// /// If [shape] is non null then the border radius is ignored. /// /// Must be null if [type] is [MaterialType.circle]. - final BorderRadius borderRadius; + final BorderRadiusGeometry borderRadius; /// The ink controller from the closest instance of this class that /// encloses the given context. @@ -292,7 +294,7 @@ class Material extends StatefulWidget { textStyle?.debugFillProperties(properties, prefix: 'textStyle.'); properties.add(DiagnosticsProperty('shape', shape, defaultValue: null)); properties.add(DiagnosticsProperty('borderOnForeground', borderOnForeground, defaultValue: true)); - properties.add(EnumProperty('borderRadius', borderRadius, defaultValue: null)); + properties.add(DiagnosticsProperty('borderRadius', borderRadius, defaultValue: null)); } /// The default radius of an ink splash in logical pixels. diff --git a/packages/flutter/test/material/material_test.dart b/packages/flutter/test/material/material_test.dart index 0f3f45882c..2496f1b042 100644 --- a/packages/flutter/test/material/material_test.dart +++ b/packages/flutter/test/material/material_test.dart @@ -56,6 +56,41 @@ class PaintRecorder extends CustomPainter { } void main() { + testWidgets('default Material debugFillProperties', (WidgetTester tester) async { + final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); + const Material().debugFillProperties(builder); + + final List description = builder.properties + .where((DiagnosticsNode node) => !node.isFiltered(DiagnosticLevel.info)) + .map((DiagnosticsNode node) => node.toString()) + .toList(); + + expect(description, ['type: canvas']); + }); + + testWidgets('Material implements debugFillProperties', (WidgetTester tester) async { + final DiagnosticPropertiesBuilder builder = DiagnosticPropertiesBuilder(); + const Material( + type: MaterialType.canvas, + color: Color(0xFFFFFFFF), + textStyle: TextStyle(color: Color(0xff00ff00)), + borderRadius: BorderRadiusDirectional.all(Radius.circular(10)), + ).debugFillProperties(builder); + + final List description = builder.properties + .where((DiagnosticsNode node) => !node.isFiltered(DiagnosticLevel.info)) + .map((DiagnosticsNode node) => node.toString()) + .toList(); + + expect(description, [ + 'type: canvas', + 'color: Color(0xffffffff)', + 'textStyle.inherit: true', + 'textStyle.color: Color(0xff00ff00)', + 'borderRadius: BorderRadiusDirectional.circular(10.0)' + ]); + }); + testWidgets('LayoutChangedNotification test', (WidgetTester tester) async { await tester.pumpWidget( Material(