Created
February 26, 2024 17:27
-
-
Save jonahwilliams/656f3db7595daf7de802b855720ac454 to your computer and use it in GitHub Desktop.
minimal repro
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:flutter_test/flutter_test.dart'; | |
group('Shadows on ShapeDecoration', () { | |
Widget build(int elevation) { | |
return Center( | |
child: RepaintBoundary( | |
child: Container( | |
margin: const EdgeInsets.all(150.0), | |
decoration: ShapeDecoration( | |
shape: const BeveledRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(20.0))), | |
shadows: kElevationToShadow[elevation], | |
), | |
height: 100.0, | |
width: 100.0, | |
), | |
), | |
); | |
} | |
for (final int elevation in [1, 2]) { | |
testWidgets('elevation $elevation', (WidgetTester tester) async { | |
debugDisableShadows = false; | |
await tester.pumpWidget(build(elevation)); | |
await expectLater( | |
find.byType(Container), | |
matchesGoldenFile('shadow.ShapeDecoration.$elevation.png'), | |
); | |
debugDisableShadows = true; | |
}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment