toMap method

Map<String, dynamic> toMap()

toMap is the method to convert the class to a map.

Implementation

Map<String, dynamic> toMap() {
  return {
    'name': name,
    'frequency': frequency,
  };
}