import 'rich.dart'; import 'word.dart'; class Node { String? type; Word? word; Rich? rich; Node({ this.type, this.word, this.rich, }); factory Node.fromJson(Map json) => Node( type: json['type'] as String?, word: json['word'] == null ? null : Word.fromJson(json['word'] as Map), rich: json['rich'] == null ? null : Rich.fromJson(json['rich'] as Map), ); Map toJson() => { 'type': type, 'word': word?.toJson(), 'rich': rich?.toJson(), }; }