ChromeSafariBrowser class

This class uses native Chrome Custom Tabs on Android and SFSafariViewController on iOS.

NOTE: If you want to use the ChromeSafariBrowser class on Android 11+ you need to specify your app querying for android.support.customtabs.action.CustomTabsService in your AndroidManifest.xml (you can read more about it here: https://developers.google.com/web/android/custom-tabs/best-practices#applications_targeting_android_11_api_level_30_or_above).

Constructors

ChromeSafariBrowser()

Properties

hashCode int
The hash code for this object.
no setterinherited
id String
View ID used internally.
latefinal
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addMenuItem(ChromeSafariBrowserMenuItem menuItem) → void
Adds a ChromeSafariBrowserMenuItem to the menu.
addMenuItems(List<ChromeSafariBrowserMenuItem> menuItems) → void
Adds a list of ChromeSafariBrowserMenuItem to the menu.
close() Future<void>
Closes the ChromeSafariBrowser instance.
handleMethod(MethodCall call) Future
isOpened() bool
Returns true if the ChromeSafariBrowser instance is opened, otherwise false.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onClosed() → void
Event fires when the ChromeSafariBrowser is closed.
onCompletedInitialLoad() → void
Event fires when the initial URL load is complete.
onOpened() → void
Event fires when the ChromeSafariBrowser is opened.
open({required Uri url, ChromeSafariBrowserClassOptions? options}) Future<void>
Opens the ChromeSafariBrowser instance with an url.
setActionButton(ChromeSafariBrowserActionButton actionButton) → void
Set a custom action button.
throwIsAlreadyOpened({String message = ''}) → void
throwIsNotOpened({String message = ''}) → void
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

isAvailable() Future<bool>
On Android, returns true if Chrome Custom Tabs is available. On iOS, returns true if SFSafariViewController is available. Otherwise returns false.