isPrimitiveType<T extends Object> method
Checks if a type is a primitive type
Primitive types include String, int, num, double, and bool
Implementation
bool isPrimitiveType<T extends Object>() {
return [
String,
int,
num,
double,
bool,
].contains(T);
}