goldenNameFor function
String
goldenNameFor(
- DeviceSpec device, {
- required String scenario,
- Orientation orientation = Orientation.portrait,
- FoldPosture posture = FoldPosture.flat,
A stable golden file name for device under the given scenario.
Includes the posture for foldables so cover and unfolded goldens do not collide.
Implementation
String goldenNameFor(
DeviceSpec device, {
required String scenario,
Orientation orientation = Orientation.portrait,
FoldPosture posture = FoldPosture.flat,
}) {
final parts = [
scenario,
device.id.replaceAll('.', '-'),
orientation.name,
if (device.isFoldable) posture.name,
];
return 'goldens/${parts.join('_')}.png';
}