Resolve merge conflicts: README + ignore IDE files
This commit is contained in:
26
lib/models/route_notification.dart
Normal file
26
lib/models/route_notification.dart
Normal file
@@ -0,0 +1,26 @@
|
||||
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<String, dynamic> json) {
|
||||
final payload = json['pushPayload'] is Map<String, dynamic>
|
||||
? json['pushPayload'] as Map<String, dynamic>
|
||||
: <String, dynamic>{};
|
||||
|
||||
return RouteNotification(
|
||||
triggerEvent: json['triggerEvent'].toString(),
|
||||
condition: json['condition'].toString(),
|
||||
title: payload['title']?.toString() ?? '',
|
||||
body: payload['body']?.toString() ?? '',
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user