weatherAlert static method

Map<String, dynamic> weatherAlert()

Implementation

static Map<String, dynamic> weatherAlert() {
  const alerts = [
    'Heat Advisory',
    'Winter Storm Warning',
    'Flood Warning',
    'Tornado Watch',
    'Hurricane Warning',
  ];
  return {
    'type': alerts[_random.nextInt(alerts.length)],
    'severity': [
      'Minor',
      'Moderate',
      'Severe',
      'Extreme',
    ][_random.nextInt(4)],
    'description': 'Weather alert for the area',
    'startTime': DateTime.now(),
    'endTime': DateTime.now().add(Duration(hours: _random.nextInt(24))),
  };
}