You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Codegen creates model interface files and model files which reference the interfaces accordingly
abstract class ExampleInterface extends Model {
String customField() {
throw UnimplementedError('getId() has not been implemented on ExampeInterface.');
}
}
abstract class ExampleModelA extends ExampleInterface {
...
}
abstract class ExampleModelB extends ExampleInterface {
...
}
Describe alternatives you've considered
Could manually implement ExampleInterface, and then alter the generated Model files. But prefer not to alter generated files.
Describe the feature you'd like to request
Requesting that the flutter codegen (
amplify codegen models
) also generates and utilizes interface model files:Describe the solution you'd like
Codegen creates model interface files and model files which reference the interfaces accordingly
Describe alternatives you've considered
Could manually implement ExampleInterface, and then alter the generated Model files. But prefer not to alter generated files.
Reflection is not an option as Flutter does not allow it flutter/flutter#1150
Additional context
This would allow us as developers to cleanly utilize generics when operating on the generated Models.
Example:
Thank you for reading!
Is this something that you'd be interested in working on?
Would this feature include a breaking change?
The text was updated successfully, but these errors were encountered: