sheetifye 1.1.0 copy "sheetifye: ^1.1.0" to clipboard
sheetifye: ^1.1.0 copied to clipboard

Flutter spreadsheet engine with XLSX/CSV support, live editing, undo/redo, formula evaluation, clipboard, autofill, and a full persistence lifecycle.

Sheetifye #

The Native Flutter Spreadsheet Engine โ€” View, Edit, and Persist #

Pub Version License Flutter Tests Issues


Sheetifye is a production-grade Flutter spreadsheet widget with native XLSX & CSV support, a live formula engine, full cell editing, undo/redo, clipboard, autofill, and a complete persistence lifecycle โ€” all rendered directly on the Flutter canvas with no WebView or PlatformView.

Sheetifye โ€” Native Flutter Spreadsheet Engine
Spreadsheet Editor on iOS
๐Ÿ“ฑ iOS
Excel Viewer on Android
๐Ÿค– Android
Flutter Spreadsheet on Web and Desktop
๐ŸŒ Web / Desktop

๐Ÿ“– Docs  ยท  ๐Ÿ’ก Example  ยท  ๐Ÿ“‹ Changelog  ยท  ๐Ÿ› Issues


โœจ What's New in v1.1.0 #

Sheetifye has evolved from a viewer into a full spreadsheet editing platform:

  • ๐Ÿ–Š๏ธ Cell Editing โ€” Inline editor overlay with formula support
  • ๐Ÿ’พ Persistence Lifecycle โ€” onSave, onSaveAs, onBeforeClose, onDiscardChanges hooks
  • โ†ฉ๏ธ Undo / Redo โ€” Full command stack with dirty-state tracking
  • ๐Ÿ“‹ Clipboard โ€” In-app range copy/paste with formula reference shifting + system TSV fallback
  • โšก Autofill โ€” Drag-to-fill with arithmetic and pattern detection
  • ๐Ÿ”ข Live Formula Engine โ€” AST-based evaluator with real-time dependency recalculation
  • ๐ŸŽ›๏ธ Workbook Actions โ€” Extensible action menu (bottom sheet on mobile, popup on desktop)
  • โœ… Validation โ€” Rule-based cell validation with visual feedback
  • ๐Ÿงช 324 Tests โ€” Comprehensive coverage across engine, widget, and integration layers

Feature Highlights #

Feature Detail
โšก Virtualized Rendering 60+ FPS even with millions of cells โ€” direct Canvas painting, no per-cell widgets
๐Ÿ“ฆ XLSX & CSV Support Native parsers for Excel and CSV files โ€” no WebView, no external services
๐Ÿ–Š๏ธ Cell Editing Inline editor overlay; tap to edit, type = for formulas
๐Ÿ”ข Formula Engine AST tokenizer + evaluator with live dependency graph recalculation
โ†ฉ๏ธ Undo / Redo Command-pattern stack; integrates with dirty-state and save lifecycle
๐Ÿ“‹ Clipboard Copy/paste ranges with formula shifting; reads system TSV from Excel/Sheets
โšก Autofill Drag handle to extend values or arithmetic sequences
๐Ÿ’พ Persistence Hooks Full save lifecycle โ€” dirty tracking, save, save as, discard, close interception
๐ŸŽ›๏ธ Workbook Actions Extensible menu with built-in and developer-injected actions
โœ… Validation Cell-level rules with blocked input and visual indicators
๐Ÿ“ Merged Cells Pixel-perfect hit-testing and rendering for complex layouts
๐ŸŽจ Full Theming SheetifyeThemeData with dark mode auto-detection
๐ŸŒ Cross-Platform iOS, Android, Web, Windows, macOS, Linux

Supported Platforms #

Platform Support Rendering
iOS โœ… Native Canvas
Android โœ… Native Canvas
Web โœ… CanvasKit / HTML
Windows โœ… Native Canvas
macOS โœ… Native Canvas
Linux โœ… Native Canvas

Installation #

flutter pub add sheetifye

Or add to pubspec.yaml manually:

dependencies:
  sheetifye: ^1.1.0

Sheetifye uses Riverpod for state management. Wrap your app root in a ProviderScope once โ€” if you already use Riverpod, no additional setup is needed.


Quick Start #

1. Initialize #

void main() {
  runApp(const ProviderScope(child: MyApp()));
}

2. View a Spreadsheet (read-only) #

