this is a breaking change. Projects will have to prepend each frontend call to startPayment() with "await" therefore this is only a suggestion for MAJOR version change (2.0.0)
The original /lib/payhere_mobilesdk_flutter.dart imports dart:async but does not use it.
This is because_channel.invokeMethod("startPayment", paymentObject).then(( ) { }) makes the method channel invocation synchronous.
this is why startPayment() can be called from /example/lib/main.dart without "await" keyword.
This actually is 100% correct way to do it, no rules are broken.
But async/await is more in line with dart convention.
this is a breaking change. Projects will have to prepend each frontend call to startPayment() with "await" therefore this is only a suggestion for MAJOR version change (2.0.0)
The original /lib/payhere_mobilesdk_flutter.dart imports dart:async but does not use it.
This is because
_channel.invokeMethod("startPayment", paymentObject).then(( ) { })
makes the method channel invocation synchronous.this is why startPayment() can be called from /example/lib/main.dart without "await" keyword.
This actually is 100% correct way to do it, no rules are broken.
But async/await is more in line with dart convention.