27 lines
546 B
Dart
27 lines
546 B
Dart
import 'package:manager_api_new/api.dart';
|
|
|
|
class ResourceTypeModel {
|
|
String label;
|
|
ResourceType type;
|
|
|
|
ResourceTypeModel({required this.label, required this.type});
|
|
|
|
factory ResourceTypeModel.fromJson(Map<String, dynamic> json) {
|
|
return new ResourceTypeModel(
|
|
label: json['label'] as String,
|
|
type: json['type'] as ResourceType,
|
|
);
|
|
}
|
|
|
|
Map<String, dynamic> toMap() {
|
|
return {
|
|
'label': label,
|
|
'type': type
|
|
};
|
|
}
|
|
|
|
@override
|
|
String toString() {
|
|
return '{label: $label, type: $type}';
|
|
}
|
|
} |