calculationOnIntegerValue function
dynamic
calculationOnIntegerValue(})
Implementation
dynamic calculationOnIntegerValue(
double lhs,
double rhs, {
bool add = false,
bool subtract = false,
bool multiply = false,
bool divide = false,
}) {
if (add == true &&
subtract == false &&
multiply == false &&
divide == false) {
return lhs + rhs;
}
if (subtract == true &&
add == false &&
multiply == false &&
divide == false) {
return lhs - rhs;
}
if (multiply == true &&
add == false &&
divide == false &&
subtract == false) {
return lhs * rhs;
}
if (divide == true &&
add == false &&
subtract == false &&
multiply == false) {
return lhs / rhs;
} else {
throw Exception(
'"Select operation and Dont give two or more operation at the same time"');
}
}