Object to Map serializer
@override Map<String, dynamic> toJson() { return { '@type': 'userStatusOffline', if (extra != null) '@extra': extra, 'was_online': was_online }; }