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
Properties
Methods
-
addMenuItem(
→ void ) - Adds a ChromeSafariBrowserMenuItem to the menu.
-
addMenuItems(
→ 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, otherwisefalse
. -
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, returnstrue
if SFSafariViewController is available. Otherwise returnsfalse
.