xcel_processor 0.0.1 copy "xcel_processor: ^0.0.1" to clipboard
xcel_processor: ^0.0.1 copied to clipboard

A Flutter package that provides a simple and efficient way to read data from Excel files. This package utilizes the `file_picker` and `excel` libraries to allow users to pick an Excel file, specify a [...]

xcel_processor #

A Flutter package for processing data from Excel files. This package provides a simple and efficient way to integrate Excel data processing into your Flutter applications.

Features #

  • Read data from specified rows and columns in Excel files.
  • Simple and efficient integration into Flutter applications.

Getting Started #

To use this package, add the following dependency to your pubspec.yaml file:

Usage #

Minimal example:

import 'package:flutter/material.dart';
import 'package:xcel_processor/xcel_processor.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('Xcel Processor Example'),
      ),
      body: Center(
        child: ElevatedButton(
          onPressed: () async {
            var result = await ExcelProcessor.pickAndReadExcel('YourTable', 1, 2);
            _showResultDialog(context, result);
          },
          child: Text('Pick and Process Excel'),
        ),
      ),
    );
  }

  void _showResultDialog(BuildContext context, Map<String, dynamic> result) {
    showDialog(
      context: context,
      builder: (BuildContext context) {
        return AlertDialog(
          title: Text('Xcel Processor Result'),
          content: Column(
            crossAxisAlignment: CrossAxisAlignment.start,
            mainAxisSize: MainAxisSize.min,
            children: _buildResultWidgets(result),
          ),
          actions: <Widget>[
            TextButton(
              onPressed: () {
                Navigator.of(context).pop();
              },
              child: Text('Close'),
            ),
          ],
        );
      },
    );
  }

  List<Widget> _buildResultWidgets(Map<String, dynamic> result) {
    if (result.containsKey('error')) {
      return [
        Text('Error: ${result['error']}'),
      ];
    } else {
      return [
        Text('Table Name: ${result['tableName']}'),
        Text('Row: ${result['row']}'),
        Text('Column: ${result['column']}'),
        Text('Data: ${result['data']}'),
      ];
    }
  }
}

3
likes
110
pub points
0%
popularity

Publisher

unverified uploader

A Flutter package that provides a simple and efficient way to read data from Excel files. This package utilizes the `file_picker` and `excel` libraries to allow users to pick an Excel file, specify a table, and retrieve data from a specified row and column. Streamline your Excel data processing tasks in Flutter applications with ease.

Repository (GitHub)
View/report issues

Documentation

API reference

License

GPL-3.0 (LICENSE)

Dependencies

csv, excel, file_picker, flutter, open_file

More

Packages that depend on xcel_processor