myoro_flutter_annotations 1.4.10
myoro_flutter_annotations: ^1.4.10 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
partdirective; - Add the
@immutableannotation. Doesn't effect code generation, but models should be immutable by nature, so add it; - Add the
@myoroModelannotation; - 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
partdirective; - Add the
@immutableannotation. Doesn't effect code generation, butThemeExtensions are immutable by nature, so add it; - Add the
@myoroThemeExtensionannotation; - Attach the generated
mixin.
Want to see more examples? #
./lib has every type of file that MFA generates for.