saveAndLaunchFile static method

Future<void> saveAndLaunchFile(
  1. List<int> bytes,
  2. String fileName
)

To save the Excel file in the device

Implementation

static Future<void> saveAndLaunchFile(
    List<int> bytes, String fileName) async {
  AnchorElement(
      href:
      'data:application/octet-stream;charset=utf-16le;base64,${base64.encode(bytes)}')
    ..setAttribute('download', fileName)
    ..click();
}