fromBytes static method
Converts bytes to a double value.
bytes: The bytes to decode. Must be exactly 8 bytes.byteOrder(optional): The byte order for decoding. Defaults to big endian.
Implementation
static double fromBytes(List<int> bytes, {Endian byteOrder = Endian.big}) {
if (bytes.length != 8) {
throw CoreErrors.invalidOperationArguments(
"fromBytes",
name: "bytes",
reason: "Double requires exactly 8 bytes.",
);
}
final ByteData byteData = ByteData.sublistView(Uint8List.fromList(bytes));
return byteData.getFloat64(0, byteOrder);
}