var _appExcel = Excel.createExcel();
Excel get appExcel => _appExcel;
addData() {
var sheetObject = _appExcel['Sheet1'];
List<String> dataList = [
"Google",
"loves",
"Flutter",
"and",
"Flutter",
"loves",
"Google"
];
sheetObject.insertRowIterables(dataList, 0);
print(sheetObject.rows);
print(appExcel.sheets);
print(appExcel.tables['Sheet1']!.rows);
// appExcel.encode().then((onValue) {
// File(join('C:/Users/user/Desktop/hh.xlsx'))
// ..createSync(recursive: true)
// ..writeAsBytesSync(onValue);
// });
}
saveData(String filePath) {
print(appExcel.sheets);
print(appExcel.tables['Sheet1']!.rows);
appExcel.encode().then((onValue) {
File(join(filePath))
..createSync(recursive: true)
..writeAsBytesSync(onValue);
});
}