Install

Install scidart 0.1.1

One dependency, no native setup. The same code runs in a CLI, a Flutter app and the browser.

Requirements

  • Dart SDK ^3.0.0. Flutter 3.10 or newer ships a compatible Dart.
  • No native code and no platform channels: scidart is pure Dart.
Platform Status
Dart VM (CLI, server) tested in CI on Linux, macOS and Windows
Flutter (Android, iOS, macOS, Windows, Linux) runs on the Dart VM
Web (dart2js) tested in CI on Chrome; the demos on this site run this way
Web (WebAssembly) not tested yet

Add the package

Dart project:

dart pub add scidart

Flutter project:

flutter pub add scidart

Or edit pubspec.yaml and run dart pub get:

dependencies:
  scidart: ^0.1.1

Import

// NumPy side: arrays, linalg, polynomial, statistics, calculus, constants
import 'package:scidart/numdart.dart';

// SciPy side: fft, signal, special, stats, optimize (also exports numdart)
import 'package:scidart/scidart.dart';

Check that it works

Arrays and element-wise mathCreate an Array, combine arrays element by element and reduce them.
import 'package:scidart/numdart.dart';

void main() {
  var a = Array([1, 2, 3, 4]);
  var b = Array([10, 20, 30, 40]);

  print((a + b).toList()); // element-wise sum
  print((a * b).toList()); // element-wise product
  print(arrayMultiplyToScalar(a, 0.5).toList());
  print(arrayCumSum(a).toList());

  print('sum: ${arraySum(a)}, max: ${arrayMax(b)}, argmax: ${arrayArgMax(b)}');
}
Output
[11.0, 22.0, 33.0, 44.0]
[10.0, 40.0, 90.0, 160.0]
[0.5, 1.0, 1.5, 2.0]
[1.0, 3.0, 6.0, 10.0]
sum: 10.0, max: 40.0, argmax: 3

Upgrading

Read the release notes before upgrading. Versions before 1.0 can change the API in a minor release; breaking changes are listed first in each release.

These packages are experimental and have not been updated since 2023:

  • scidart_io: read and write CSV and text files (desktop only).
  • scidart_plot: line, bar, stem, dot and pie plots as SVG strings.