to_csv
6.0.1, released a year ago by launchcode.shop
Create and download CSV or Excel files from lists of data with ease.
What it does
Allows developers to generate and download or share CSV and Excel files directly from lists of strings. Supports headers, custom file names, removing duplicate values, empty rows configuration, and data transposition.
AI-written summary of version 6.0.1, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to export tabular data to a CSV or Excel file in a Flutter application.
- You want a simple API to download or share formatted text-based tables on Android, iOS, Windows, macOS, and Linux.
Skip it when
- You need advanced Excel formatting, cell styling, formulas, or multiple sheets.
- You are working in a pure Dart backend environment without Flutter dependencies.
Strengths
- Easy to use with minimal code setup.
- Supports cross-platform file saving and sharing.
- Includes configuration options for empty rows, duplicate removal, and transposition.
Weaknesses
- Limited strictly to string-based lists as input.
- License is unknown.
- iOS configuration requires manual edits to Info.plist.
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 8
For iOS, you must add file sharing keys (LSSupportsOpeningDocumentsInPlace and UIFileSharingEnabled) to info.plist or through Xcode.
import 'package:to_csv/to_csv.dart' as exportCSV;
List<String> header = ['No.', 'User Name', 'Mobile', 'ID Number'];
List<List<String>> listOfLists = [
['1', 'Bilal Saeed', '1374934', '912839812'],
['2', 'Ahmar', '21341234', '192834821']
];
exportCSV.myCSV(header, listOfLists);Alternatives
Packages that do the same job and could replace to_csv.
- excel_plus
Fast, low-memory library for reading, creating, editing, and styling Excel files.
84Compare - excel_community
Community fork of the excel library to read, create, and edit XLSX and XLS files.
82Compare - file_selector_macos
macOS implementation of the file_selector plugin
82Compare - pdf
A PDF generation library for Dart and Flutter using a widget-like layout system.
89Compare
Works with
Packages commonly used together with to_csv: ones it builds on, ones built on it, and its own family.
- intlto_csv depends on itA Dart library for internationalization and localization, providing message translation, plural/gender handling, and date/number formatting.
- flutter_lintsto_csv depends on itProvides the recommended set of Flutter lint rules for static analysis.
- path_providerto_csv depends on itProvides Flutter APIs to locate common filesystem directories on Android, iOS, macOS, Linux and Windows.
- share_plusto_csv depends on itShare text, files, or URIs via native share dialogs on mobile, web, and desktop.
- csvto_csv depends on itParse and generate CSV strings with stream support and Excel compatibility.
- universal_htmlto_csv depends on itCross‑platform replacement for dart:html with DOM parsing, XML support, and EventSource.
- file_saverto_csv depends on itSave files from bytes, paths, streams, and URLs across Android, iOS, Web, Windows, macOS, and Linux.