toJson method

  1. @override
Map<String, dynamic> toJson()
override

Creates Map from Class Object

Implementation

@override
Map<String, dynamic> toJson() {
  final map = <String, dynamic>{};
  map['name'] = name;

  final localStorage = storage?.toJson();
  map['storage'] = localStorage == null ? None : Option.some(localStorage);

  final localCalls = calls?.map((e) => e.toJson()).toList(growable: false);
  map['calls'] = localCalls == null ? None : Option.some(localCalls);

  final localEvents = events?.map((e) => e.toJson()).toList(growable: false);
  map['events'] = localEvents == null ? None : Option.some(localEvents);

  map['constants'] = constants.map((e) => e.toJson()).toList(growable: false);

  map['errors'] = errors.map((e) => e.toJson()).toList(growable: false);

  map['index'] = index;
  return map;
}