Scenario<TWidget extends Widget, TArgs extends StoryArgs<TWidget>> class

Inheritance

Constructors

Scenario({ScenarioType type = ScenarioType.local, required String name, List<Mode>? modes, TArgs? args, Future<void> run(WidgetTester tester, TArgs args)?, ModesMerger mergeModes = defaultMergeModes})

Properties

args → TArgs
no setter
hashCode int
The hash code for this object.
no setterinherited
mergeModes ModesMerger
A function to merge the modes defined in the story and the ones defined in this Scenario or ScenarioDefinition.
finalinherited
modes List<Mode>
Combines the modes defined in the story and the ones defined in this scenario. If both are null, returns null.
no setteroverride
name String
finalinherited
run Future<void> Function(WidgetTester tester, TArgs args)?
A function that is executed during the test after the widget is built and before the screenshot is taken. It can be used to interact with the widget, e.g. to open a dropdown or to trigger an animation.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
story Story<TWidget, TArgs>
A late back-reference to the story this scenario belongs to. It is initialized in the Story constructor.
latefinal
type ScenarioType
final
viewport ViewportData?
Gets the viewport from the modes if a ViewportMode is present. Otherwise, returns null.
no setter

Methods

buildWithConfig(BuildContext context, Config config) Widget
Injects both modes and args into the built story.
execute(WidgetTester tester) Future<void>?
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited