This repository has been archived on 2026-08-19. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
melo-app/lib/models/playlist.dart
T

27 lines
591 B
Dart

class Playlist {
final int? id;
final String name;
final String erstelltAm;
int songCount;
Playlist({
this.id,
required this.name,
String? erstelltAm,
this.songCount = 0,
}) : erstelltAm = erstelltAm ?? DateTime.now().toIso8601String();
Map<String, dynamic> toMap() => {
'id': id,
'name': name,
'erstellt_am': erstelltAm,
};
factory Playlist.fromMap(Map<String, dynamic> m, {int songCount = 0}) => Playlist(
id: m['id'] as int?,
name: m['name'] as String,
erstelltAm: m['erstellt_am'] as String?,
songCount: songCount,
);
}