@override Map<String, dynamic> toJson() => { 'action': action, if (data != null) 'data': {...data!} };