Skip to content
pubscout

moving_average

0.3.1, released 4 years ago by peterscully.name

Calculate simple, weighted, and exponential moving averages for lists of numbers or objects.

WASM-ready
$ flutter pub add moving_average
Source repository

What it does

Provides a MovingAverage class to compute simple, weighted, and exponential moving averages over collections of data. Supports customizable window sizes, partial starts, and getter functions for custom objects.

AI-written summary of version 0.3.1, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to compute simple moving averages for time-series or numerical list data.
  • You require weighted or exponential moving averages for statistical or data smoothing purposes.

Skip it when

  • You need complex charting or visualization UI widgets to display the moving average data.
  • You are handling real-time streaming data that requires reactive stream-based operators.

Strengths

  • Supports multiple moving average types (simple, weighted, exponential).
  • Works with lists of numbers or custom objects via mapping functions.
  • Zero external dependencies.

Weaknesses

  • Not built as a reactive stream-based operator.
  • Lacks built-in UI components or chart plotting capabilities.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
0
final simpleMovingAverage = MovingAverage<num>(
  averageType: AverageType.simple,
  windowSize: 3,
  partialStart: true,
  getValue: (num n) => n,
  add: (List<num> data, num value) => value,
);
final movingAverage3 = simpleMovingAverage([1, 2, 3, 4, 5]);

Alternatives

Packages that do the same job and could replace moving_average.

  • diffutil_dart

    Calculate the difference between two lists as a list of edit operations.

  • stats

    Calculate common statistical values for a set of numbers.

  • humanize

    Humanize provides locale‑aware helpers to format dates, numbers, lists and file sizes for UI strings.

  • list_diff

    Calculates a minimal list of operations to convert one list into another.