Map<String, dynamic> toJson() { return <String, dynamic>{ if (provider != null) r'provider': provider, if (self != null) r'self': self, }; }