formatProductBrands function
Correctly format word separators between words.
Implementation
String formatProductBrands(String brands, {String separator = ', '}) {
final String separatorChar = RegExp.escape(',');
final RegExp regex = RegExp('\\s*$separatorChar\\s*');
return brands.replaceAll(regex, separator);
}