WhenTapBackButtonWidget function Null safety

StepDefinitionGeneric<World> WhenTapBackButtonWidget()

Taps the back button widget

Examples:

When I tap the back button" When I tap the back element" When I tap the back widget"

Implementation

StepDefinitionGeneric WhenTapBackButtonWidget() {
  return when<FlutterWorld>(
    RegExp(r'I tap the back (?:button|element|widget|icon|text)$'),
    (context) async {
      await FlutterDriverUtils.tap(
        context.world.driver,
        find.pageBack(),
      );
    },
  );
}