import 'package:sheetifye/sheetifye.dart';

Sheetifye.asset('assets/reports/sales_2024.xlsx')

3. Enable Editing + Save Lifecycle #

Sheetifye.asset(
  'assets/reports/sales_2024.xlsx',
  readOnly: false,
  onSave: (workbook) async {
    await myApi.save(WorkbookExporter.toJson(workbook));
    return true; // mark clean
  },
  onSaveAs: (workbook) async {
    final bytes = WorkbookExporter.toXlsxBytes(workbook);
    await FilePicker.saveFile(bytes);
    return true;
  },
  onBeforeClose: () async {
    // Return true to allow close, false to cancel
    return await showSaveDialog(context);
  },
  onWorkbookChanged: (workbook, isDirty) {
    saveIndicator.value = isDirty;
  },
)

Usage Examples #

๐Ÿ“ Load from Asset #

Sheetifye.asset('assets/template.xlsx')

๐ŸŒ Load from Network #

Sheetifye.network(
  'https://api.example.com/reports/latest.xlsx',
  headers: {'Authorization': 'Bearer $token'},
)

๐Ÿ’พ Load from File #

Sheetifye.file(File('/storage/emulated/0/Download/report.xlsx'))

๐Ÿง  Load from Memory (e.g. file picker) #

final result = await FilePicker.platform.pickFiles(withData: true);
Sheetifye.memory(result!.files.first.bytes!)

๐Ÿ“Š Load a CSV File #

Sheetifye.network('https://data.example.com/export.csv')
// CSV is auto-detected by file extension

Editing & Formula Entry #

When readOnly: false, users can:

  • Double-tap (mobile) or press Enter / F2 (desktop) to open the inline cell editor
  • Type = to enter formula mode โ€” the formula bar shows the expression, the cell shows the result
  • Tab / Enter to confirm and advance to the next cell
  • Escape to cancel
Sheetifye.asset(
  'assets/data.xlsx',
  readOnly: false, // โ† enables the editing system
)

Undo & Redo #

Every edit is captured in a command stack. Users can undo/redo via:

  • Keyboard shortcuts โ€” Ctrl+Z / Ctrl+Y (desktop)
  • Workbook action menu โ€” Undo and Redo built-in actions

The onWorkbookChanged callback fires after each undo/redo, keeping your UI in sync.


Workbook Actions #

The workbook action menu provides extensible workbook-level operations. Built-in actions include Save, Save As, Export CSV, Export XLSX, Undo, Redo, and Discard Changes. Add your own:

import 'package:sheetifye/sheetifye.dart';

Sheetifye.asset(
  'assets/data.xlsx',
  customActions: [
    WorkbookAction(
      id: 'app.share',
      label: 'Share with Team',
      icon: Icons.share,
      group: WorkbookActionGroup.sharing,
      onExecute: (context, ref) async {
        final workbook = ref.read(workbookProvider).workbook;
        final csv = WorkbookExporter.toCsv(workbook);
        await Share.share(csv);
      },
    ),
  ],
)

The menu renders as a bottom sheet on mobile and a popup menu on desktop/web automatically.


Persistence & Export #

Dirty State #

onWorkbookChanged: (workbook, isDirty) {
  // isDirty == true when there are unsaved changes
  setState(() => _hasUnsavedChanges = isDirty);
},

Export Formats #

// JSON (for custom backends)
final json = WorkbookExporter.toJson(workbook);

// CSV (active sheet)
final csv = WorkbookExporter.toCsv(workbook);

// XLSX bytes (for file saving)
final bytes = WorkbookExporter.toXlsxBytes(workbook);

Custom Theming #

Sheetifye.asset(
  'assets/data.xlsx',
  theme: SheetifyeThemeData.light().copyWith(
    primaryColor: Colors.deepPurple,
    headerBackground: Colors.grey[50],
    gridColor: Colors.blueGrey[100],
    fontFamily: 'Inter',
  ),
)

Dark mode is detected automatically from Theme.of(context).brightness when no theme is provided.


Architecture #

Sheetifye follows a layered engine architecture with direct Canvas rendering at its core.

