widget_driver_annotation 1.0.3 widget_driver_annotation: ^1.0.3 copied to clipboard
Defines the annotations used by widget_driver and widget_driver_generator to create code for your WidgetDrivers
WidgetDriver annotation usage #
@GenerateTestDriver()
class CounterDriver extends WidgetDriver {
final SomeModel model;
CounterDriver({
@driverProvidableProperty required this.model,
})
@TestDriverDefaultValue(1)
int get value => _counterService.value;
@TestDriverDefaultValue()
void increment() {
_counterService.increment();
}
@TestDriverDefaultValue(false)
bool doSomething() {
return _counterService.doSomething();
}
@TestDriverDefaultFutureValue(1)
Future<int> incrementInTheFutureAndReturnValue() {
return _counterService.incrementInTheFutureAndReturnValue();
}
}
See the documentation for widget_driver to understand how these annotations work and how you can configure and use them.