I need all the functionalities (e.g., Searching) that a WebView provides on a WebPage but don't want to show any WebPage (provided to the initialUrl property) in the UI.
Instead, I need to show Custom Widgets inside the WebView widget upon which I can perform operations similar to Web Pages.
So, my queries are:
Is it possible to achieve this using the WebView widget?
If not, is there any Widget available similar to the WebView widget that can fulfill my requirements?
I open a web page in the application using the url launcher - Link widget, but these buttons are not visible.
This buttons
My codes
I am testing my Flutter Web app using widget tests, and would like to navigate to a specific page like a user could by entering a URL in the browser bar.
How can I emulate this inside a widget test?
I'm developing an app in flutter, and i got stuck while trying to preload a page in webview.
Basically, the app uses tabbar, with a few tabs with normal listview content in them, and 2 tabs that should have webview as content. Any idea how to preload the webviews and keep them alive in background while the app loads, so when the user swipes between tabs, and gets on the webview ones, the sites are already loaded and rendered so the UX is seamless. I have tried creating the WebView instance and assigning it to a variable using setstate on app load, but to no avail.
Any help would be appreciated.
So what you can try doing is this:
Wrap the widgets you are calling in your TabBar with a PageView like shown here.
You can also ensure that the WebView stays alive after loading once by extending your stateful widget with AutomaticKeepAliveClientMixin. While using this ensure that you declare:
bool get wantKeepAlive => true;
Edit:
In order to preload all your pages when your app launches you can use Indexed Stack in the class your TabBar is declared. Wrap the body and call all the pages there like this:
Widget build(BuildContext context) {
return
Scaffold(
body:IndexedStack(
index: _selectedIndex,
children: _children,
),),}
You can wrap your webview with the OffStage widget and set the offstage parameter to true. When some events are trigger and you're ready to show the page, flip the offstage parameter to false.
I have a Cupertino Tabbar where one page (the third page) has a Google maps widget.
The app starts on page one.
But is it possible to meanwhile load the Maps widget? (So if page 3 is selected Google Maps is already loaded).
try using IndexedStack with Tabbar, pages will be preloaded all at a time, Tabbar with IndexedStack