lib/src/
โ”œโ”€โ”€ domain/     Pure entities โ€” Workbook, Sheet, Cell, CellRange
โ”œโ”€โ”€ data/       Adapters โ€” XLSX parser (isolate), CSV parser, serializer
โ”œโ”€โ”€ engine/     Runtime systems โ€” Formula, Clipboard, Autofill, Overlays, Structure
โ”œโ”€โ”€ features/   Riverpod state + UI โ€” Workbook, Grid, Toolbar, Formula Bar, Actions
โ”œโ”€โ”€ core/       Theme, utilities, grid layout math
โ””โ”€โ”€ public/     Consumer-facing API โ€” Sheetifye widget, WorkbookExporter, PersistenceOptions

Key design decisions:

  • Canvas-first โ€” The grid draws directly to Canvas, bypassing the Flutter widget tree per cell for maximum throughput.
  • Isolate parsing โ€” XLSX and CSV files are parsed in a compute() isolate, keeping the UI thread free.
  • Command pattern โ€” Every mutation is encapsulated in a command, enabling undo/redo and dirty-state tracking.
  • Dependency graph โ€” The formula engine tracks cell relationships for surgical re-evaluation on edit.

โ†’ Full details in Architecture Guide


Comparison #

Feature Sheetifye Syncfusion PlutoGrid
XLSX Parsing โœ… Native ๐ŸŸก Add-on required โŒ None
CSV Support โœ… RFC-4180 ๐ŸŸก Basic โŒ None
Cell Editing โœ… Full โœ… Full โœ… Full
Formula Engine โœ… AST Native ๐ŸŸก Partial โŒ None
Undo / Redo โœ… Command stack ๐ŸŸก Limited โŒ None
Clipboard โœ… In-app + System ๐ŸŸก Basic โŒ None
Autofill โœ… Smart fill โŒ None โŒ None
Virtualization โœ… Full โœ… Full ๐ŸŸก Partial
Memory Usage ๐Ÿ’Ž ~42 MB ๐Ÿ”ด ~180 MB ๐ŸŸก ~120 MB
License MIT ๐Ÿ’ฐ Commercial MIT

Testing #

Sheetifye ships with 324 passing tests across 31+ test files:

Category Files Coverage
Engine โ€” Persistence 12 Dirty state, save lifecycle, crash resistance, recovery, export, async save
Engine โ€” Formula 2 Tokenizer, evaluator, dependency resolution
Engine โ€” Clipboard 1 In-app range copy/paste, TSV parsing, formula shifting
Engine โ€” Editing 1 Cell mutations, validation, undo/redo interaction
Engine โ€” Undo/Redo 1 Command stack, dirty state after undo
Engine โ€” Sorting/Filtering 2 Multi-column sort, filter state
Engine โ€” Autofill 1 Pattern detection, arithmetic sequences
Engine โ€” Virtualization 1 Viewport calculation, scroll accuracy
Engine โ€” Merged Cells 1 Layout, selection, hit-testing
Widget Tests 5 Formula bar, grid, toolbar, editor overlay, workbook
Integration Tests 5+ Mobile UX, desktop UX, web, stress, XLSX samples

Run the full suite:

fvm flutter test

Roadmap #

  • โœ… v1.0.0 โ€” Native XLSX viewer, virtualized grid, formula bar, merged cells, theming
  • โœ… v1.1.0 โ€” Full editing system, persistence lifecycle, undo/redo, clipboard, autofill, formula engine, workbook actions, validation, mobile UX
  • โŒ v1.2.0 โ€” Conditional formatting, charts, cell comments, multi-sheet editing
  • โŒ v2.0.0 โ€” Collaborative editing hooks, advanced styling, named ranges, pivot-table rendering

Contributing #

We welcome contributions! Please read the Contributing Guide before opening a PR. Key requirements:

  • fvm flutter test must pass (324+ tests)
  • fvm flutter analyze must report zero issues
  • New features must include tests and updated docs

License #

Sheetifye is released under the MIT License. See LICENSE for details.


Built with โค๏ธ by Vikas Poute

โญ If Sheetifye saves you time, please give it a star on GitHub. โญ

3
likes
150
points
175
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Flutter spreadsheet engine with XLSX/CSV support, live editing, undo/redo, formula evaluation, clipboard, autofill, and a full persistence lifecycle.

Repository (GitHub)
View/report issues
Contributing

Topics

#excel #xlsx #csv #spreadsheet #editor

License

MIT (license)

Dependencies

archive, collection, flutter, flutter_riverpod, freezed_annotation, google_fonts, http, intl, json_annotation, riverpod_annotation, shimmer, xml

More

Packages that depend on sheetifye