updateUserAttributes method
Reports self-declared user attributes.
Implementation
Future<UserAttributesUpdateResult> updateUserAttributes({
required String userToken,
bool? isPaying,
String? plan,
double? mrr,
String? currency,
}) async {
final body = <String, dynamic>{};
if (isPaying != null) body['isPaying'] = isPaying;
if (plan != null && plan.isNotEmpty) body['plan'] = plan.trim();
if (mrr != null) body['mrr'] = mrr;
if (currency != null && currency.isNotEmpty) body['currency'] = currency.trim();
final json = await _sendJson(
method: 'PUT',
path: '/api/v1/public/apps/${config.appKey}/user',
body: body,
userToken: userToken,
acceptedStatuses: const [200],
);
return UserAttributesUpdateResult.fromJson(json);
}