csv_picker_button 0.0.7 copy "csv_picker_button: ^0.0.7" to clipboard
csv_picker_button: ^0.0.7 copied to clipboard

A TextButton that will open a file picker and parse the CSV.

example/lib/main.dart

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

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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(title: 'Flutter Demo Home Page'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: CsvButton(
            csvConfiguration: CsvConfiguration(
                hasTitle: true, separator: Separator.semicolon),
            onJsonReceived: (data) {
              print(data);
            },
            child: Text('Parse my CSV')),
      ),
    );
  }
}
8
likes
130
pub points
32%
popularity

Publisher

verified publisheridelub.com

A TextButton that will open a file picker and parse the CSV.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

csv, file_picker, flutter, rxdart

More

Packages that depend on csv_picker_button