Fix BoxShadow toString() (#105696)
This commit is contained in:
@@ -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)';
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user