A Flutter Plugin that enables merchants to open Juspay's Paymentpage inside the webview widget.
- Begin by including the Hyper SDK WebView Flutter plugin in your project's pubspec.yaml file. Obtain the necessary dependency here
- Instantiate a HyperWebviewFlutter object provided by this plugin.
- 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 = HyperWebviewFlutter();
widget._hyperWebviewFlutterPlugin.attach(_controller);
super.initState();
}
- Utilize this controller to render the PaymentPage within the WebView.