bare_codegen 0.1.5 copy "bare_codegen: ^0.1.5" to clipboard
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 into example and run build process and run tests:

    $ dart run build_runner build
    $ dart test
    
1
likes
80
pub points
17%
popularity

Publisher

verified publisherkaashyapan.com

Code generator to covert BARE schema to Dart classes

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

build, dart_style, intl, petitparser, recase

More

Packages that depend on bare_codegen