For example i have declared two varaibles
var latitude;
var longitude;
**Now i want to check whether latitude or longitude or both hold double value or they are null **
For example i have declared two varaibles
var latitude;
var longitude;
**Now i want to check whether latitude or longitude or both hold double value or they are null **
First, stop making your own life harder than it has to be, use the proper types:
double? latitude;
double? longitude;
if(latitude == null)
{
// ...
}
if(longitude == null)
{
// ...
}
If you want to check if a value is null, you can simply do:
if (latitude === null) {
}
To check runtime types (e.g. checking if a variable is a double), one can use:
latitude.runtimeType