addPrototype method
AFSingleScreenPrototypeBody
addPrototype({
- required AFPrototypeID id,
- required dynamic stateView,
- required AFTestTimeHandling timeHandling,
Add a prototype of a particular screen with the specified stateView
and an initial route parameter from navigate.
Returns an AFSingleScreenPrototypeBody, which can be used to create a test for the screen.
Implementation
AFSingleScreenPrototypeBody addPrototype({
required AFPrototypeID id,
required dynamic stateView,
required AFNavigatePushAction? navigate,
required AFNavigateWithOnEventContextDelegate? navigateWithEventContext,
required AFTestTimeHandling timeHandling
}) {
final instance = AFSingleScreenPrototype(
id: id,
stateView: stateView,
navigate: navigate,
navigateWithEventContext: navigateWithEventContext,
body: AFSingleScreenPrototypeBody(id, screenIdCreator: () {
final nav = AFScreenPrototype.createNavigatePushStatic(
navigate: navigate,
navigateWithEventContext: navigateWithEventContext,
stateView: stateView
);
return nav.screenId;
}),
timeHandling: timeHandling
);
_singleScreenTests.add(instance);
return instance.body;
}