onDrawerRun method
Future<void>
onDrawerRun(
- AFBuildContext<
AFFlexibleStateView, AFRouteParam> context, - AFScreenTestContextSimulator? prevContext,
- AFSingleScreenTestState state,
- AFScreenTestID selectedTestId,
- 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);
});
}