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