21 lines
352 B
Dart
21 lines
352 B
Dart
|
|
import 'dart:convert';
|
|
|
|
class TextValue {
|
|
String text;
|
|
int value;
|
|
|
|
TextValue.fromJson(Map<String, dynamic> json)
|
|
: text = json['text'],
|
|
value = int.parse(json['value'].toString());
|
|
|
|
Map<String, dynamic> toJson() => {
|
|
'text': text,
|
|
'value': value
|
|
};
|
|
|
|
@override
|
|
String toString() {
|
|
return json.encode(this);
|
|
}
|
|
} |