AlertList.fromMap constructor

AlertList.fromMap(
  1. Map<String, dynamic> map
)

Implementation

factory AlertList.fromMap(
  Map<String, dynamic> map,
) {
  map = {
    'total': 0,
    'alerts': [],
    ...map,
  };

  return AlertList(
    total: map['total'],
    alerts: List<Alert>.from(
      map['alerts'].map((p) => Alert.fromMap(p)),
    ),
  );
}