getTypeLength method

dynamic getTypeLength(
  1. dynamic type
)

Implementation

getTypeLength(type) {
  var vecType = this.getVectorType(type);
  var vecNum = RegExp(r"vec([2-4])").firstMatch(vecType);

  if (vecNum != null) return num.parse(vecNum.group(1)!);
  if (vecType == 'float' || vecType == 'bool') return 1;

  return 0;
}