搜尋套件、儲存庫與 APP 分類

套件詳情v0.0.8

firebase_excel_export

一個 Flutter 套件,可將 Firestore 集合匯出為 Excel 檔案,支援自訂標題與資料對應。

AndroidiOSmacOSWindows
近 30 天下載
57
喜歡數
6
Pub 分數
145

安裝套件

flutter pub add firebase_excel_export

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

一個 Flutter 套件,可將 Firestore 集合中的資料匯出為 Excel 檔案(XLSX、ODS),支援自訂標題與彈性資料對應。它透過將結構化 Firestore 文件轉換為與常見辦公工具相容的試算表格式,簡化資料分享與報表製作。此套件可無縫整合至針對 Android、iOS、macOS 及 Windows 開發的 Flutter 應用程式中,非常適合需要離線資料匯出或管理報表功能的應用。

適用情境

  • 將用戶數據匯出到Excel
  • 從 Firestore 集合產生報告
  • 建立可下載的分析表
  • 將應用程式資料與外部電子試算表同步
  • 自動化業務工作流程中的資料匯出

主要特色

  • 可自訂的欄位標題
  • 靈活的資料欄位對應
  • 支援 XLSX 和 ODS 格式
  • 跨平台相容性
  • 與 Firestore 查詢的簡單整合

適合對象

  • 管理員儀表板
  • 資料遷移工具
  • 商業智慧應用
  • Flutter 應用中的報告功能
  • 需要離線資料存取的團隊

使用建議

  • 需要 Firebase Firestore 設定
  • 僅限文件層級匯出
  • 與 Excel 檔案無即時同步
  • 需要手動匯出觸發
  • 檔案大小可能隨著大資料集的增長而增加

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

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.

所屬分類

依賴

原始碼儲存庫

使用此套件的專案

暫無相關資料。