ProductApi constructor

ProductApi({
  1. ProductRepository? repository,
})

Implementation

factory ProductApi({ProductRepository? repository}) {
  final repo = repository ?? ProductRepositoryImpl(ProductGatewayImplementation(DioClient()));

  return ProductApi._(
    GetAllProducts(repo),
    GetProductById(repo),
    DeleteProduct(repo),
    UpdateProduct(repo),
    AddProduct(repo),
  );
}