floor icon indicating copy to clipboard operation
floor copied to clipboard

enforce TypeConverter implementation test rather than inheritence in floor generator

Open ramsestom opened this issue 3 years ago • 1 comments

Curently the floor generator enforce the TypeConverter instances to inherit the TypeConverter abstract class. It would make more sense to only requiere TypeConverter instances to implement the TypeConverter interface (like this is done by JsonConverter in the json_annotation library), allowing to have a single converter class that can implement multiple different converters (like floor TypeConverter, json_annotation JsonConverter, ...) if a type needs to be converted by various libraries. It would also allows to define const constructors for TypeConverter instances (which currently isn't possible because the TypeConverter abstract class do not have a const constructor).

ramsestom avatar Jun 16 '22 21:06 ramsestom

I think we may see a similar approach with converters in Retrofit, it will take some time to implement adapters for known serializers/deserializers, but overall it is a good idea.

dkaera avatar Jun 20 '22 09:06 dkaera