open method

  1. @override
Future<Workbook> open()
override

Implementation

@override
Future<Workbook> open() async {
  if (!File(path).existsSync()) {
    Show.error("File $path not found");
    throw Exception("File $path not found");
  }
  Show.action("OPENING", "EXCEL FILE", path);
  final stream = File(path).readAsBytesSync();
  final excel = Excel.decodeBytes(stream);
  return Workbook(excel);
}