diff options
| author | Paul Buetow <paul@buetow.org> | 2026-05-17 15:31:16 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-05-17 15:31:16 +0300 |
| commit | c11b7c145fc1b2db6c1ed29a7abd739d0f6cbf3b (patch) | |
| tree | 4db8478fded8f3e1ad832b2788f6f82888a8f3ad /player-android/lib/models/note.dart | |
| parent | 914bd7cd6aa14e839332a98d91c30b19865b0cf2 (diff) | |
Add player-android/ Flutter skeleton
Diffstat (limited to 'player-android/lib/models/note.dart')
| -rw-r--r-- | player-android/lib/models/note.dart | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/player-android/lib/models/note.dart b/player-android/lib/models/note.dart new file mode 100644 index 0000000..381008d --- /dev/null +++ b/player-android/lib/models/note.dart @@ -0,0 +1,16 @@ +import 'json_helpers.dart'; + +class Note { + final int id; + final int mediaId; + final int userId; + final String content; + final DateTime? createdAt; + final DateTime? updatedAt; + + const Note({required this.id, required this.mediaId, required this.userId, required this.content, this.createdAt, this.updatedAt}); + + factory Note.fromJson(Map<String, dynamic> json) => Note(id: json['id'] as int? ?? 0, mediaId: json['media_id'] as int? ?? 0, userId: json['user_id'] as int? ?? 0, content: json['content'] as String? ?? '', createdAt: dateTimeFromJson(json['created_at']), updatedAt: dateTimeFromJson(json['updated_at'])); + + Map<String, dynamic> toJson() => {'id': id, 'media_id': mediaId, 'user_id': userId, 'content': content, 'created_at': dateTimeToJson(createdAt), 'updated_at': dateTimeToJson(updatedAt)}; +} |
