prepare method

  1. @override
void prepare()

used to allow for custom configuration to ensure framework specific configuration is in place

Implementation

@override
void prepare() {
  _ensureCorrectConfiguration();
  final providedCreateWorld = createWorld;
  createWorld = (config) async {
    FlutterWorld? world;
    if (providedCreateWorld != null) {
      world = (await providedCreateWorld(config)) as FlutterWorld;
    }

    return await createFlutterWorld(config, world);
  };

  hooks = List.from(hooks ?? <Hook>[])..add(FlutterAppRunnerHook());
  customStepParameterDefinitions =
      List.from(customStepParameterDefinitions ?? <CustomParameter>[])
        ..addAll([
          ExistenceParameter(),
          SwipeDirectionParameter(),
        ]);
  stepDefinitions = List.from(stepDefinitions ?? <StepDefinitionGeneric>[])
    ..addAll([
      ThenExpectElementToHaveValue(),
      WhenTapBackButtonWidget(),
      WhenTapWidget(),
      WhenTapWidgetWithoutScroll(),
      WhenLongPressWidget(),
      WhenLongPressWidgetWithoutScroll(),
      WhenLongPressWidgetForDuration(),
      GivenOpenDrawer(),
      WhenPauseStep(),
      WhenFillFieldStep(),
      ThenExpectWidgetToBePresent(),
      RestartAppStep(),
      SiblingContainsTextStep(),
      SwipeOnKeyStep(),
      SwipeOnTextStep(),
      TapTextWithinWidgetStep(),
      TapWidgetOfTypeStep(),
      TapWidgetOfTypeWithinStep(),
      TapWidgetWithTextStep(),
      TextExistsStep(),
      TextExistsWithinStep(),
      WaitUntilKeyExistsStep(),
      WaitUntilTypeExistsStep(),
    ]);
}