-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
I am struggling a lot to launch share link in flutter_inappwebview plugin #359
Comments
@pichillilorenzo can you please suggest something |
You are not returning the right value to the For example, using your example, you can simply return import 'dart:async';
import 'package:flutter/material.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'package:url_launcher/url_launcher.dart';
Future main() async {
runApp(new MyApp());
}
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => new _MyAppState();
}
class _MyAppState extends State<MyApp> {
InAppWebViewController webView;
String url = "";
double progress = 0;
@override
void initState() {
super.initState();
}
@override
void dispose() {
super.dispose();
}
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: SafeArea(
child: Container(
child: Column(children: <Widget>[
Expanded(
child: Container(
child: InAppWebView(
initialUrl: "https://www.onestare.com/",
shouldOverrideUrlLoading:
(InAppWebViewController controller,
ShouldOverrideUrlLoadingRequest
shouldOverrideUrlLoadingRequest) {
print("****"+shouldOverrideUrlLoadingRequest.url);
_launchURL(shouldOverrideUrlLoadingRequest.url);
return ShouldOverrideUrlLoadingAction.ALLOW;
},
initialOptions: InAppWebViewGroupOptions(
crossPlatform: InAppWebViewOptions(
useShouldOverrideUrlLoading: true,
debuggingEnabled: true,
),
),
onWebViewCreated: (InAppWebViewController controller) {
webView = controller;
},
onLoadStart:
(InAppWebViewController controller, String url) {},
onLoadStop:
(InAppWebViewController controller, String url) {},
),
),
),
]),
),
),
),
);
}
}
_launchURL(String url) async {
if (await canLaunch(url)) {
await launch(url);
} else {
throw 'Could not launch $url';
}
} |
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug and a minimal reproduction of the issue. |
Environment
Flutter version: 1.17.1
Plugin version: flutter_inappwebview 3.2.0
Android Version: 10
Description
I am trying to convert a website into webview it has two share links
It is working perfectly in mobile version chrome browser but using flutter_inappwebview and url_launcher that functionality is not working. Can you please suggest. I am attaching code gist
https://gist.github.com/Rupak-66/73778886f95561132ed5d7943854dbd0
The text was updated successfully, but these errors were encountered: