In my app , I want to open in-app web view instead of browsing external youtube link using url launcher. What should I do? Or Should I use in-app web view plugin instead?
This is my code.
if (await canLaunchUrl(uri)) {
try {
await launchUrl(uri, mode: LaunchMode.inAppWebView);
return true;
} on PlatformException catch (e) {
// cannot launch url
return false;
}
} else {
return false;
}
you can open web views within your application using webview_flutter. Check it out on pub.dev -> https://pub.dev/packages/webview_flutter.
Here's an example:
To implement this in your code:
Supporting documentation at https://codelabs.developers.google.com/codelabs/flutter-webview
Note: If your main focus is only video playback, I recommend using the "youtube_player_flutter" library, pub.dev -> https://pub.dev/packages/youtube_player_flutter
I hope this can help you.