getProducts static method

Future<ProductsResponse> getProducts()

Fetches all the products created on appmate server. If sandbox parameter value is false, non-synched products will not be fetched.

If a previous successful fetch exists in last 10 minutes, it fetches the products from local cache.

So you will be able to get the response faster than getting directly from the network. Otherwise, it will launch a network request.

Callbacks ProductsResponse and GenericError in case of failure.

Implementation

static Future<ProductsResponse> getProducts() async {
  final List<Object?>? response = await _channel.invokeMethod('getProducts');
  return _getProductsFromResponse(response);
}