class RouteNotification { const RouteNotification({ required this.triggerEvent, required this.condition, required this.title, required this.body, }); final String triggerEvent; final String condition; final String title; final String body; factory RouteNotification.fromJson(Map json) { final payload = json['pushPayload'] is Map ? json['pushPayload'] as Map : {}; return RouteNotification( triggerEvent: json['triggerEvent'].toString(), condition: json['condition'].toString(), title: payload['title']?.toString() ?? '', body: payload['body']?.toString() ?? '', ); } }