doubleToBytes static method

List<int> doubleToBytes(
  1. double value, {
  2. bool littleEndian = true,
})

Implementation

static List<int> doubleToBytes(double value, {bool littleEndian = true}) {
  var buffer = ByteData(8);
  buffer.setFloat64(0, value, littleEndian ? Endian.little : Endian.big);
  return buffer.buffer.asUint8List();
}