bare_codegen 0.1.5 bare_codegen: ^0.1.5 copied to clipboard
Code generator to covert BARE schema to Dart classes
BARE Code generator #
The code generator transforms all *.bare files into
- *.dart
- *.bare.dart
It produces the necessary classes and the extension methods.
After running the code generator with
$ dart run build_runner build
To encode a class
<class_name>.toBare
To decode to a class
<class_name>.fromBare(bytes)
See the example folder for a sample of a schema file and the generated code.
Code generator config options: #
to_string
- Generate toString
override for the generated classes. Default - True
targets:
$default:
builders:
bare_codegen|bareGenerator:
options:
to_string: True
To run the project: #
-
Update your dependencies:
$ cd bare && pub get $ cd bare_codegen && pub get $ cd example && pub get
-
cd
intoexample
and run build process and run tests:$ dart run build_runner build $ dart test