Skip to content

WebView very slow when scrolling #106190

@urusaich

Description

@urusaich

Hello! I am trying to use external map in my app through webview, but scrolling actions causing a performance problems.
Pay attention: when i tap on zoom in/out buttons there is no performance drops.
In external browser this html works fine without critical performance issues

flutter doctor

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.0.2, on Microsoft Windows [Version 10.0.19044.1766], locale
ru-RU)
[√] Android toolchain - develop for Android devices (Android SDK version 32.1.0-rc1)
[X] Chrome - develop for the web (Cannot find Chrome executable at
.\Google\Chrome\Application\chrome.exe)
! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[X] Visual Studio - develop for Windows
X Visual Studio not installed; this is necessary for Windows development.
Download at https://visualstudio.microsoft.com/downloads/.
Please install the "Desktop development with C++" workload, including all of its default
components
[√] Android Studio (version 2021.2)
[√] IntelliJ IDEA Community Edition (version 2022.1)
[√] VS Code (version 1.68.1)
[√] Connected device (3 available)
[√] HTTP Host Availability

! Doctor found issues in 2 categories.

code
import 'package:flutter/material.dart';
import 'package:webview_flutter/webview_flutter.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
    WebView.platform = SurfaceAndroidWebView();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: const WebView(
          initialUrl: 'http://192.168.0.100:8080/index.html',
        ),
      ),
    );
  }
}
video
video_2022-06-17_15-18-43.mp4

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listc: performanceRelates to speed or footprint issues (see "perf:" labels)found in release: 3.0Found to occur in 3.0found in release: 3.1Found to occur in 3.1has reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: webviewThe WebView pluginpackageflutter/packages repository. See also p: labels.platform-androidAndroid applications specificallyteam-androidOwned by Android platform teamtriaged-androidTriaged by Android platform team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions