Skip to content

Instantly share code, notes, and snippets.

@jonahwilliams
Created February 26, 2024 17:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jonahwilliams/656f3db7595daf7de802b855720ac454 to your computer and use it in GitHub Desktop.
Save jonahwilliams/656f3db7595daf7de802b855720ac454 to your computer and use it in GitHub Desktop.
minimal repro
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