class NotificationPayload {
  NotificationPayload({
    required this.page,
    this.params,
  });

  factory NotificationPayload.fromMap(Map<String, dynamic> data) {
    final param = data['params'];

    return NotificationPayload(
      page: data['page']?.toString() ?? '',
      params: param is Map ? Map<String, dynamic>.from(param) : null,
    );
  }

  final String page;
  final Map<String, dynamic>? params;

  bool get isValid => page.isNotEmpty;
}
