bunker_lib 1.0.5 icon indicating copy to clipboard operation
bunker_lib: ^1.0.5 copied to clipboard

A Library for lessen boilerplate code. Inpsired from freezed and lombok.

Welcome to [Bunker].

Pub Version GitHub issues GitHub stars GitHub license

1.0.5 and null-safety #

pub package

Important note:

  bunker_annotation: ^0.0.3

  bunker_lib: ^1.0.5

Run the generator #

To run the code generator you have two possibilities:

  • If your package depends on Flutter:
    • flutter pub run build_runner build
  • If your package does not depend on Flutter:
    • dart pub run build_runner build

Note that like most code-generators, [Bunker] will need you to both import the annotation ([meta]) and use the part keyword on the top of your files.

copyWith #

As stated in the very beginning of this readme, [Bunker] does not compromise on the syntax to have a powerful copy.

The copyWith method generated by [Bunker] does support assigning a value to null.
For example, if we take our previous Model class:

class Model with _$Model {
  factory Model(String name, int age);