Skip to content

Commit 0b13f4b

Browse files
authored
Fix BoxShadow toString() (#105696)
1 parent fc1710b commit 0b13f4b

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

packages/flutter/lib/src/painting/box_shadow.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ import 'debug.dart';
2828
class BoxShadow extends ui.Shadow {
2929
/// Creates a box shadow.
3030
///
31-
/// By default, the shadow is solid black with zero [offset], [blurRadius],
32-
/// and [spreadRadius].
31+
/// By default, the shadow is solid black with zero [offset], zero [blurRadius],
32+
/// zero [spreadRadius], and [BlurStyle.normal].
3333
const BoxShadow({
3434
super.color,
3535
super.offset,
@@ -145,5 +145,5 @@ class BoxShadow extends ui.Shadow {
145145
int get hashCode => Object.hash(color, offset, blurRadius, spreadRadius, blurStyle);
146146

147147
@override
148-
String toString() => 'BoxShadow($color, $offset, ${debugFormatDouble(blurRadius)}, ${debugFormatDouble(spreadRadius)}), $blurStyle';
148+
String toString() => 'BoxShadow($color, $offset, ${debugFormatDouble(blurRadius)}, ${debugFormatDouble(spreadRadius)}, $blurStyle)';
149149
}

packages/flutter/test/painting/box_painter_test.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,8 +147,8 @@ void main() {
147147
});
148148

149149
test('BoxShadow toString test', () {
150-
expect(const BoxShadow(blurRadius: 4.0).toString(), equals('BoxShadow(Color(0xff000000), Offset(0.0, 0.0), 4.0, 0.0), BlurStyle.normal'));
151-
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'));
150+
expect(const BoxShadow(blurRadius: 4.0).toString(), equals('BoxShadow(Color(0xff000000), Offset(0.0, 0.0), 4.0, 0.0, BlurStyle.normal)'));
151+
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)'));
152152
});
153153

154154
testWidgets('BoxShadow BoxStyle.solid', (WidgetTester tester) async {

0 commit comments

Comments
 (0)