fluttercommunity / fluttercommunity/flutter_webview_plugin

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

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

Description

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");
},
)
],
),
));
}
}

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reproducing the sample with Flutter Web using FlutterWebviewPlugin and WebviewScaffold, then inspect the plugin's webview launch path and its web-platform support. Done means the webview loads the requested URL instead of leaving the spinner running, with an actionable failure if the platform is unsupported.

Written by the indexing model from the issue text.

Assessment

Tech stack
dart, flutter
Domain
mobile-dev, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.