-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
193 additions
and
165 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/// Info about user's attendance at an event. | ||
/// Is the event paid, has the user paid for the event, did the user show up, etc. | ||
class EventAttendanceModel { | ||
final int eventId; | ||
final bool attended; | ||
final String timestamp; | ||
final bool isPaidEvent; | ||
final bool hasPaidForEvent; | ||
|
||
EventAttendanceModel({ | ||
required this.eventId, | ||
required this.attended, | ||
required this.timestamp, | ||
required this.isPaidEvent, | ||
required this.hasPaidForEvent, | ||
}); | ||
|
||
factory EventAttendanceModel.fromJson(Map<String, dynamic> json) { | ||
return EventAttendanceModel( | ||
eventId: json['event'], | ||
attended: json['attended'], | ||
timestamp: json['timestamp'], | ||
isPaidEvent: json['paid'], | ||
hasPaidForEvent: json['has_paid'], | ||
); | ||
} | ||
|
||
@override | ||
bool operator ==(Object other) { | ||
// if (identical(this, other)) return true; | ||
if (other is! EventAttendanceModel) return false; | ||
// if (other.runtimeType != runtimeType) return false; | ||
return eventId == other.eventId; | ||
} | ||
|
||
@override | ||
int get hashCode => eventId.hashCode; | ||
} |
Oops, something went wrong.