Search packages, repositories and app categories

Package detailsv0.0.8

firebase_excel_export

A Flutter package to export Firestore collections to Excel with customizable headers and data mapping.

AndroidiOSmacOSWindows
30-day downloads
71
Likes
6
Pub points
145

Install package

flutter pub add firebase_excel_export

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

A Flutter package that enables exporting data from Firestore collections to Excel files (XLSX, ODS) with support for custom headers and flexible data mapping. It simplifies data sharing and reporting by transforming structured Firestore documents into spreadsheet formats compatible with common office tools. The package integrates seamlessly into Flutter apps targeting Android, iOS, macOS, and Windows, making it ideal for applications requiring offline data export or administrative reporting features.

Use cases

  • Exporting user data to Excel
  • Generating reports from Firestore collections
  • Creating downloadable analytics sheets
  • Synchronizing app data with external spreadsheets
  • Automating data exports for business workflows

Key features

  • Customizable column headers
  • Flexible data field mapping
  • Support for XLSX and ODS formats
  • Cross-platform compatibility
  • Simple integration with Firestore queries

Suitable for

  • Admin dashboards
  • Data migration tools
  • Business intelligence apps
  • Reporting features in Flutter apps
  • Teams needing offline data access

Considerations

  • Requires Firebase Firestore setup
  • Limited to document-level export
  • No real-time sync with Excel files
  • Manual export triggers needed
  • File size may grow with large datasets

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

Firebase Excel Export

A Flutter package to export Firestore collections to Excel with a simple and customizable approach. Perfect for Flutter web applications!

Features

  • Export Firestore data directly to .xlsx files.
  • Fully customizable headers and data mapping.
  • Easy integration with Firestore.
  • Designed for Flutter web applications with seamless file download functionality.

Installation

Add the package to your pubspec.yaml file:

dependencies:
  firebase_excel_export: ^0.0.1

Run the following command to fetch the package:

flutter pub get

Usage

Basic Example
import 'package:firebase_excel_export/firebase_excel_export.dart';

Future<void> exportUsers() async {
  await FirebaseExcelExporter.exportToExcel(
    collectionName: 'users',
    headers: ['Email', 'Name', 'Phone Number'], // Customize your headers
    mapper: (data) => [
      data['email'],       // Map Firestore fields to the headers
      data['name'],
      data['phoneNumber'],
    ],
    fileName: 'users_export.xlsx', // Optional: Customize file name
  );
}
Parameters
  • collectionName (required): The Firestore collection to export.
  • headers (required): A list of custom headers for the Excel file.
  • mapper (required): A function to map Firestore document fields to header columns.
  • fileName (optional): The desired file name for the Excel file (default: export.xlsx).
Advanced Example with Query Filtering
Future<void> exportFilteredUsers() async {
  await FirebaseExcelExporter.exportToExcel(
    collectionName: 'users',
    headers: ['Email', 'Name', 'Status'], // Define custom headers
    mapper: (data) => [
      data['email'],       // Map data fields dynamically
      data['name'],
      data['status'],
    ],
    queryBuilder: (query) => query.where('status', isEqualTo: 'active'), // Apply Firestore query
    fileName: 'active_users_export.xlsx', // Define a custom file name
  );
}

Key Features

  1. Dynamic Headers: Define custom headers tailored to your Firestore data.
  2. Data Mapping: Map fields dynamically to headers for total flexibility.
  3. Web-Optimized: Built for Flutter web to enable seamless downloads.

Compatibility

This package is designed for Flutter web and depends on:

  • cloud_firestore
  • firebase_core
  • excel
  • universal_html

Ensure these dependencies are added to your pubspec.yaml.

Support

If you encounter any issues or have feature requests, feel free to open an issue on the GitHub repository.

License

This package is licensed under the MIT License. See the LICENSE file for more details.

Categories

Dependencies

Dependency list 6 items

Source repository

Projects using this package

No data available yet.