renderWidget method

Future renderWidget({
  1. required String renderScript,
})

Implementation

Future<dynamic> renderWidget({
  required String renderScript,
}) async {
  final osVersion = await getOSVersion();
  addJavascriptChannels(widgetJavascriptChannels);
  return evaluateJavascriptFuture('''
    var paymentWidget = PaymentWidget(
      '${widget._paymentWidget.clientKey}',
      '${widget._paymentWidget.customerKey}',
      {'brandpay':{'redirectUrl':'${redirectUrl ?? ''}'},
      'service': 'payment-widget-flutter',
      'environment': {
        'platform' : '${Platform.isAndroid ? 'android' : 'ios'}',
        'sdkVersion' : '$sdkPackageVersion',
        'osVersion' : '$osVersion'
      }
    });
    $renderScript
  ''', 'widgetStatus');
}