FLUTTER ECOSYSTEM

mobx_codegen

Code generator for MobX that adds support for annotating your code with @observable, @computed, @action and also creating Store classes.

Latest version
2.8.0
30-day downloads
73.1K
Likes
301
Pub points
150

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

Overview

MobX CodeGen is a code generation tool for the MobX state management library in Flutter and Dart. It enables developers to annotate their classes and fields with @observable, @computed, and @action, automatically generating boilerplate code for reactive state management. This reduces manual effort and enhances code readability by eliminating repetitive patterns. The package supports creating Store classes with minimal setup, streamlining state handling across platforms.

Use cases
  • Reactive UI development with automatic state updates
  • Simplifying complex state logic in large apps
  • Reducing boilerplate in state management
  • Generating efficient observable stores
  • Enabling type-safe computed values
  • Streamlining dependency injection with MobX
Key features
  • Automatic code generation for @observable, @computed, @action
  • Support for generating Store classes
  • Reduces manual boilerplate in state management
  • Integrates seamlessly with MobX
  • Generates efficient and type-safe code
  • Works across multiple platforms
Suitable for
  • Developers using MobX for state management
  • Teams seeking to reduce boilerplate in Flutter apps
  • Projects requiring reactive and performant state handling
  • Apps with complex state logic needing clean separation
  • Developers preferring annotation-based state management
  • Those building cross-platform applications
Considerations
  • Requires build_runner for code generation
  • Needs proper setup of build.yaml
  • May increase build time slightly
  • Dependent on MobX core package
  • Not suitable for runtime-only state changes
  • Requires understanding of MobX concepts
Supported platformsAndroidiOSmacOSWindowsLinux

Install package

flutter pub add mobx_codegen

Categories

Dependencies

Dependency list 6 items

Source repository

Related projects

Rankings