mantle_annotations

Pure-Dart annotations for Mantle code generation.

This package has no Flutter dependency, so both app/library code and the analyzer-side generators in mantle_gen can import it.

Install

dependencies:
  mantle_annotations: ^0.1.0

Typically you also add mantle_gen as a dev_dependency and run dart run build_runner build.

Annotations

@MantleToken

Marks a class whose static const fields should be collected by the Mantle token generator:

import 'package:mantle_annotations/mantle_annotations.dart';

part 'palette.g.dart';

@MantleToken()
abstract final class Palette {
  static const red = 0xFFFF0000;
  static const blue = 0xFF0000FF;
}

Optional parameters:

Parameter Default Purpose
type dynamic Value type used in the generated toMap()
name _${classname} Generated mixin name (supports {classname})

License

Free for non-commercial use under the PolyForm Noncommercial License 1.0.0.

Commercial use requires a separate agreement with the licensor. Contact: leslmosnk@outlook.com.

Libraries

mantle_annotations