---
schema_version: "1"
id: 9389d282a68d4e3bb01df2cd5aa8b13577f0c6a489fe3ef162a182d7dad1343d
title: clearAttribute
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/marketing-cloud-mobilepush/engagement_sdk/references/flutter/flutter_clearAttribute.md
canonical_url: https://developer.salesforce.com/docs/marketing/mobile-unified-sdk/references/engagement-mobile-sdk-reference/flutter_clearAttribute.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: cef537ee3309d0ab5b026b6966d16fe86c7c7e325e70cc9fdd4d944e7bb926f1
products:
  - Salesforce Engagement SDK
---
# clearAttribute

Removes a custom attribute from the device.

## Syntax

```dart
Future<void> clearAttribute(String key)
```

## Parameters

- `key` (String) - The attribute key to remove

## Returns

- `Future<void>` - Completes when the attribute has been cleared.

## Example

```dart
try {
  await SfmcSdk.clearAttribute('userType');
  print('Attribute cleared successfully');
} catch (e) {
  print('Failed to clear attribute: $e');
}
```

## Related Methods

- [getAttributes()](https://developer.salesforce.com/docs/marketing/mobile-unified-sdk/references/engagement-mobile-sdk-reference/flutter_getAttributes.md)
- [setAttribute()](https://developer.salesforce.com/docs/marketing/mobile-unified-sdk/references/engagement-mobile-sdk-reference/flutter_setAttribute.md)
