onDrawerRun method

  1. @override
Future<void> onDrawerRun(
  1. AFBuildContext<AFFlexibleStateView, AFRouteParam> context,
  2. AFScreenTestContextSimulator? prevContext,
  3. AFSingleScreenTestState state,
  4. AFScreenTestID selectedTestId,
  5. Function onEnd,
)
override

Implementation

@override
Future<void> onDrawerRun(AFBuildContext context, AFScreenTestContextSimulator? prevContext, AFSingleScreenTestState state, AFScreenTestID selectedTestId, Function onEnd) async {
  final dispatcher = context.d;
  //final screenUpdateCount = AFibF.testOnlyScreenUpdateCount(screenId);
  final testContext = prepareRun(dispatcher, prevContext, selectedTestId);

  final buildContext = AFibF.g.testOnlyShowBuildContext(AFUIType.bottomSheet);
  assert(buildContext != null);

  // show the dialog, but don't wait it, because it won't return until the dialog is closed.
  AFContextShowMixin.showModalBottomSheetStatic(
      dispatch: dispatcher.dispatch,
      navigate: createNavigatePush(),
      flutterContext: buildContext,
      executeBefore: null,
      executeDuring: null,
  );

  // instead, wait for the dialog to be displayed, then run the test.
  Future.delayed(const Duration(milliseconds: 500), () {
    run(testContext, onEnd: onEnd);
  });
}