oscilloscope 0.0.3

  • Readme
  • Changelog
  • Example
  • Installing
  • 75

oscilloscope widget package for Flutter #

Oscilloscope is a graphical display similar to the trace on an oscilloscope that will display values as it scrolls across the screen. The widget uses a List as the source of the data to display and will scale the information to fit the display. Take a look at the example to see how it can be used.

Each time a value is added to the dataset another point is plotted on the trace, this trace will extends from left to right across the screen until it reaches the end. At this point the trace will then scroll to show new values.

The display can be customised using the following values:

  • backgroundColor - the default is Colors.black
  • traceColor - the default color is Colors.white
  • padding - the default is 10.0
  • showYAxis - show or hide a line representing the 0 yAxis (default is false)
  • yAxisColor - if the yAxis is set for display it will show in this color (default is Colors.white)

The other settings are

  • dataSet - this is the data that is used to generate the trace
  • yAxisMin - an indicator to define the minimum value found in the dataSet (default 0.0)
  • yAxisMax - an indicator to define the maximum value found in the dataSet (default 1.0)

yAxisMin and yAxisMax are used by the widget to determine the scaling factor so all data values are displayed. These values can be altered to modify the data display scale.

Getting Started #

For package install see here.

For help getting started with Flutter, view the online documentation.

[0.0.3] - 14 Sept 2018. #

[0.0.2] - 14 Sept 2018. #

  • Added optional yAxis line

[0.0.1] - 13 Sept 2018. #

  • Initial Release


/// Demo of using the oscilloscope package
/// In this demo 2 displays are generated showing the outputs for Sine & Cosine
/// The scope displays will show the data sets  which will fill the yAxis and then the screen display will 'scroll'
import 'package:flutter/material.dart';
import 'package:oscilloscope/oscilloscope.dart';
import 'dart:math';
import 'dart:async';

void main() => runApp(new MyApp());

class MyApp extends StatelessWidget {
  Widget build(BuildContext context) {
    return new MaterialApp(
      title: "Oscilloscope Display Example",
      home: Shell(),

class Shell extends StatefulWidget {
  _ShellState createState() => _ShellState();

class _ShellState extends State<Shell> {
  List<double> traceSine = List();
  List<double> traceCosine = List();
  double radians = 0.0;
  Timer _timer;

  /// method to generate a Test  Wave Pattern Sets
  /// this gives us a value between +1  & -1 for sine & cosine
  _generateTrace(Timer t) {
    // generate our  values
    var sv = sin((radians * pi));
    var cv = cos((radians * pi));

    // Add to the growing dataset
    setState(() {

    // adjust to recyle the radian value ( as 0 = 2Pi RADS)
    radians += 0.05;
    if (radians >= 2.0) {
      radians = 0.0;

  initState() {
    // create our timer to generate test values
    _timer = Timer.periodic(Duration(milliseconds: 60), _generateTrace);

  void dispose() {

  Widget build(BuildContext context) {
    // Create A Scope Display for Sine
    Oscilloscope scopeOne = Oscilloscope(
      showYAxis: true,
      yAxisColor: Colors.orange,
      padding: 20.0,
      backgroundColor: Colors.black,
      traceColor: Colors.green,
      yAxisMax: 1.0,
      yAxisMin: -1.0,
      dataSet: traceSine,

    // Create A Scope Display for Cosine
    Oscilloscope scopeTwo = Oscilloscope(
      showYAxis: true,
      padding: 20.0,
      backgroundColor: Colors.black,
      traceColor: Colors.yellow,
      yAxisMax: 1.0,
      yAxisMin: -1.0,
      dataSet: traceCosine,

    // Generate the Scaffold
    return Scaffold(
      appBar: AppBar(
        title: Text("OscilloScope Demo"),
      body: Column(
        children: <Widget>[
          Expanded(flex: 1, child: scopeOne),
            flex: 1,
            child: scopeTwo,

Use this package as a library

1. Depend on it

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

  oscilloscope: ^0.0.3

2. Install it

You can install packages from the command line:

with Flutter:

$ flutter pub get

Alternatively, your editor might support 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:oscilloscope/oscilloscope.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

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

  • Dart: 2.7.1
  • pana: 0.13.6
  • Flutter: 1.12.13+hotfix.8

Maintenance suggestions

Package is getting outdated. (-56.44 points)

The package was last published 81 weeks ago.

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies