essential_xlsx 1.0.0

Dart js
Flutter web

A library for create Excel XLSX file

essential_xlsx #

A library for create Excel XLSX file

dependencies:
    ...
    essential_xlsx: any
    ...

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();
      }
    }
  }
5
likes
60
pub points
65%
popularity

A library for create Excel XLSX file

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

insinfo2008@gmail.com

License

GPL 3.0 (LICENSE)

Dependencies

archive, xml

More

Packages that depend on essential_xlsx