From 0b13f4b4b52635cfb4b232d3e923bb5c979d9326 Mon Sep 17 00:00:00 2001 From: Bruno Leroux Date: Thu, 9 Jun 2022 17:13:12 +0200 Subject: [PATCH] Fix BoxShadow toString() (#105696) --- packages/flutter/lib/src/painting/box_shadow.dart | 6 +++--- packages/flutter/test/painting/box_painter_test.dart | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/flutter/lib/src/painting/box_shadow.dart b/packages/flutter/lib/src/painting/box_shadow.dart index 2e8d4c7121..cf11b99ba1 100644 --- a/packages/flutter/lib/src/painting/box_shadow.dart +++ b/packages/flutter/lib/src/painting/box_shadow.dart @@ -28,8 +28,8 @@ import 'debug.dart'; class BoxShadow extends ui.Shadow { /// Creates a box shadow. /// - /// By default, the shadow is solid black with zero [offset], [blurRadius], - /// and [spreadRadius]. + /// By default, the shadow is solid black with zero [offset], zero [blurRadius], + /// zero [spreadRadius], and [BlurStyle.normal]. const BoxShadow({ super.color, super.offset, @@ -145,5 +145,5 @@ class BoxShadow extends ui.Shadow { int get hashCode => Object.hash(color, offset, blurRadius, spreadRadius, blurStyle); @override - String toString() => 'BoxShadow($color, $offset, ${debugFormatDouble(blurRadius)}, ${debugFormatDouble(spreadRadius)}), $blurStyle'; + String toString() => 'BoxShadow($color, $offset, ${debugFormatDouble(blurRadius)}, ${debugFormatDouble(spreadRadius)}, $blurStyle)'; } diff --git a/packages/flutter/test/painting/box_painter_test.dart b/packages/flutter/test/painting/box_painter_test.dart index b1c095a721..7271cbc99c 100644 --- a/packages/flutter/test/painting/box_painter_test.dart +++ b/packages/flutter/test/painting/box_painter_test.dart @@ -147,8 +147,8 @@ void main() { }); test('BoxShadow toString test', () { - expect(const BoxShadow(blurRadius: 4.0).toString(), equals('BoxShadow(Color(0xff000000), Offset(0.0, 0.0), 4.0, 0.0), BlurStyle.normal')); - expect(const BoxShadow(blurRadius: 4.0, blurStyle: BlurStyle.solid).toString(), equals('BoxShadow(Color(0xff000000), Offset(0.0, 0.0), 4.0, 0.0), BlurStyle.solid')); + expect(const BoxShadow(blurRadius: 4.0).toString(), equals('BoxShadow(Color(0xff000000), Offset(0.0, 0.0), 4.0, 0.0, BlurStyle.normal)')); + expect(const BoxShadow(blurRadius: 4.0, blurStyle: BlurStyle.solid).toString(), equals('BoxShadow(Color(0xff000000), Offset(0.0, 0.0), 4.0, 0.0, BlurStyle.solid)')); }); testWidgets('BoxShadow BoxStyle.solid', (WidgetTester tester) async {