---
title: "Flutter SDK: Callbacks"
description: "Handle widget events and lifecycle callbacks with the Gleap Flutter SDK. Follow the integration code examples."
url: https://docs.gleap.ai/en/articles/547-flutter-sdk-callbacks
collection: "Flutter"
updated: 2026-11-01
language: en
---

# Flutter SDK: Callbacks

Handle widget events and lifecycle callbacks with the Gleap Flutter SDK. Follow the integration code examples.

Set callbacks to different actions to get notified on certain state changes of the Gleap widget. This enables you to create an even deeper integration with Gleap.

```dart
Gleap.registerListener(
    actionName: 'feedbackFlowStarted',
    callbackHandler: (dynamic flow) {
        // Do something with the flow
    },
);
```

```dart
Gleap.registerListener(
    actionName: 'initialized',
    callbackHandler: (_) {
        // Do something when Gleap is initialized
    },
);
```

```dart
Gleap.registerListener(
    actionName: 'notificationCountUpdated',
    callbackHandler: (dynamic count) {
        // Do something with the count
    },
);
```

```dart
Gleap.registerListener(
    actionName: 'feedbackSent',
    callbackHandler: (_) {
        // Do something
    },
);
```

```dart
Gleap.registerListener(
    actionName: 'feedbackSendingFailed',
    callbackHandler: (_) {
        // Do something
    },
);
```

```dart
Gleap.registerListener(
    actionName: 'widgetOpened',
    callbackHandler: (_) {
        // Do something
    },
);
```

```dart
Gleap.registerListener(
    actionName: 'widgetClosed',
    callbackHandler: (_) {
        // Do something
    },
);
```

## Related

- [Flutter SDK setup](https://docs.gleap.ai/en/articles/531-flutter-sdk-setup.md)
- [Flutter SDK: User identity](https://docs.gleap.ai/en/articles/532-flutter-sdk-user-identity.md)
- [Flutter SDK: Track events](https://docs.gleap.ai/en/articles/533-flutter-sdk-track-events.md)
- [Flutter SDK: Track pages](https://docs.gleap.ai/en/articles/534-flutter-sdk-track-pages.md)
- [Flutter SDK: Frontend tools](https://docs.gleap.ai/en/articles/535-flutter-sdk-frontend-tools.md)
