mymuseum-visitapp/lib/Models/resourceModel.dart
2025-05-28 14:08:32 +02:00

35 lines
813 B
Dart

import 'package:flutter/material.dart';
import 'package:manager_api_new/api.dart';
class ResourceModel {
String? id = "";
String? path = "";
String? source = "";
String? label = "";
ResourceType? type;
ResourceModel({this.id, this.path, this.source, this.type});
Map<String, dynamic> toMap() {
return {
'id': id,
'path': path,
'source': source,
'type': type?.value
};
}
factory ResourceModel.fromJson(Map<String, dynamic> json) {
return ResourceModel(
id: json['id'] as String,
path: json['path'] as String,
source: json['source'] as String,
type: json['type'] as ResourceType
);
}
@override
String toString() {
return 'ResourceModel{id: $id, type: $type, source: $source, path: $path, label: $label}';
}
}