showSurveyBottomSheet method
Future<bool>
showSurveyBottomSheet(
- BuildContext context, {
- required String appId,
- required String linkOrToken,
- Map<
String, String> ? options, - VoidCallback? onCompleted,
- VoidCallback? onError,
- VoidCallback? onDismissed,
override
Implementation
@override
Future<bool> showSurveyBottomSheet(
BuildContext context, {
required String appId,
required String linkOrToken,
Map<String, String>? options,
VoidCallback? onCompleted,
VoidCallback? onError,
VoidCallback? onDismissed,
}) async {
String url = "$_baseUrl$linkOrToken/${getParams(options)}";
final dispatcher = CustomerPulseEventDispatcher(
onCompleted: onCompleted,
onError: onError,
onDismissed: onDismissed,
);
// Do not await the sheet — preserve the original Future<bool> timing.
// Attach a completion callback so a drag-down / barrier-tap dismiss fires
// onDismissed exactly once (unless already completed/dismissed).
showModalBottomSheet(
context: context,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.vertical(top: Radius.circular(20)),
),
builder: (context) {
return CustomerPulseWebView(url: url, dispatcher: dispatcher);
},
).whenComplete(dispatcher.fireDismissedIfNeeded);
return true;
}