ChromeSafariBrowserSettings constructor

ChromeSafariBrowserSettings({
  1. CustomTabsShareState? shareState = CustomTabsShareState.SHARE_STATE_DEFAULT,
  2. bool? showTitle = true,
  3. Color? toolbarBackgroundColor,
  4. Color? navigationBarColor,
  5. Color? navigationBarDividerColor,
  6. Color? secondaryToolbarColor,
  7. bool? enableUrlBarHiding = false,
  8. bool? instantAppsEnabled = false,
  9. String? packageName,
  10. bool? keepAliveEnabled = false,
  11. bool? isSingleInstance = false,
  12. bool? noHistory = false,
  13. bool? isTrustedWebActivity = false,
  14. List<String>? additionalTrustedOrigins = const [],
  15. TrustedWebActivityDisplayMode? displayMode,
  16. TrustedWebActivityScreenOrientation? screenOrientation = TrustedWebActivityScreenOrientation.DEFAULT,
  17. List<AndroidResource>? startAnimations,
  18. List<AndroidResource>? exitAnimations,
  19. bool? alwaysUseBrowserUI = false,
  20. bool? entersReaderIfAvailable = false,
  21. bool? barCollapsingEnabled = false,
  22. DismissButtonStyle? dismissButtonStyle = DismissButtonStyle.DONE,
  23. Color? preferredBarTintColor,
  24. Color? preferredControlTintColor,
  25. ModalPresentationStyle? presentationStyle = ModalPresentationStyle.FULL_SCREEN,
  26. ModalTransitionStyle? transitionStyle = ModalTransitionStyle.COVER_VERTICAL,
  27. ActivityButton? activityButton,
  28. UIEventAttribution? eventAttribution,
})

Officially Supported Platforms/Implementations:

  • Android Chrome Custom Tabs
  • iOS SFSafariViewController

Implementation

ChromeSafariBrowserSettings({
  this.shareState = CustomTabsShareState.SHARE_STATE_DEFAULT,
  this.showTitle = true,
  this.toolbarBackgroundColor,
  this.navigationBarColor,
  this.navigationBarDividerColor,
  this.secondaryToolbarColor,
  this.enableUrlBarHiding = false,
  this.instantAppsEnabled = false,
  this.packageName,
  this.keepAliveEnabled = false,
  this.isSingleInstance = false,
  this.noHistory = false,
  this.isTrustedWebActivity = false,
  this.additionalTrustedOrigins = const [],
  this.displayMode,
  this.screenOrientation = TrustedWebActivityScreenOrientation.DEFAULT,
  this.startAnimations,
  this.exitAnimations,
  this.alwaysUseBrowserUI = false,
  this.entersReaderIfAvailable = false,
  this.barCollapsingEnabled = false,
  this.dismissButtonStyle = DismissButtonStyle.DONE,
  this.preferredBarTintColor,
  this.preferredControlTintColor,
  this.presentationStyle = ModalPresentationStyle.FULL_SCREEN,
  this.transitionStyle = ModalTransitionStyle.COVER_VERTICAL,
  this.activityButton,
  this.eventAttribution,
}) {
  if (startAnimations != null) {
    assert(
      startAnimations!.length == 2,
      "start animations must be have 2 android resources",
    );
  }
  if (exitAnimations != null) {
    assert(
      exitAnimations!.length == 2,
      "exit animations must be have 2 android resources",
    );
  }
}