|
| 1 | +--- |
| 2 | +slug: webview |
| 3 | +title: WebView |
| 4 | +tags: [] |
| 5 | +description: Learn how to use WebView in FlutterFlow. |
| 6 | +sidebar_position: 6 |
| 7 | +--- |
| 8 | + |
| 9 | +# WebView |
| 10 | + |
| 11 | +The WebView widget lets you display the website content right inside your app. It's useful in a case where you don't want your users to leave your app to view the web page. |
| 12 | + |
| 13 | + |
| 14 | +## Adding WebView widget |
| 15 | + |
| 16 | +To add the WebView widget to your app: |
| 17 | + |
| 18 | +1. Add the **WebView** widget from the **Base Elements** tab. |
| 19 | +2. Head over to Properties Panel, adjust the **Width** and **Height**, and then enter the Webview URL.(e.g., https://flutterflow.io/,https://en.wikipedia.org/wiki/Main_Page). |
| 20 | +3. Certain web pages may have restrictions that prevent them from being viewed within the WebView, such as popular websites like [Unsplash](https://unsplash.com/) or [Facebook](https://www.facebook.com/). However, you can override these restrictions by enabling the **Bypass Domain Restrictions** option. |
| 21 | +4. You can also **Force Allow Vertical** and **Horizontal Scrolling** if needed. |
| 22 | + |
| 23 | +<div style={{ |
| 24 | + position: 'relative', |
| 25 | + paddingBottom: 'calc(56.67989417989418% + 41px)', // Keeps the aspect ratio and additional padding |
| 26 | + height: 0, |
| 27 | + width: '100%'}}> |
| 28 | + <iframe |
| 29 | + src="https://www.loom.com/embed/16fa503bf54c4d10b099f38affd71749?sid=b03d8b13-b2d7-4351-85f1-9e9d001356fa" |
| 30 | + title="" |
| 31 | + style={{ |
| 32 | + position: 'absolute', |
| 33 | + top: 0, |
| 34 | + left: 0, |
| 35 | + width: '100%', |
| 36 | + height: '100%', |
| 37 | + colorScheme: 'light' |
| 38 | + }} |
| 39 | + frameborder="0" |
| 40 | + loading="lazy" |
| 41 | + webkitAllowFullScreen |
| 42 | + mozAllowFullScreen |
| 43 | + allowFullScreen |
| 44 | + allow="clipboard-write"> |
| 45 | + </iframe> |
| 46 | +</div> |
| 47 | + |
| 48 | +## Customizing |
| 49 | + |
| 50 | +You can customize the appearance and behavior of this widget using the various properties available under the properties panel. |
| 51 | + |
| 52 | +### Load content from HTML |
| 53 | + |
| 54 | +Sometimes, you might choose to construct your own HTML with the desired styling and structure and then load that HTML into a WebView. For example, display a privacy policy page with a slight variation using modified HTML content (which might be different than the one hosted on your site). |
| 55 | + |
| 56 | +To do so, enable the **Load content from HTML** and then enter your **Webview HTML Content**. |
| 57 | + |
| 58 | +<div style={{ |
| 59 | + position: 'relative', |
| 60 | + paddingBottom: 'calc(56.67989417989418% + 41px)', // Keeps the aspect ratio and additional padding |
| 61 | + height: 0, |
| 62 | + width: '100%'}}> |
| 63 | + <iframe |
| 64 | + src="https://www.loom.com/embed/545515a32dc043da9c3320db7dd12b13?sid=7a16bb09-78f4-4ba5-990b-6b0456f1ebbe" |
| 65 | + title="" |
| 66 | + style={{ |
| 67 | + position: 'absolute', |
| 68 | + top: 0, |
| 69 | + left: 0, |
| 70 | + width: '100%', |
| 71 | + height: '100%', |
| 72 | + colorScheme: 'light' |
| 73 | + }} |
| 74 | + frameborder="0" |
| 75 | + loading="lazy" |
| 76 | + webkitAllowFullScreen |
| 77 | + mozAllowFullScreen |
| 78 | + allowFullScreen |
| 79 | + allow="clipboard-write"> |
| 80 | + </iframe> |
| 81 | +</div> |
| 82 | + |
| 83 | +### Show/Hide widget |
| 84 | + |
| 85 | +See how to show or hide any widget using the [Conditional Visibility](#) property. |
| 86 | + |
| 87 | +### Responsive visibility |
| 88 | + |
| 89 | +See how to [add responsive visibility](#) to any widget. |
| 90 | + |
| 91 | +### Add padding & alignment |
| 92 | + |
| 93 | +See how to add [padding](#) and [alignment](#) to any widget. |
0 commit comments