bare implementation of comuncation with the api
This commit is contained in:
@@ -82,18 +82,16 @@ class UserPreferences {
|
||||
}
|
||||
}
|
||||
|
||||
String toJson() {
|
||||
// This is "opinionated" JSON, corresponding to the backend's expectations
|
||||
return '''
|
||||
{
|
||||
"sightseeing": {"type": "sightseeing", "score": ${sightseeing.value}},
|
||||
"shopping": {"type": "shopping", "score": ${shopping.value}},
|
||||
"nature": {"type": "nature", "score": ${nature.value}},
|
||||
"max_time_minutes": ${maxTime.value},
|
||||
"detour_tolerance_minute": ${maxDetour.value}
|
||||
Map<String, dynamic> toJson() {
|
||||
// This is "opinionated" JSON, corresponding to the backend's expectations
|
||||
return {
|
||||
"sightseeing": {"type": "sightseeing", "score": sightseeing.value},
|
||||
"shopping": {"type": "shopping", "score": shopping.value},
|
||||
"nature": {"type": "nature", "score": nature.value},
|
||||
"max_time_minute": maxTime.value,
|
||||
"detour_tolerance_minute": maxDetour.value
|
||||
};
|
||||
}
|
||||
''';
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user