setFeedbackOptions static method
Future<void>
setFeedbackOptions({
- String? defaultText,
- String? browserUrl,
- bool emailFieldVisible = true,
- bool emailMandatory = false,
- bool takeScreenshotButtonVisible = true,
- bool recordVideoButtonVisible = true,
- List<
FeedbackFormField> ? feedbackFormFields, - dynamic onFeedbackSent() = emptyFeedbackContentFunction,
- dynamic onFeedbackCancelled() = emptyFunction,
- dynamic onFeedbackFailed() = emptyFeedbackContentFunction,
Customizes the feedback form.
Implementation
static Future<void> setFeedbackOptions(
{String? defaultText,
String? browserUrl,
bool emailFieldVisible = true,
bool emailMandatory = false,
bool takeScreenshotButtonVisible = true,
bool recordVideoButtonVisible = true,
List<FeedbackFormField>? feedbackFormFields,
Function(FeedbackContent) onFeedbackSent = emptyFeedbackContentFunction,
Function() onFeedbackCancelled = emptyFunction,
Function(FeedbackContent) onFeedbackFailed =
emptyFeedbackContentFunction}) async {
TestFairyBase.prepareTwoWayInvoke();
final Map<String, dynamic> args = <String, dynamic>{
'defaultText': defaultText,
'browserUrl': browserUrl,
'emailFieldVisible': emailFieldVisible,
'emailMandatory': emailMandatory,
'takeScreenshotButtonVisible': takeScreenshotButtonVisible,
'recordVideoButtonVisible': recordVideoButtonVisible,
'feedbackFormFields': feedbackFormFields != null
? feedbackFormFields
.map((FeedbackFormField e) => e.toMap())
.toList(growable: false)
: null,
'callId': TestFairyBase.feedbackOptionsIdCounter
};
TestFairyBase.feedbackOptionsCallbacks
.putIfAbsent(TestFairyBase.feedbackOptionsIdCounter.toString(), () {
return <String, dynamic>{
'onFeedbackSent': onFeedbackSent,
'onFeedbackCancelled': onFeedbackCancelled,
'onFeedbackFailed': onFeedbackFailed
};
});
TestFairyBase.feedbackOptionsIdCounter++;
await TestFairyBase.channel.invokeMethod<void>('setFeedbackOptions', args);
}