getDetails method

Future<List<ProductModel>?> getDetails()

Implementation

Future<List<ProductModel>?> getDetails() async {
  final webserviceHelper = WebserviceHelper(endPointType: Endpoint.posts, path: []);
  final map = await webserviceHelper.postNormal();
  final List<ProductModel> products = (map['data'] as List<dynamic>)
      .map((e) => ProductModel.fromJson(e as Map<String, dynamic>))
      .toList();
  Utils.debugLog(title: "getDetails", object: "${map['data'].runtimeType}");
  return products;
}