essential_xlsx

Last updated:

0 purchases

essential_xlsx Image
essential_xlsx Images
Add to Cart

Description:

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

License:

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.