---
schema_version: "1"
id: c5718098e0d5a998120437ab3bb0a8e4e1db83c1a6ed2a85bccb53346bfcf354
title: getAttributes
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_getAttributes.md
canonical_url: https://developer.salesforce.com/docs/marketing/mobile-unified-sdk/references/engagement-mobile-sdk-reference/flutter_getAttributes.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 3fbd1e38193e2864e99533ec6ddb5053f8696b4e5e8c0afbff4b98ffe0820d35
products:
  - Salesforce Engagement SDK
---
# getAttributes

Retrieves all custom attributes associated with the device.

## Syntax

```dart
Future<Map<Object?, Object?>?> getAttributes()
```

## Returns

- `Future<Map<Object?, Object?>?>` - Returns a map of all custom attributes, or `null` if no attributes are set.

## Example

```dart
Map<Object?, Object?>? attributes = await SfmcSdk.getAttributes();
if (attributes != null) {
  attributes.forEach((key, value) {
    print('$key: $value');
  });
} else {
  print('No attributes found');
}
```

## Related Methods

- [setAttribute()](https://developer.salesforce.com/docs/marketing/mobile-unified-sdk/references/engagement-mobile-sdk-reference/flutter_setAttribute.md)
- [clearAttribute()](https://developer.salesforce.com/docs/marketing/mobile-unified-sdk/references/engagement-mobile-sdk-reference/flutter_clearAttribute.md)
