eksplicit mapping af envs
This commit is contained in:
20
app/lib/models/match_result.dart
Normal file
20
app/lib/models/match_result.dart
Normal file
@@ -0,0 +1,20 @@
|
||||
class MatchResult {
|
||||
final bool match;
|
||||
final List<String> sharedInterests;
|
||||
final bool nudgeSent;
|
||||
|
||||
const MatchResult({
|
||||
required this.match,
|
||||
required this.sharedInterests,
|
||||
required this.nudgeSent,
|
||||
});
|
||||
|
||||
factory MatchResult.fromJson(Map<String, dynamic> json) => MatchResult(
|
||||
match: json['match'] as bool? ?? false,
|
||||
sharedInterests: (json['shared_interests'] as List<dynamic>?)
|
||||
?.map((e) => e as String)
|
||||
.toList() ??
|
||||
[],
|
||||
nudgeSent: json['nudge_sent'] as bool? ?? false,
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user