Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 6 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,14 @@ built_value.
Simple examples are
[here](https://github.com/google/built_value.dart/tree/master/example/lib/example.dart).

Since `v5.2.0` codegen is triggered by running `pub run build_runner build` to
do a one-off build or `pub run build_runner watch` to continuously watch your
source and update the generated output when it changes. Note that you need a
dev dependency on `built_value_generator` and `build_runner`. See the example
[pubspec.yaml](https://github.com/google/built_value.dart/blob/master/example/pubspec.yaml).
## Codegen

Codegen is done using `dart run build_runner build` for one-off builds.

If using Flutter, the equivalent command is `flutter packages pub run build_runner build`.
Alternatively, put your `built_value` classes in a separate Dart package with no dependency
on Flutter. You can then use `built_value` as normal.
To continuously watch your source and update the generated output when it changes, use `dart run build_runner watch`.

If using a version before v5.2.0, codegen is triggered via either a
[build.dart](https://github.com/google/built_value.dart/blob/92783c27a08ac3c73f28bb08736b9d4a30fa3b7e/example/tool/build.dart)
to do a one-off build or a
[watch.dart](https://github.com/google/built_value.dart/blob/92783c27a08ac3c73f28bb08736b9d4a30fa3b7e/example/tool/watch.dart)
to continuously watch your source and update generated output.
Note that you need a dev dependency on `built_value_generator` and `build_runner`. See the example
[pubspec.yaml](https://github.com/google/built_value.dart/blob/master/example/pubspec.yaml).

## Value Types

Expand Down