bare_codegen 0.1.2 icon indicating copy to clipboard operation
bare_codegen: ^0.1.2 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
90
pub points
4%
popularity

Publisher

verified publisher iconkaashyapan.com

Code generator to covert BARE schema to Dart classes

Repository (GitHub)
View/report issues

Documentation

API reference

License

Icon for licenses.MIT (LICENSE)

Dependencies

build, dart_style, intl, petitparser, recase

More

Packages that depend on bare_codegen