show method

Future<int?> show({
  1. required String paymentUrl,
  2. required String tmnCode,
  3. String scheme = '',
  4. bool isSandbox = true,
  5. String backAlert = 'Bạn có chắc chắn trở lại ko?',
  6. String title = 'Nạp tiền qua VNPay',
  7. String iconBackName = 'AppIcon',
  8. String beginColor = '#00B14F',
  9. String endColor = '#00B14F',
  10. String titleColor = '#FFFFFF',
})

Implementation

Future<int?> show({
  required String paymentUrl,
  required String tmnCode,
  String scheme = '',
  bool isSandbox = true,
  String backAlert = 'Bạn có chắc chắn trở lại ko?',
  String title = 'Nạp tiền qua VNPay',
  String iconBackName = 'AppIcon',
  String beginColor = '#00B14F',
  String endColor = '#00B14F',
  String titleColor = '#FFFFFF',
}) async {

  final params = <String, dynamic>{
    "scheme": scheme,
    "isSandbox": isSandbox,
    "paymentUrl": paymentUrl,
    "tmn_code": tmnCode,
    "backAlert": backAlert,
    "title": title,
    "iconBackName": iconBackName,
    "beginColor": beginColor,
    "endColor": endColor,
    "titleColor": titleColor,
  };
  await _channel.invokeMethod('show', params);
  await for (MethodCall m in _methodStream) {
    if (m.method == "PaymentBack") {
      return m.arguments['resultCode'] as int?;
    }
  }
}