valueAsDouble<T extends double?> method
T
valueAsDouble<T extends double?>(})
Reads key and coerces it to a double.
Implementation
T valueAsDouble<T extends double?>(
K key, {
T Function(BuError err)? onError,
T Function()? onMissing,
/// Only applicable when [K] is `String`.
bool normalizeKeyLookup = false,
}) {
try {
final value = _checkItem<T>(key, onMissing, normalizeKeyLookup);
if (value == null) return value as T;
return JsonParser.valueAsDouble<T>(value);
} on BuError catch (e) {
if (onError != null) return onError(e);
throw CoreErrors.jsonErrorWithKey(e, key);
}
}