fluttercommunity / fluttercommunity/flutter_webview_plugin
unnecessary rebuilds
- Dominant language
- Java
- Stars
- 1.5k
- Forks
- 938
- PR merge metrics
- No merged PRs in 30d
Description
## System info
Issue occurs on: iOS / Android / both
Plugin version: ^0.3.10+1
Flutter doctor output:
```
[✓] Flutter (Channel unknown, v1.13.5, on Mac OS X 10.15.2 19C57, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[✓] Xcode - develop for iOS and macOS (Xcode 11.3)
[✓] Android Studio (version 3.5)
[✓] VS Code (version 1.41.1)
[✓] Connected device (1 available)
• No issues found!
```
## Steps to Reproduce
1. I notice this when my laptop gets overheated (both CPU and GPU) processing an uncomplicated single-webview (https://news.google.com) test app on Simulator.
2. Dart DevTool performance overlay also shows flutter rebuilds the page all the time every xx ms.
3. The problem is solved by switching to webview_flutter (javascriptMode: JavascriptMode.unrestricted) -- the page doesn't get rendered even when scrolling.
`import 'package:flutter_webview_plugin/flutter_webview_plugin.dart';
import 'package:flutter/material.dart';
void main() => runApp(MyApp1());
class MyApp1 extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: WebviewScaffold(
appBar: AppBar(),
url: "https://news.bing.com",
withJavascript: false,
withZoom: false,
withLocalStorage: false,
),
),
);
}
}`
## Logs
```
```
```
```
```
```
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with the minimal Dart example using WebviewScaffold and reproduce the behavior on the reported simulator setup. Use the Flutter DevTools performance overlay to inspect the repeated rebuilds and compare the result with webview_flutter; done means the unnecessary rebuild behavior is identified and resolved.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart, flutter
- Domain
- mobile
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100