updateUser method

  1. @override
Future<bool?> updateUser(
  1. Map<String, dynamic> data
)
override

Implementation

@override
Future<bool?> updateUser(Map<String, dynamic> data) {
  final Map user = {
    'profile': {
      if (data['email'] != null) 'email': data['email'],
      if (data['mobileNumber'] != null) 'mobileNumber': data['mobileNumber'],
      if (data['name'] != null) 'name': data['name'],
      if (data['avatarUrl'] != null) 'avatarUrl': data['avatarUrl'],
      if (data['customAttributes'] != null) ...data['customAttributes'],
    },
    if (data['profileOnce'] != null) 'profileOnce': data['profileOnce'],
    if (data['unsubscribeEmail'] != null)
      'unsubscribeEmail': data['unsubscribeEmail'],
    if (data['unsubscribeTexting'] != null)
      'unsubscribeTexting': data['unsubscribeTexting'],
    if (data['tags'] != null) 'tags': data['tags'],
    if (data['language'] != null) 'language': data['language'],
  };
  channel_talk_service.updateUser(
    'updateUser',
    user.jsify(),
  );
  return Future.value(true);
}