You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+198-18
Original file line number
Diff line number
Diff line change
@@ -16,11 +16,17 @@ For help on editing plugin code, view the [documentation](https://flutter.io/dev
16
16
First, add `flutter_inappbrowser` as a [dependency in your pubspec.yaml file](https://flutter.io/using-packages/).
17
17
18
18
## Usage
19
+
Classes:
20
+
-[InAppBrowser](#inappbrowser): Native WebView.
21
+
-[ChromeSafariBrowser](#chromesafaribrowser): [Chrome Custom Tabs](https://developer.android.com/reference/android/support/customtabs/package-summary) on Android / [SFSafariViewController](https://developer.apple.com/documentation/safariservices/sfsafariviewcontroller) on iOS.
22
+
23
+
Screenshots [here](#screenshots).
24
+
25
+
### `InAppBrowser` class
19
26
Create a Class that extends the `InAppBrowser` Class in order to override the callbacks to manage the browser events.
Injects JavaScript code into the `InAppBrowser` window and returns the result of the evaluation. (Only available when the target is set to `_blank` or to `_self`)
317
323
318
324
```dart
319
325
inAppBrowser.injectScriptCode(String source);
320
326
```
321
327
322
-
### Future\<void\> InAppBrowser.injectScriptFile
328
+
####Future\<void\> InAppBrowser.injectScriptFile
323
329
324
330
Injects a JavaScript file into the `InAppBrowser` window. (Only available when the target is set to `_blank` or to `_self`)
325
331
326
332
```dart
327
333
inAppBrowser.injectScriptFile(String urlFile);
328
334
```
329
335
330
-
### Future\<void\> InAppBrowser.injectStyleCode
336
+
####Future\<void\> InAppBrowser.injectStyleCode
331
337
332
338
Injects CSS into the `InAppBrowser` window. (Only available when the target is set to `_blank` or to `_self`)
333
339
334
340
```dart
335
341
inAppBrowser.injectStyleCode(String source);
336
342
```
337
343
338
-
### Future\<void\> InAppBrowser.injectStyleFile
344
+
####Future\<void\> InAppBrowser.injectStyleFile
339
345
340
346
Injects a CSS file into the `InAppBrowser` window. (Only available when the target is set to `_blank` or to `_self`)
341
347
342
348
```dart
343
349
inAppBrowser.injectStyleFile(String urlFile);
344
350
```
345
351
352
+
### `ChromeSafariBrowser` class
353
+
Create a Class that extends the `ChromeSafariBrowser` Class in order to override the callbacks to manage the browser events. Example:
Opens an `url` in a new `ChromeSafariBrowser` instance or the system browser.
453
+
454
+
-`url`: The `url` to load. Call `encodeUriComponent()` on this if the `url` contains Unicode characters.
455
+
456
+
-`options`: Options for the `ChromeSafariBrowser`.
457
+
458
+
-`headersFallback`: The additional header of the `InAppBrowser` instance fallback to be used in the HTTP request for this URL, specified as a map from name to value.
459
+
460
+
-`optionsFallback`: Options used by the `InAppBrowser` instance fallback.
461
+
462
+
**Android** supports these options:
463
+
464
+
-__addShareButton__: Set to `false` if you don't want the default share button. The default value is `true`.
465
+
-__showTitle__: Set to `false` if the title shouldn't be shown in the custom tab. The default value is `true`.
466
+
-__toolbarBackgroundColor__: Set the custom background color of the toolbar.
467
+
-__enableUrlBarHiding__: Set to `true` to enable the url bar to hide as the user scrolls down on the page. The default value is `false`.
468
+
-__instantAppsEnabled__: Set to `true` to enable Instant Apps. The default value is `false`.
469
+
470
+
**iOS** supports these options:
471
+
472
+
-__entersReaderIfAvailable__: Set to `true` if Reader mode should be entered automatically when it is available for the webpage. The default value is `false`.
473
+
-__barCollapsingEnabled__: Set to `true` to enable bar collapsing. The default value is `false`.
474
+
-__dismissButtonStyle__: Set the custom style for the dismiss button. The default value is `0 //done`. See [SFSafariViewController.DismissButtonStyle](https://developer.apple.com/documentation/safariservices/sfsafariviewcontroller/dismissbuttonstyle) for all the available styles.
475
+
-__preferredBarTintColor__: Set the custom background color of the navigation bar and the toolbar.
476
+
-__preferredControlTintColor__: Set the custom color of the control buttons on the navigation bar and the toolbar.
477
+
-__presentationStyle__: Set the custom modal presentation style when presenting the WebView. The default value is `0 //fullscreen`. See [UIModalPresentationStyle](https://developer.apple.com/documentation/uikit/uimodalpresentationstyle) for all the available styles.
478
+
-__transitionStyle__: Set to the custom transition style when presenting the WebView. The default value is `0 //crossDissolve`. See [UIModalTransitionStyle](https://developer.apple.com/documentation/uikit/uimodaltransitionStyle) for all the available styles.
0 commit comments