testWidgetMethod method
Expression
testWidgetMethod({})
Generates a test method that runs a single Golden test.
Implementation
Expression testWidgetMethod({
required String widgetName,
required String? builder,
required String goldenName,
required String? theme,
required bool darkTheme,
required String dimension,
}) {
return refer('testWidgets').newInstance([
refer(
'\'$dimension $widgetName ${darkTheme ? 'dark theme' : 'light theme'}\'',
),
anonymousMethod(
widgetName: widgetName,
builder: builder,
goldenName: goldenName,
theme: theme,
darkTheme: darkTheme,
dimension: dimension,
).closure,
]);
}