Here are minor improvements that don't warrant their own Github issue, but that would make this package align more with the rest of the Dart ecosystem.
Please don't waste your time on these, the other issues are way more important.
Hide constructor
Chargebee() shouldn't be accessible, since everything is static anyway.
You can hide the constructor via
class Chargebee {
Chargebee._();
...
Override toString() to make objects easily loggable:
final result = await Chargebee.purchaseProduct(...);
print(result);
logToCrashlytics(result.toString());
Use named parameters for the methods:
await Chargebee.configure("...", "...", "...", "..."); // <-- which of these is the android sdk key?
await configure(
site: "...",
apiKey: "...",
androidSdkKey: "...", // <-- this can be removed without potentially passing null in a random place in the arglist
iosSdkKey: "...",
);
PurchaseResult.status should be an enum:
Yes, you can google and search for valid values in the website documentation, but its faster to have your code editor autocomplete everything or at least spit out the inline documentation (which is also missing: #37).
Here are minor improvements that don't warrant their own Github issue, but that would make this package align more with the rest of the Dart ecosystem.
Please don't waste your time on these, the other issues are way more important.
Hide constructor
Chargebee()
shouldn't be accessible, since everything is static anyway. You can hide the constructor viaOverride toString() to make objects easily loggable:
Use named parameters for the methods:
PurchaseResult.status should be an enum:
Yes, you can google and search for valid values in the website documentation, but its faster to have your code editor autocomplete everything or at least spit out the inline documentation (which is also missing: #37).