walletUpgradesFromJson static method
Creates a list of WalletUpgrade instances from a JSON array.
Parameters:
walletUpgrades
– An iterable of dynamic objects representing a JSON array of WalletUpgrade objects.
Returns a list of WalletUpgrade instances.
Implementation
static List<WalletUpgrade> walletUpgradesFromJson(
Iterable<dynamic> walletUpgrades,
) =>
List.from(walletUpgrades).fold<List<WalletUpgrade>>(
[],
(previousValue, action) {
try {
return [
...previousValue,
WalletUpgrade.fromJson(action),
];
} catch (e) {
return previousValue;
}
},
);