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. void onLoadStarted()?,
  9. void onLoadProgress(
    1. int
    )?,
  10. void onLoadCompleted()?,
})

Implementation

Webview({
  Key? key,
  required String websiteToken,
  required String baseUrl,
  ChatwootUser? user,
  String locale = "en",
  customAttributes,
  this.closeWidget,
  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,
  );
}