Setup

Installation

Add these dev dependencies :

dev_dependencies:
  build_runner:
  modddels:

Then, add ONE of these dependencies :

dependencies:
  # If you use fpdart for functional programming
  modddels_annotation_fpdart:
  # If you use dartz for functional programming
  modddels_annotation_dartz:

This package uses the functional programming types Option, Either and Tuple2.

  • If you use fpdart as a functional programming package, install modddels_annotation_fpdart.

  • If you use dartz as a functional programming package, install modddels_annotation_dartz.

If you're not familiar with functional programming, I recommend using fpdart, which is well documented and contains all the resources you need to learn the core concepts. You only need to know about Option and Either to use this package.

Running the Generator

In your package directory, run the following command :

dart run build_runner build

For flutter projects, you can instead run :

flutter pub run build_runner build

See build_runner for more commands.

Last updated