excel_rust 0.0.4 copy "excel_rust: ^0.0.4" to clipboard
excel_rust: ^0.0.4 copied to clipboard

Read large excel files iteratively with ease using the excel_rust package. This package provides efficient methods to handle large Excel files without loading the entire file into memory, making it su [...]

example/lib/main.dart

import 'package:file_picker/file_picker.dart';
import 'package:flutter/material.dart';
import 'package:excel_rust/excel_rust.dart';

Future<void> main() async {
  await ExcelRust.init();
  runApp(const MyApp());
}

void readExcel(String filepath) async {
  final ExcelRust excelRust = ExcelRust.instance();
  List<String> sheets = excelRust.getSheets(path: filepath);

  Stream<List<String>> rows = excelRust.readFile(
    path: filepath,
    sheet: sheets.first,
  );
  await for (List<String> row in rows) {
    // Your business logic
    print(row);
  }
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(title: const Text('Excel Rust')),
        body: Center(
          child: FilledButton(
            onPressed: () async {
              FilePickerResult? result = await FilePicker.platform.pickFiles();
              if (result != null) {
                readExcel(result.files.first.path!);
              }
            },
            child: const Text("Pick File"),
          ),
        ),
      ),
    );
  }
}
2
likes
150
points
27
downloads

Publisher

unverified uploader

Weekly Downloads

Read large excel files iteratively with ease using the excel_rust package. This package provides efficient methods to handle large Excel files without loading the entire file into memory, making it suitable for processing large datasets. It leverages Rust for performance and integrates seamlessly with Flutter.

Repository (GitHub)

Documentation

API reference

License

MIT (license)

Dependencies

flutter, flutter_rust_bridge, plugin_platform_interface

More

Packages that depend on excel_rust