Webview constructor

Webview({
  1. Key? key,
  2. required String websiteToken,
  3. required String baseUrl,
  4. ChatwootUser? user,
  5. String locale = "en",
  6. dynamic customAttributes,
  7. void closeWidget()?,
  8. Future<List<String>> onAttachFile()?,
  9. void onLoadStarted()?,
  10. void onLoadProgress(
    1. int
    )?,
  11. void onLoadCompleted()?,
})

Implementation

Webview(
    {Key? key,
    required String websiteToken,
    required String baseUrl,
    ChatwootUser? user,
    String locale = "en",
    customAttributes,
    this.closeWidget,
    this.onAttachFile,
    this.onLoadStarted,
    this.onLoadProgress,
    this.onLoadCompleted})
    : super(key: key) {
  widgetUrl =
      "${baseUrl}/widget?website_token=${websiteToken}&locale=${locale}";

  injectedJavaScript = generateScripts(
      user: user, locale: locale, customAttributes: customAttributes);
}