A Flutter Plugin that enables UPI Intent App transactions in Juspay's Paymentpage inside the Flutter webview widget.
Add flutter plugin dependency in pubspec.yaml.
Get dependency from pub.dev
Import hyper_webview_flutter package in your dart file where WebViewController is being instanciated.
import 'package:hyper_webview_flutter/hyper_webview_flutter.dart';Instantiate a HyperWebviewFlutter object provided by this plugin.
HyperWebviewFlutter hyperWebviewFlutterPlugin = HyperWebviewFlutter();Provide the webview Controller to the attach() function of the HyperWebviewFlutter object.
class _WebviewPaymentPageState extends State<WebviewPaymentPage> {
late WebViewController _controller;
@override
void initState() {
var url = Uri.parse(widget.url);
_controller = WebViewController()
..setJavaScriptMode(JavaScriptMode.unrestricted)
..loadRequest(url);
widget.hyperWebviewFlutterPlugin.attach(_controller);
super.initState();
}
}Utilize this controller to render the PaymentPage within the WebView.
hyper_webview_flutter is distributed under AGPL-3.0-only license.