show method
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',
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?;
}
}
}