Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable progress indicator for page load with WebviewScaffold #160

Merged
merged 5 commits into from
Nov 14, 2018

Conversation

js1972
Copy link
Contributor

@js1972 js1972 commented Aug 15, 2018

With regards to issue #159 which was a request to enable a page load "waiting" indicator of some sort. I've had a quick crack at it myself here.

Added two optional parameters to the WebviewScaffold widget: hidden and initialChild.
By setting hidden to true the underling Scaffold widget is shown (defaulting to a CircularProgressIndicator as the body). Then we track the state change so that when the page is loaded show() is called on the webview.
If the initialChild parameter is also set to a Widget - then it is shown instead of the default CircularProgressIndicator.

@JazielGuerrero
Copy link

JazielGuerrero commented Oct 28, 2018

Hello

I tested this functionality in iPhone 7 emulator works well. But i'm having an issue with my android device Samsung J7 it's stuck loading.

How i run the webview

_webViewModal(BuildContext context, String url, String title) { Navigator.push(context, MaterialPageRoute(builder: (context) { return new WebviewScaffold( url: url, hidden: true, appBar: new AppBar( iconTheme: IconThemeData( color: Colors.white ), title: new Text(title, style: TextStyle(color: Colors.white),), ), ); })); }

If i remove the hidden property it works well, of course it doesn't display the circular loading.
The URL is a *.aspx file. I change it to https://google.com and the problem persist.

Here's the logs when running.

Launching lib/main.dart on SM J700H in debug mode... Initializing gradle... Resolving dependencies... Running 'gradlew assembleDebug'... Built build/app/outputs/apk/debug/app-debug.apk. Installing build/app/outputs/apk/app.apk... Syncing files to device SM J700H... D/libGLESv2(10153): DTS_GLAPI : DTS is not allowed for Package : tech.jaspe.blumboxcourier D/libGLESv1(10153): DTS_GLAPI : DTS is not allowed for Package : tech.jaspe.blumboxcourier D/ViewRootImpl(10153): ViewPostImeInputStage processPointer 0 D/ViewRootImpl(10153): ViewPostImeInputStage processPointer 1 I/WebViewFactory(10153): Loading com.google.android.webview version 70.0.3538.64 (code 353806400) D/ResourcesManager(10153): For user 0 new overlays fetched Null I/art (10153): Rejecting re-init on previously-failed class java.lang.Class<hs> I/art (10153): Rejecting re-init on previously-failed class java.lang.Class<hs> I/cr_LibraryLoader(10153): Time to load native libraries: 10 ms (timestamps 5193-5203) I/chromium(10153): [INFO:library_loader_hooks.cc(36)] Chromium logging enabled: level = 0, default verbosity = 0 I/cr_LibraryLoader(10153): Expected native library version number "70.0.3538.64", actual native library version number "70.0.3538.64" I/cr_BrowserStartup(10153): Initializing chromium process, singleProcess=true E/libEGL (10153): validate_display:255 error 3008 (EGL_BAD_DISPLAY) D/libEGL (10153): eglInitialize EGLDisplay = 0xd1e0b514 W/cr_media(10153): Requires BLUETOOTH permission W/AudioCapabilities(10153): Unsupported mime audio/mpeg-L1 W/AudioCapabilities(10153): Unsupported mime audio/mpeg-L2 W/AudioCapabilities(10153): Unsupported mime audio/x-ms-wma W/AudioCapabilities(10153): Unsupported mime audio/x-ima W/VideoCapabilities(10153): Unrecognized profile 2130706433 for video/avc W/VideoCapabilities(10153): Unrecognized profile 2130706433 for video/avc W/VideoCapabilities(10153): Unrecognized profile 2130706433 for video/avc W/VideoCapabilities(10153): Unrecognized profile/level 32768/2 for video/mp4v-es W/VideoCapabilities(10153): Unsupported mime video/wvc1 W/VideoCapabilities(10153): Unsupported mime video/x-ms-wmv W/VideoCapabilities(10153): Unrecognized profile 2130706433 for video/avc W/VideoCapabilities(10153): Unrecognized profile 2130706433 for video/avc W/VideoCapabilities(10153): Unrecognized profile/level 32768/2 for video/mp4v-es W/VideoCapabilities(10153): Unsupported mime video/wvc1 W/VideoCapabilities(10153): Unsupported mime video/x-ms-wmv W/VideoCapabilities(10153): Unsupported mime video/x-ms-wmv7 W/VideoCapabilities(10153): Unsupported mime video/x-ms-wmv8 W/VideoCapabilities(10153): Unsupported mime video/mp43 W/VideoCapabilities(10153): Unrecognized profile 2130706433 for video/avc W/VideoCapabilities(10153): Unrecognized profile 2130706433 for video/avc W/VideoCapabilities(10153): Unrecognized profile 2130706433 for video/avc W/VideoCapabilities(10153): Unrecognized profile 2130706433 for video/avc W/VideoCapabilities(10153): Unrecognized profile/level 32768/2 for video/mp4v-es I/VideoCapabilities(10153): Unsupported profile 4 for video/mp4v-es

Later i'll test in a physical iPhone device, and if there's a problem i'll let you know.

....

I test it with an iPhone 6, and works well.

@charafau charafau merged commit dcff178 into fluttercommunity:master Nov 14, 2018
@shubhammatta
Copy link

Hidden: True , is not working sometimes, I think it has something to do with being out of memory. Is there any way change/increase the WebView Cache Size?

@snavebaby
Copy link

Works for me. Thank you @js1972

charafau added a commit that referenced this pull request Apr 7, 2020
Enable progress indicator for page load with WebviewScaffold
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants