myoro_flutter_annotations 1.4.6
myoro_flutter_annotations: ^1.4.6 copied to clipboard
A code generation library for models and theme extensions.
Example #
Usage #
@myoroModel
#
part 'test_model.g.dart';
@immutable
@myoroModel
final class FooModel with _$FooModelMixin {
...
}
- Add the generated file as a
part
directive; - Add the
@immutable
annotation. Doesn't effect code generation, but models should be immutable by nature, so add it; - Add the
@myoroModel
annotation; - Attach the generated
mixin
.
@myoroThemeExtension
#
part 'test_theme_extension.g.dart';
@immutable
@myoroThemeExtension
final class TestThemeExtension extends ThemeExtension<TestThemeExtension> with _$TestThemeExtensionMixin {
- Add the generated file as a
part
directive; - Add the
@immutable
annotation. Doesn't effect code generation, butThemeExtension
s are immutable by nature, so add it; - Add the
@myoroThemeExtension
annotation; - Attach the generated
mixin
.
Want to see more examples? #
./lib
has every type of file that MFA generates for.