toMap method

Map toMap()

conversion to Map

Implementation

Map toMap() {
  Map map = Map();
  if (lastAccess != null) map[LAST_ACCESS] = lastAccess;
  if (count != null) map[COUNT] = count;
  if (pageSize != null) map[PAGESIZE] = pageSize;
  if (page != null) map[PAGE] = page;
  if (notifications != null) {
    List<Map> list = [];
    for (var i = 0; i < notifications!.length; i++) {
      list.add(notifications![i].toMap());
    }
    map[NOTIFICATIONS] = list;
  }
  return map;
}