class NotificationOpenedEvent { final String? serverUrl; final String? channelId; final String? rootId; final bool isCRTEnabled; const NotificationOpenedEvent({ this.serverUrl, this.channelId, this.rootId, this.isCRTEnabled = false, }); factory NotificationOpenedEvent.fromMap(Map data) { return NotificationOpenedEvent( serverUrl: data['server_url'] as String?, channelId: data['channel_id'] as String?, rootId: data['root_id'] as String?, isCRTEnabled: _parseCrtEnabled(data['is_crt_enabled']), ); } } bool _parseCrtEnabled(Object? value) { return value == true || value == 'true' || value == '1'; }