schultek/dart_mappable

[Discussion] Simplification of interface

Closed this issue · 1 comments

Why not generate additional functions to the [Class]Mappable mixins and just call the [Class]Mapper interfaces there?

For example the generator can just generate functions in the Mappable mixins similar to copyWith and friends, but use the Mapper classes implementation.

Could be something like this:

....
static String fromJson(String json) {
  return ClassNameMapper.fromJson(json);
}
....

This eases the transition from other plugins, and simplifies things a little bit for the user.

Closing this as it is not possible with current implementation, in addition to mixins not "mixing in" static functions.