Track online szinkronizáció refraktorálása
This commit is contained in:
@@ -61,6 +61,7 @@ enum TrackSyncStatus { pending, synced, error }
|
||||
|
||||
class Track {
|
||||
final int? id;
|
||||
final String? uuid; // kliens-generált uuid — ez a szerveroldali id is
|
||||
final int? projectId;
|
||||
final String name;
|
||||
final DateTime startTime;
|
||||
@@ -77,6 +78,7 @@ class Track {
|
||||
|
||||
const Track(
|
||||
{this.id,
|
||||
this.uuid,
|
||||
this.projectId,
|
||||
required this.name,
|
||||
required this.startTime,
|
||||
@@ -91,6 +93,7 @@ class Track {
|
||||
|
||||
Track copyWith(
|
||||
{int? id,
|
||||
String? uuid,
|
||||
int? projectId,
|
||||
String? name,
|
||||
DateTime? startTime,
|
||||
@@ -104,6 +107,7 @@ class Track {
|
||||
String? supabaseId}) =>
|
||||
Track(
|
||||
id: id ?? this.id,
|
||||
uuid: uuid ?? this.uuid,
|
||||
projectId: projectId ?? this.projectId,
|
||||
name: name ?? this.name,
|
||||
startTime: startTime ?? this.startTime,
|
||||
@@ -136,6 +140,7 @@ class Track {
|
||||
|
||||
Map<String, dynamic> toMap() => {
|
||||
if (id != null) 'id': id,
|
||||
if (uuid != null) 'uuid': uuid,
|
||||
if (projectId != null) 'project_id': projectId,
|
||||
'name': name,
|
||||
'start_time': startTime.toIso8601String(),
|
||||
@@ -151,6 +156,7 @@ class Track {
|
||||
|
||||
factory Track.fromMap(Map<String, dynamic> m) => Track(
|
||||
id: m['id'] as int?,
|
||||
uuid: m['uuid'] as String?,
|
||||
projectId: m['project_id'] as int?,
|
||||
name: m['name'] as String,
|
||||
startTime: DateTime.parse(m['start_time'] as String),
|
||||
|
||||
Reference in New Issue
Block a user