Does the Mappable interface reallly need to exist?
In dart:convert, in the json to string encoder, the dart objects are passed to the toEncodable function or are treated as dynamic and the toJson method is called https://github.com/dart-lang/sdk/blob/d86f0e2836d0941776f911dfc86ff444121fd29d/sdk/lib/convert/json.dart#L521 , and if an NoSuchMethod is thrown, the encoder catches the error and throws an encoding error.
This library could do something similar. If the object is not an Map<String, dynamic>, then the toJson function gets called and in case it throws a NoSuchMethod, you can add no info, otherwise add the resulting json. This allows using standard codegen libraries, instead of having to wire everything up or making an MappableFromJson mixin which uses the toJson method (what im gonna use rn).
Interesting approach, thanks! If you want you can do a PR, otherwise I'll try to work on it in my free time.
I created an wip pr with the initial implementation of the proposal