myoro_flutter_annotations 1.4.6 copy "myoro_flutter_annotations: ^1.4.6" to clipboard
myoro_flutter_annotations: ^1.4.6 copied to clipboard

A code generation library for models and theme extensions.

example/README.md

Example #

Usage #

@myoroModel #

part 'test_model.g.dart';

@immutable
@myoroModel
final class FooModel with _$FooModelMixin {
  ...
}
  1. Add the generated file as a part directive;
  2. Add the @immutable annotation. Doesn't effect code generation, but models should be immutable by nature, so add it;
  3. Add the @myoroModel annotation;
  4. Attach the generated mixin.

@myoroThemeExtension #

part 'test_theme_extension.g.dart';

@immutable
@myoroThemeExtension
final class TestThemeExtension extends ThemeExtension<TestThemeExtension> with _$TestThemeExtensionMixin {
  1. Add the generated file as a part directive;
  2. Add the @immutable annotation. Doesn't effect code generation, but ThemeExtensions are immutable by nature, so add it;
  3. Add the @myoroThemeExtension annotation;
  4. Attach the generated mixin.

Want to see more examples? #

./lib has every type of file that MFA generates for.

0
likes
140
points
340
downloads

Publisher

verified publishermyoro.com.br

Weekly Downloads

A code generation library for models and theme extensions.

Repository (GitHub)
View/report issues

Topics

#codegen #annotations #flutter

Documentation

API reference

License

Unlicense (license)

Dependencies

analyzer, build, build_runner, dart_style, pub_semver, source_gen

More

Packages that depend on myoro_flutter_annotations