showSurveyPage method
Future<bool>
showSurveyPage(
- BuildContext context, {
- required String appId,
- required String linkOrToken,
- Map<
String, String> ? options, - VoidCallback? onCompleted,
- VoidCallback? onError,
- VoidCallback? onDismissed,
override
Implementation
@override
Future<bool> showSurveyPage(
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,
);
await Navigator.of(context).push(
MaterialPageRoute(
builder: (context) =>
CustomerPulsePage(url: url, dispatcher: dispatcher),
),
);
// The route has popped. If the survey was not completed and the in-web-view
// close event did not already fire the dismiss, treat the route pop (back
// button, AppBar, programmatic pop) as a user-driven dismiss.
dispatcher.fireDismissedIfNeeded();
return true;
}