excel_it 1.0.5

Excelit #

Excelit has been migrated to Excel available at (https://pub.dev/packages/excel)

Changelog #

All notable changes to this project will be documented in this file.

[For Future Updates]

[1.0.5] - 2020-02-18

Important #

example/excel_it.dart

import 'dart:io';
import 'package:path/path.dart';
import 'package:excel_it/excel_it.dart';

void main(List<String> args) {
  var file = "/Users/Desktop/excel.xlsx";
  var bytes = File(file).readAsBytesSync();
  var decoder = ExcelIt.decodeBytes(bytes, update: true);

  for (var table in decoder.tables.keys) {
    print(table);
    print(decoder.tables[table].maxCols);
    print(decoder.tables[table].maxRows);
    for (var row in decoder.tables[table].rows) {
      print("$row");
    }
  }

  // if [Sheet24] does not exist then it will be automatically created.
  var sheet = 'Sheet24';

  decoder
    ..updateCell(sheet, CellIndex.indexByString("A1"), "A1",
        fontColorHex: "#1AFF1A", verticalAlign: VerticalAlign.Top)
    ..updateCell(
        sheet, CellIndex.indexByColumnRow(columnIndex: 2, rowIndex: 0), "C1",
        wrap: TextWrapping.WrapText)
    ..updateCell(sheet, CellIndex.indexByString("A2"), "A2",
        backgroundColorHex: "#1AFF1A")
    ..updateCell(sheet, CellIndex.indexByString("E5"), "E5",
        horizontalAlign: HorizontalAlign.Right);

  decoder.encode().then((onValue) {
    File(join("/Users/kawal/Desktop/excel_out.xlsx"))
      ..createSync(recursive: true)
      ..writeAsBytesSync(onValue);
  }).then((_) {
    print(
        "\n****************************** Printing Updated Data Directly by reading output file ******************************\n");
    var fileOut = "/Users/Desktop/excel_out.xlsx";
    var bytesOut = File(fileOut).readAsBytesSync();
    var decoderOut = ExcelIt.decodeBytes(bytesOut, update: true);

    for (var table in decoderOut.tables.keys) {
      print(table);
      print(decoderOut.tables[table].maxCols);
      print(decoderOut.tables[table].maxRows);
      for (var row in decoderOut.tables[table].rows) {
        print("$row");
      }
    }
  });
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  excel_it: ^1.0.5

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:excel_it/excel_it.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
28
Health:
Code health derived from static analysis. [more]
89
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
57
Learn more about scoring.

We analyzed this package on Feb 18, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.5

Health suggestions

Fix lib/src/excel.dart. (-10.89 points)

Analysis of lib/src/excel.dart reported 23 hints, including:

line 31 col 7: Don't explicitly initialize variables to null.

line 246 col 18: Use contains instead of indexOf

line 286 col 7: DO use curly braces for all flow control structures.

line 288 col 7: DO use curly braces for all flow control structures.

line 505 col 7: DO use curly braces for all flow control structures.

Maintenance issues and suggestions

Homepage URL doesn't exist. (-20 points)

At the time of the analysis the homepage field https://github.com/kawal7415/excel_it was unreachable.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
archive ^2.0.0 2.0.13
xml ^3.0.0 3.7.0
Transitive dependencies
args 1.5.2
charcode 1.1.3
collection 1.14.12
convert 2.1.1
crypto 2.1.4
meta 1.1.8
petitparser 3.0.1
typed_data 1.1.6
Dev dependencies
path ^1.5.1 1.6.4
test ^1.2.0