这是indexloc提供的服务,不要输入任何密码
Skip to content

[WebView]Android devices cannot show the popup menu as iOS does #62547

@jims57

Description

@jims57

Is it a bug, I can't make the Android device shows the Popup Menu by either Double Tap or Long Press.

flutter --version Flutter 1.21.0-6.0.pre.42 • channel master • https://github.com/flutter/flutter.git Framework • revision 8c5c720 (2 days ago) • 2020-07-28 01:07:42 -0700 Engine • revision f27729e Tools • Dart 2.10.0 (build 2.10.0-0.0.dev 24c7666def)

====Sample code as follows====

import 'dart:async';

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

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: ParentWidget(),
    );
  }
}

class ParentWidget extends StatefulWidget {
  @override
  State<StatefulWidget> createState() => ParentWidgetState();
}

class ParentWidgetState extends State<ParentWidget> {
  final Completer<WebViewController> _webViewController =
  Completer<WebViewController>();

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Welcome to Flutter'),
      ),
      body: WebView(
        initialUrl: 'https://www.xiaoe-tech.com',
        javascriptMode: JavascriptMode.unrestricted,
        onWebViewCreated: (webViewController) {
          _webViewController.complete(webViewController);
        },
      ),
      floatingActionButton: FutureBuilder<WebViewController>(
        future: _webViewController.future,
        builder: (ctx, webViewController) {
          if (webViewController.hasData) {
            return FloatingActionButton(
              child: Icon(Icons.add),
              onPressed: () {
                webViewController.data.loadUrl('http://www.baidu.com');
              },
            );
          }

          return Container();
        },
      ),
    );
  }
}

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    a: platform-viewsEmbedding Android/iOS views in Flutter appsf: gesturesflutter/packages/flutter/gestures repository.found in release: 1.17Found to occur in 1.17found in release: 1.21Found to occur in 1.21has reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: webviewThe WebView pluginp: webview-keyboardKeyboard issues with flutter_webview pluginpackageflutter/packages repository. See also p: labels.platform-androidAndroid applications specificallyplatform-views: vdIssues specific to the Android VirtualDisplay platform views backend

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions