addScenario method

void addScenario({
  1. required String name,
  2. required Widget widget,
  3. Screen? screen,
})

Add a golden test scenario

Implementation

void addScenario({
  required String name,
  required Widget widget,
  Screen? screen,
}) {
  assert(_deviceSizes.isEmpty != (screen == null));

  if (screen != null)
    return _scenarios.add(
      Scenario(
        name: name,
        widget: widget,
        screen: screen,
        wrap: wrapScenario,
      ),
    );
  else
    _scenarios.addAll(
      _deviceSizes.map(
        (screen) => Scenario(
          name: name,
          widget: widget,
          screen: screen,
          wrap: wrapScenario,
        ),
      ),
    );
}