data 0.5.1

Dart native js
Flutter Android iOS web

A time and space efficient collection of data structures and algorithms to deal with data in Dart.

Dart Data #

Pub Package Build Status Coverage Status GitHub Issues GitHub Forks GitHub Stars GitHub License

Dart Data is a fast and space efficient library to deal with data in Dart, Flutter and the web. As of today this mostly includes data structures and algorithms for vectors and matrices, but at some point might also include graphs and other mathematical structures.

This library is open source, stable and well tested. Development happens on GitHub. Feel free to report issues or create a pull-request there. General questions are best asked on StackOverflow.

The package is hosted on dart packages. Up-to-date class documentation is created with every release.

Tutorial #

Below are step by step instructions of how to use this library. More elaborate examples are included with the examples.

Installation #

Follow the installation instructions on dart packages.

Import the packages into your Dart code using:

import 'package:data/matrix.dart';
import 'package:data/vector.dart';
import 'package:data/type.dart';

How to solve a linear equation? #

Solve 'A * x = b', where 'A' is a matrix and 'b' a vector:

final a = Matrix<double>.fromRows(DataType.float64, [
  [2, 1, 1],
  [1, 3, 2],
  [1, 0, 0],
final b = Vector<double>.fromList(DataType.float64, [4, 5, 6]);
final x = a.solve(b.columnMatrix).column(0);
print(x.format(valuePrinter: Printer.fixed()); // prints '6 15 -23'

How to find the eigenvalues of a matrix? #

Find the eigenvalues of a matrix 'A':

final a = Matrix<double>.fromRows(DataType.float64, [
  [1, 0, 0, -1],
  [0, -1, 0, 0],
  [0, 0, 1, -1],
  [-1, 0, -1, 0],
final decomposition = a.eigenvalue;
final eigenvalues = Vector<double>.fromList(
    DataType.float64, decomposition.realEigenvalues);
print(eigenvalues.format(valuePrinter: Printer.fixed(precision: 1))); // prints '-1.0 -1.0 1.0 2.0'

Misc #

License #

The MIT License, see LICENSE.

The matrix decomposition algorithms are a direct port of the JAMA: A Java Matrix Package, that is released under public domain.

pub points


A time and space efficient collection of data structures and algorithms to deal with data in Dart.

Repository (GitHub)
View/report issues


API reference




collection, csv, meta, more


Packages that depend on data