extractResult function Null safety

List<PurchaseResult>? extractResult(
  1. dynamic result
)

Implementation

List<PurchaseResult>? extractResult(dynamic result) {
  List<PurchaseResult>? decoded = json
      .decode(result.toString())
      .map<PurchaseResult>(
        (dynamic product) =>
            PurchaseResult.fromJSON(product as Map<String, dynamic>),
      )
      .toList();

  return decoded;
}