type 'int' is not a subtype of type 'double'
static double checkDouble(dynamic value) {
if (value is String) {
return double.parse(value);
} else {
return value;
}
}
}
The problem seems from the last return value
. You may need return value+.0
.
You only need to add .toDouble() function to last returned value.
static double checkDouble(dynamic value) {
if (value is String) {
return double.parse(value);
} else {
return value.toDouble();
}
}
}
An idea would be to use num
instead of int
or double
in this case.