flutter_speedometer 1.0.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 84

flutter_speedometer #

Flutter Speedometer widget package

Getting Started #

In order to use this package, do import

import 'package:flutter_speedometer/flutter_speedometer.dart';

Basic implementation can be done like below code:

import 'package:flutter/material.dart';
import 'package:flutter_speedometer/flutter_speedometer.dart';

void main() {
  runApp(
    Center(
      child: Speedometer(
        size: 250,
        minValue: 0,
        maxValue: 180,
        currentValue: 76,
        warningValue: 150,
        displayText: 'mph',
      ),
    ),
  );
}

Example App #

You can find more examples from Example App

API #

In this table, you can find all attributes provided by this package:

AttributeDefault valueDescription
size200Min value to be displayed
minValue0Min value to be displayed
maxValue100Max value to be displayed
currentValue0Set the current value
warningValue80Set the current value

Objects #

class Speedometer {

    final double size;
    final int minValue;
    final int maxValue;
    final int currentValue;
    final int warningValue;
    final Color backgroundColor;
    final Color meterColor;
    final Color warningColor;
    final Color kimColor;
    final TextStyle displayNumericStyle;
    final String displayText;
    final TextStyle displayTextStyle;
}

Feedback #

Feel free to leave any feedback for helping support this package 🍻 

[1.0.2] - 2019-08-07 #

  • Change description

[1.0.1] - 2019-08-07 #

  • Fixed bugs

[1.0.0] - 2019-07-11 #

  • First release

[0.0.1] - 2019-07-09 #

  • Initial raw package

example/lib/main.dart

import 'dart:math' as math;
import 'package:flutter/material.dart';
import 'package:flutter_speedometer/flutter_speedometer.dart';

void main() {
  runApp(
    Center(
      child: Directionality(
        textDirection: TextDirection.ltr,
        child: Container(
          child: Flex(
            direction: Axis.vertical,
            children: <Widget>[
              Spacer(),
              Speedometer(
                size: 100,
                minValue: -10,
                maxValue: 50,
                currentValue: 30,
                warningValue: 40,
                backgroundColor: Colors.black,
                meterColor: Colors.lightBlueAccent,
                warningColor: Colors.orange,
                kimColor: Colors.purpleAccent,
                displayNumericStyle: TextStyle(
                    fontFamily: 'Digital-Display',
                    color: Colors.white,
                    fontSize: 18),
                displayText: '°C',
                displayTextStyle: TextStyle(color: Colors.white, fontSize: 8),
              ),
              Spacer(),
              Speedometer(
                size: 300,
                minValue: 0,
                maxValue: 180,
                currentValue: 58,
                warningValue: 90,
                backgroundColor: Colors.black,
                meterColor: Colors.green,
                warningColor: Colors.orange,
                kimColor: Colors.white,
                displayNumericStyle: TextStyle(
                    fontFamily: 'Digital-Display',
                    color: Colors.white,
                    fontSize: 40),
                displayText: 'km/h',
                displayTextStyle: TextStyle(color: Colors.white, fontSize: 15),
              ),
              Spacer(),
              Speedometer(),
              Spacer(),
            ],
          ),
        ),
      ),
    ),
  );
}

Use this package as a library

1. Depend on it

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


dependencies:
  flutter_speedometer: ^1.0.2

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:flutter_speedometer/flutter_speedometer.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
69
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
84
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.7
  • Flutter: 1.12.13+hotfix.9

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.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
flutter_test