metro/stubs/one_of_model_stub
library
Functions
-
addOneOfDecoders(String decodersFile, {required ReCase modelName, required List<ReCase> types})
→ String
-
Adds a
OneOf.byKey entry for a OneOf model to modelDecoders in
decodersFile. Each subtype's name is its value for the 'type' field.
Also imports nylo_framework if decoders.dart doesn't yet.
-
oneOfModelStub({required ReCase modelName, required List<ReCase> types, bool primaryConstructors = false})
→ String
-
This stub is used to create a new OneOf model: a sealed parent class and
its subtypes, all in one file.
-
parseOneOfTypes(String input)
→ List<ReCase>
-
Parses the
--one-of value into the subtype names.
-
supportsPrimaryConstructors(String pubspec)
→ bool
-
Whether the app's
pubspec allows primary constructors, which need a
minimum SDK of 3.13.