toMap method Null safety

Map<String, dynamic> toMap()

Implementation

Map<String, dynamic> toMap() {
  Map<String, dynamic> _data = {};

  this.data.forEach((key, value) {
    if (value is YekongaForm) {
      _data[key] = value.toMap();
    } else {
      _data[key] = value;
    }
  });

  return _data;
}