Skip to content

getProducts(), type 'List<dynamic>' is not a subtype of type 'FutureOr<List<Product>>' #163

Closed
@marchacio

Description

@marchacio

Hi everyone.
In my app, i have added the method "Purchases.getProducts(...)" but this throws a TypeError Exception.
VScode shows me that the corrupted file is "purchases_flutter.dart".

Today I upgraded the package to 3.0.0; before today, i used 2.0.2

My code:

Future<List<Product>> caricaDonazioni() async {
    List<Product> prodotti = await Purchases.getProducts([
      'XXXXX',
      'XXXXX',
      'XXXXX',
      'XXXXX',
      'XXXXX',
    ], type: PurchaseType.inapp);

    prodotti.sort((prod1, prod2) => prod1.price.compareTo(prod2.price));

    return prodotti;
  }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions