toStringList static method

List<String> toStringList(
  1. List<PaystackChannel> channels
)

Converts a list of PaystackChannel values to the string list expected by the Paystack API.

Example:

PaystackChannel.toStringList([PaystackChannel.card, PaystackChannel.mobileMoney])
// => ["card", "mobile_money"]

Implementation

static List<String> toStringList(List<PaystackChannel> channels) {
  return channels.map((c) => c.value).toList();
}