getBestMatchDartType method
Type
getBestMatchDartType(
- int columnLength
)
Implementation
Type getBestMatchDartType(int columnLength) {
switch (_value) {
case mysqlColumnTypeString:
case mysqlColumnTypeVarString:
case mysqlColumnTypeVarChar:
case mysqlColumnTypeEnum:
case mysqlColumnTypeSet:
case mysqlColumnTypeLongBlob:
case mysqlColumnTypeMediumBlob:
case mysqlColumnTypeBlob:
case mysqlColumnTypeTinyBlob:
case mysqlColumnTypeGeometry:
case mysqlColumnTypeBit:
case mysqlColumnTypeDecimal:
case mysqlColumnTypeNewDecimal:
return String;
case mysqlColumnTypeTiny:
if (columnLength == 1) {
return bool;
} else {
return int;
}
case mysqlColumnTypeShort:
case mysqlColumnTypeLong:
case mysqlColumnTypeLongLong:
case mysqlColumnTypeInt24:
return int;
case mysqlColumnTypeFloat:
case mysqlColumnTypeDouble:
return double;
default:
return String;
}
}