from static method
from method to get the OsrmAlternative from a dynamic value
Implementation
static OsrmAlternative from(dynamic alternative) {
if (alternative is bool) {
return alternative ? OsrmAlternative.true_ : OsrmAlternative.false_;
} else if (alternative is num) {
return OsrmAlternative.number(alternative.toInt());
} else {
throw ArgumentError('Invalid alternative: $alternative');
}
}