mono_bloc_generator 1.2.1 copy "mono_bloc_generator: ^1.2.1" to clipboard
mono_bloc_generator: ^1.2.1 copied to clipboard

Code generator for mono_bloc. Generates event classes, action handlers, and base bloc classes from annotated methods.

1.2.1 #

  • Bump mono_bloc to 1.2.1

1.2.0 #

  • Generated action classes are now public and prefixed with the bloc name (e.g. CartBlocShowNotificationAction); the sealed action base class is public (e.g. CartBlocAction); and a bloc's actions stream is now typed as Stream<CartBlocAction>. This lets you assert actions in tests with isA<…>() and handle them by type in app code.
  • Breaking: action types previously generated with a leading underscore are renamed/exposed; if you declared your own type matching a new generated name it will clash.

1.1.0 #

  • Added support for @event methods returning void/Future<void> without an emitter (side-effect events that don't change state)
  • Raised the analyzer constraint to >=10.0.0 <14.0.0 (supports analyzer 10–13)
  • Preserve parameter and return types exactly: function-typed, nested-generic, record, and typedef types are now parsed from source with balanced-bracket scanning instead of regex, fixing truncation and typedef expansion
  • Scope source reads to each declaration so duplicate identifiers or doc comments can no longer cause the wrong type to be read
  • Match event-specific error handlers (_onErrorXxx) to their event by exact name, and throw a clear error when no matching event exists (previously could mis-route or be silently dropped)
  • Detect the emitter parameter by its resolved type instead of a name/substring match, so a data parameter named emit or typed EmitConfig is no longer dropped
  • Decide whether generated handlers are async structurally instead of scanning generated body text
  • Detect Flutter projects by reading flutter only under dependencies: (no longer matches dev dependencies, overrides, or comments)
  • Throw InvalidGenerationSourceError for invalid @MonoEvent.queue(...) names instead of an uncaught ArgumentError
  • Internal cleanup and additional tests

1.0.7 #

  • Update generation
  • Update documentation

1.0.6 #

  • Rewrite @onInit handling and sequential emitter generation

1.0.4 #

  • Added shared action mixins support

1.0.3 #

  • Documentation updates, generation fixes

1.0.2 #

  • Documentation updates

1.0.1 #

  • Documentation updates

1.0.0 #

  • Initial release of the project.
0
likes
160
points
354
downloads

Documentation

API reference

Publisher

verified publisherwestito.dev

Weekly Downloads

Code generator for mono_bloc. Generates event classes, action handlers, and base bloc classes from annotated methods.

Repository (GitHub)
View/report issues

Topics

#bloc #code-generation #state-management #dart

License

MIT (license)

Dependencies

analyzer, build, change_case, code_builder, dart_style, source_gen, yaml

More

Packages that depend on mono_bloc_generator