list_to_csv_excel
-> This flutter package to create a csv and excel file for your data in flutter applications and web apps. -> You can create and download a csv and excel file with much less code. Do not forget to like the package...
How to use
Make sure to check out examples for more details.
Getting started
- Add the latest version of package to your
pubspec.yaml
dependencies:
list_to_csv_excel: ^1.0.0
or
- Add the latest version of package via command
flutter pub add list_to_csv_excel
flutter pub get
- Import the package and use it in your Flutter App
import 'package:list_to_csv_excel/list_to_csv_excel.dart';
- Create a Header Data of your table or excel file.
List<String> header = ["Id", "Email", "Password"];
- Also create a two lists which contains your list of rows as List.
List<List<String>> listOfRowData = [];
listOfRowData = ["1", "admin@gmail.com", "123456789"];
listOfRowData = ["2", "admin1@gmail.com", "admin"];
- Finally pass header and listOfRowData to the package function like this:
await CsvFileCreate().csvFileCreate(header, body);
And your csv file will be downloaded in seconds. Open it on excel or in any other app and Enjoy.