mainMethod method

Method mainMethod(
  1. String widgetName,
  2. String? builder,
  3. String goldenName,
  4. String? lightTheme,
  5. String? darkTheme,
  6. List<String> dimensions,
)

Generates a main method that runs the Golden tests.

Implementation

Method mainMethod(
  String widgetName,
  String? builder,
  String goldenName,
  String? lightTheme,
  String? darkTheme,
  List<String> dimensions,
) {
  return Method(
    (m) => m
      ..name = 'lookGoldens'
      ..body = groupMethod(
        widgetName: widgetName,
        builder: builder,
        goldenName: goldenName,
        lightTheme: lightTheme,
        darkTheme: darkTheme,
        dimensions: dimensions,
      ).code,
  );
}