Map<String, dynamic> toJson() { return map( (key, value) => MapEntry( key, Map<String, String>.fromEntries( value.map((e) => e.toMapEntry()), ), ), ); }