getUnits method

  1. @override
Future<String> getUnits(
  1. String details
)
override

Implementation

@override
Future<String> getUnits(String details) async {
  var res = await _get(
      "/orders/productinfo", {"details": details, "type": "units"});
  if (res == null) {
    return "";
  }
  Map<String, dynamic> response = jsonDecode(res.body);
  try {
    String completion = response['units'];
    if (completion == null || completion.isEmpty) {
      return "";
    }
    // print(completion);
    return completion;
  } catch (error) {
    return "";
  }
}