21 lines
No EOL
471 B
Dart
21 lines
No EOL
471 B
Dart
import 'dart:convert';
|
|
|
|
abstract class IJsonSerializable {
|
|
/// Encode json and return as String
|
|
String encode() {
|
|
return json.encode(toJson());
|
|
}
|
|
|
|
/// Returns a Json Object
|
|
Map<String,dynamic> toJson();
|
|
|
|
/// Decodes json and returns the instance
|
|
static IJsonSerializable fromJson(String js) {
|
|
throw UnimplementedError();
|
|
}
|
|
|
|
/// Decodes json object
|
|
static IJsonSerializable decode(Map<String,dynamic> js) {
|
|
throw UnimplementedError();
|
|
}
|
|
} |