diff --git a/widget_driver/CHANGELOG.md b/widget_driver/CHANGELOG.md index 105f568..93caf71 100644 --- a/widget_driver/CHANGELOG.md +++ b/widget_driver/CHANGELOG.md @@ -1,5 +1,9 @@ # CHANGELOG +## 1.0.9 + +* Updates the documentation to the new version of the widget_driver_generator + ## 1.0.8 * Adds a new `WidgetDriverTestConfigProvider` which you can use in your widget tests to control if a test driver or a real driver should be used. diff --git a/widget_driver/doc/widget_drivers.md b/widget_driver/doc/widget_drivers.md index 358667f..adab74f 100644 --- a/widget_driver/doc/widget_drivers.md +++ b/widget_driver/doc/widget_drivers.md @@ -118,7 +118,7 @@ Any type of dependencies which your `driver` needs to be able to give your widge You get three option here for how to resolve these dependencies. Either you can grab them out of the `BuildContext` (for example if you are using the `Provider` package). Or you can use some DI package like `get_it` and then just grab the dependencies from the DI container. Or you can pass in the dependencies to your driver using the `@driverProvidableProperty` annotation. **Now what about those annotations?** -They are needed for the `testDrivers` to be generated correctly. So for properties and methods with complex return types which you expose to the widget, you will need to add these annotations. Simple return types like all of [Dart's built-in types](https://dart.dev/language/built-in-types), enums, Optionals and some frequently used types in widgets like `Color` and `IconData` are already covered. +They are needed for the `testDrivers` to be generated correctly. So for properties and methods with complex return types which you expose to the widget, you will need to add these annotations. Simple return types like all of [Dart's built-in types](https://dart.dev/language/built-in-types), enums, Optionals and some frequently used types in widgets like `Color` and `IconData` are already covered with default values (that you still could overwrite if you'd like). For properties and methods you add `@TestDriverDefaultValue({default_value})`. The `default_value` should be the default value which you want to use when this widget is being created by other widgets under test. diff --git a/widget_driver/example/example.md b/widget_driver/example/example.md index 5e2548c..44c0788 100644 --- a/widget_driver/example/example.md +++ b/widget_driver/example/example.md @@ -38,6 +38,8 @@ part 'my_first_drivable_widget_driver.g.dart'; class MyFirstDrivableWidgetDriver extends WidgetDriver { int _count = 0; + // The next line is not necessary, since it's a String but if you want to customize the generated output, you can add this. + @TestDriverDefaultValue('The app bar title') String get appBarTitle => 'Intro to WidgetDriver'; String get counterTitle => 'Counter:'; diff --git a/widget_driver/example/pubspec.yaml b/widget_driver/example/pubspec.yaml index 61a3174..8758467 100644 --- a/widget_driver/example/pubspec.yaml +++ b/widget_driver/example/pubspec.yaml @@ -26,7 +26,7 @@ dev_dependencies: widget_driver_test: path: ../../widget_driver_test build_runner: - widget_driver_generator: ^1.0.2 + widget_driver_generator: ^1.1.0 flutter: uses-material-design: true diff --git a/widget_driver/pubspec.yaml b/widget_driver/pubspec.yaml index 533659d..f279783 100644 --- a/widget_driver/pubspec.yaml +++ b/widget_driver/pubspec.yaml @@ -1,6 +1,6 @@ name: widget_driver description: A Flutter presentation layer framework, which will clean up your widget code and make your widgets testable without a need for thousands of mock objects. Let's go driving! -version: 1.0.8 +version: 1.0.9 repository: https://github.com/bmw-tech/widget_driver/tree/master/widget_driver issue_tracker: https://github.com/bmw-tech/widget_driver/issues