toMapAsync method
Convert the model instance to a map, resolving any Future values.
Implementation
Future<Map<String, dynamic>> toMapAsync() async {
final map = toMap();
for (final key in map.keys) {
if (map[key] is Future) {
map[key] = await map[key];
}
}
return map;
}