toJson method

Map<String, Object?> toJson()

Implementation

Map<String, Object?> toJson() {
  final data = <String, Object?>{};
  if (state != null) {
    data['state'] = {
      'events': state!.map((i) => i.toJson()).toList(),
    };
  }
  if (timeline != null) {
    data['timeline'] = timeline!.toJson();
  }
  if (accountData != null) {
    data['account_data'] = {
      'events': accountData!.map((i) => i.toJson()).toList(),
    };
  }
  return data;
}