getName method

String getName(
  1. AppLocalizations appLocalizations
)

Implementation

String getName(AppLocalizations appLocalizations) {
  if (_categoryName != null) {
    return _categoryName;
  }
  if (_product != null) {
    return getProductNameAndBrands(_product!, appLocalizations);
  }
  if (_priceProduct != null) {
    return _priceProduct.name ?? _priceProduct.code;
  }
  if (barcode.isEmpty) {
    return appLocalizations.prices_barcode_search_none_yet;
  }
  if (_loading) {
    return appLocalizations.prices_barcode_search_running(barcode);
  }
  return appLocalizations.prices_barcode_search_not_found;
}