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

This plugin isn't working in flutter web. After launching the webview the spinner keeps on spinning with no errors. #668

Open
simmi9 opened this issue Feb 24, 2020 · 10 comments

Comments

@simmi9
Copy link

simmi9 commented Feb 24, 2020

import 'package:flutter/material.dart';
import 'package:flutter_webview_plugin/flutter_webview_plugin.dart';

String url = "https://google.com/";

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

class MyApp extends StatelessWidget {
@OverRide
Widget build(BuildContext context) {
return MaterialApp(
title: 'Webview Example',
theme: ThemeData.dark(),
routes: {
"/": () => Home(),
"/webview": (
) => WebviewScaffold(
url: url,
appBar: AppBar(
title: Text("WebView"),
),
withJavascript: true,
withLocalStorage: true,
withZoom: true,
)
},
);
}
}

class Home extends StatefulWidget {
@OverRide
HomeState createState() => HomeState();
}

class HomeState extends State {
final webView = FlutterWebviewPlugin();
TextEditingController controller = TextEditingController(text: url);

@OverRide
void initState() {
super.initState();

webView.close();
controller.addListener(() {
  url = controller.text;
});

}

@OverRide
void dispose() {
webView.dispose();
controller.dispose();
super.dispose();
}

@OverRide
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("WebView"),
),
body: Center(
child: Column(
children: [
Container(
padding: EdgeInsets.all(10.0),
child: TextField(
controller: controller,
),
),
RaisedButton(
child: Text("Open Webview"),
onPressed: () {
Navigator.of(context).pushNamed("/webview");
},
)
],
),
));
}
}

@shashwatadi
Copy link

Same problem :(

@dazza5000
Copy link

dazza5000 commented Mar 2, 2020

Same issue here.

These are the exceptions I get in the developer console:

Overflow on channel: flutter_webview_plugin. Messages on this channel are being discarded in FIFO fashion. The engine may not be running or you need to adjust the buffer size if of the channel.

errors.dart:147 Uncaught (in promise) Error: MissingPluginException(No implementation found for method launch on channel flutter_webview_plugin) at Object.throw_ [as throw] (errors.dart:196) at MethodChannel._invokeMethod (platform_channel.dart:154) at _invokeMethod.next (<anonymous>) at onValue (async_patch.dart:47) at _RootZone.runUnary (zone.dart:1381) at _FutureListener.thenAwait.handleValue (future_impl.dart:140) at handleValueCallback (future_impl.dart:682) at Function._propagateToListeners (future_impl.dart:711) at _Future.new.[_completeWithValue] (future_impl.dart:526) at async._AsyncCallbackEntry.new.callback (future_impl.dart:556) at Object._microtaskLoop (schedule_microtask.dart:43) at _startMicrotaskLoop (schedule_microtask.dart:52) at async_patch.dart:168

@dazza5000
Copy link

I switched to use an alternative approach and now just launch a new tab using url_launcher on web.

@shashwatadi
Copy link

My use case is to provide additional features on top of the web view, so this alternative approach doesn't work for me @dazza5000. If anybody figures out any other way, I'll be obliged :)

@villematti
Copy link

I build my own small plugin what implements this and on start it checks kIsWeb constant (comes from Flutter) and if its false, I use this plugin. However if it's true, I'm on Flutter Web and I can build some other way to manage what I'm trying to do.

From what I gather, web isn't implemented. Web required registerWith function for a plugin.

I think this really is a missing feature...however, this creates a webview for Android and iOS. What would that actually be on a browser? Iframe? Container with HTML content inside it?

Would be handy to have something like this implemented. Works very well for OAUTH2 login for example.

@dazza5000
Copy link

I think iframeelement might be an acceptable web approach

@achamorro-dev
Copy link

Hi guys!

I'm really interested to help on this. @villematti do you have any update about your work?

@villematti
Copy link

@ach4m0 Nothing progressive really. I ended up using that kIsWeb variable and that does work well enough in my current project.

I'm planing on getting back to this when I have more time.

@anastasiyakisel
Copy link

Hi , I need this to be fixed also. Stucked. PLEASE HELP, PLEASE FIX THIS .........thank You

@jonaird
Copy link

jonaird commented Apr 4, 2020

Hi , I need this to be fixed also. Stucked. PLEASE HELP, PLEASE FIX THIS .........thank You

For now you can use this plugin. However, there are some issues with iframes being rerendered (see #53253 ) but there is a partial fix that is under review.

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

No branches or pull requests

7 participants