fluttercommunity / fluttercommunity/flutter_webview_plugin

WebView in WebviewScaffold is always shown if onStateChanged with finishLoad is triggered

Open
#527 0 comments 3 reactions 0 assignees View on GitHub
bug
Dominant language
Java
Stars
1.5k
Forks
938
PR merge metrics
No merged PRs in 30d

Description

## System info

Issue occurs on: Android for sure, haven't tested iOS
Plugin version: 0.3.7
Flutter doctor output:

```
[√] Flutter (Channel stable, v1.7.8+hotfix.4, on Microsoft Windows [Version 10.0.17763.678], locale de-AT)

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.1)
[√] Android Studio (version 3.4)
[√] Connected device (3 available)

• No issues found!
```

## Steps to Reproduce

1. Create an app that uses the `WebviewScaffold` with the `hidden` parameter to `true`.
2. Once the initial page load is finished (and the web view is shown), hide the web view by calling `FlutterWebviewPlugin.hide()`.
3. Do one of the following:
a. Have a page finish loading because you called `hide()` while it was loading.
b. Call `FlutterWebviewPlugin.reload()`.
4. Now the `FlutterWebviewPlugin` is shown again, although it should stay hidden.

I assume the problem is here: https://github.com/fluttercommunity/flutter_webview_plugin/blob/c3b3fcf47f6275711902ba62623ef66d2e2a51dd/lib/src/webview_scaffold.dart#L105-L111
That event should be handled only once.

## Logs

(No output from `flutter run --verbose`.)

`flutter analyze`:
```
No issues found! (ran in 4.3s)
```

```
[√] Flutter (Channel stable, v1.7.8+hotfix.4, on Microsoft Windows [Version 10.0.17763.678], locale de-AT)
• Flutter version 1.7.8+hotfix.4 at C:\Android\flutter
• Framework revision 20e59316b8 (4 weeks ago), 2019-07-18 20:04:33 -0700
• Engine revision fee001c93f
• Dart version 2.4.0

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.1)
• Android SDK at C:\Android\Sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.1
• ANDROID_HOME = C:\Android\Sdk
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)
• All Android licenses accepted.

[√] Android Studio (version 3.4)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 38.2.1
• Dart plugin version 183.6270
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b01)

[√] Connected device (1 available)
• Android SDK built for x86 • emulator-5554 • android-x86 • Android 9 (API 28) (emulator)

• No issues found!
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.