Skip to content

Commit

Permalink
Fix BoxShadow toString() (#105696)
Browse files Browse the repository at this point in the history
  • Loading branch information
bleroux authored Jun 9, 2022
1 parent fc1710b commit 0b13f4b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions packages/flutter/lib/src/painting/box_shadow.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)';
}
4 changes: 2 additions & 2 deletions packages/flutter/test/painting/box_painter_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 0b13f4b

Please sign in to comment.