Dart language has a type called 'dynamic'. As you can guess from it's name, it can be any type of variable. This can be a bit tricky when using it, because TypeError can be thrown.
void main() {
dynamic something;
if(something is String){
print(something.length); //auto complete & no compile error
}
}
Above code shows a simple way to avoid the problem. Also, the compiler and intellisense will know what kind of type it is inside the 'if' statement, making us easier to handle the variable.