This repository provides the CustomerPulse Flutter Plugin for integrating UAE customer pulse functionality directly into your Flutter applications.
- Collect real-time user feedback.
- Easy integration with Flutter projects.
- Fully customizable feedback forms.
-
Add the following dependency to your
pubspec.yaml:dependencies: customerpulse_flutter: ^1.2.0
or use github link:
customerpulse_flutter: git: https://github.com/KalvadTech/CustomerPulse-flutter.git
-
Install the package:
flutter pub get
import 'package:customerpulse_flutter/customerpulse_flutter.dart';Use the following code to display the survey form in a full page:
CustomerPulseFlutter().showSurveyPage(
context,
appId: 'com.kalvad.example',
linkOrToken: 'F/AH/'
);Use the following code to display the survey form in a bottom sheet:
CustomerPulseFlutter().showSurveyBottomSheet(
context,
appId: 'com.kalvad.example',
linkOrToken: 'F/AH/'
);| Name | Type | Description | Default |
|---|---|---|---|
context |
BuildContext |
Widget context used for navigation | |
appId |
String |
Application ID provided by the Customer Pulse Survey provider | |
linkOrToken |
String |
Link ID or token provided by the Customer Pulse Survey provider | |
options |
Map<String, String> |
Options such as language (lang) for the survey |
CustomerPulseFlutter().showSurveyPage(
context,
appId: 'com.kalvad.example',
linkOrToken: 'F/AH/',
options: {'lang': 'en'}
);Both showSurveyPage and showSurveyBottomSheet accept three optional
lifecycle callbacks so the host app can react to the survey. They are fully
backward compatible — omitting them behaves exactly as before.
CustomerPulseFlutter().showSurveyPage(
context,
appId: 'com.kalvad.example',
linkOrToken: 'F/AH/',
onCompleted: () => debugPrint('Survey completed'),
onError: () => debugPrint('Survey error'),
onDismissed: () => debugPrint('Survey dismissed'),
);| Callback | Type | Fires when |
|---|---|---|
onCompleted |
VoidCallback? |
The survey is submitted successfully. Fires once, then the survey closes. |
onError |
VoidCallback? |
The survey reports an error. The survey stays open (matches the native SDKs). |
onDismissed |
VoidCallback? |
The survey is closed without completing (drag-down, back/AppBar, barrier tap, or in-survey close). |
onDismissed fires exactly once and never after onCompleted.
The web survey emits string events through the Android JavaScript handler.
They map onto the callbacks as follows:
| Web event | Callback | Closes the survey? |
|---|---|---|
so-widget-completed |
onCompleted |
Yes |
so-widget-error |
onError |
No |
so-widget-closed |
onDismissed |
Yes |
open |
— | No (no-op) |
A user-driven dismiss (drag-down, back button, AppBar close, or barrier tap)
that does not emit so-widget-completed also fires onDismissed once.
We welcome contributions! Feel free to submit issues or pull requests with improvements or bug fixes.
This project is licensed under the MIT License. See the LICENSE file for more details.