Last updated:
0 purchases
essential xlsx
essential_xlsx #
A library for create Excel XLSX file
dependencies:
...
essential_xlsx: any
...
copied to clipboard
example
final List<Map<String, dynamic>> data = <Map<String, dynamic>>[
{'name': 'Isaque', 'phone': '22 2777-2339', 'age': '32'},
{'name': 'Joe', 'phone': '22 2777-2339', 'age': '32'},
{'name': 'Leo', 'phone': '22 2777-2339', 'age': '32'},
{'name': 'Tiago', 'phone': '22 2777-2339', 'age': '32'},
{'name': 'Jon', 'phone': '22 2777-2339', 'age': '32'},
];
Future<void> toXLSX() async {
if (data != null) {
if (data.isNotEmpty) {
var simplexlsx = SimpleXLSX();
simplexlsx.sheetName = 'sheet';
//add data
var idx = 0;
data.forEach((item) {
if (idx == 0) {
//add titles
simplexlsx.addRow(item.keys.toList());
}
{
//add values
simplexlsx.addRow(item.values.map((i) => i.toString()).toList());
}
idx++;
});
simplexlsx.build();
}
}
}
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.