flutter_gauge 1.0.8

  • Readme
  • Changelog
  • Example
  • Installing
  • new67

Chart Types #


Getting Started #

You should ensure that you add the following dependency in your Flutter project.

dependencies:
 flutter_gauge: ^1.0.8

You should then run flutter packages upgrade or update your packages in IntelliJ.

In your Dart code, to use it:

import 'package:flutter_gauge/flutter_gauge.dart';

Example #

An example can be found in the example folder. Check it out.


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


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

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      debugShowCheckedModeBanner: false,
      home: MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: ListView(
        children: <Widget>[
          Row(
            children: <Widget>[
              Expanded(child: FlutterGauge(handSize: 30,width: 200,index: 65.0,fontFamily: "Iran",end: 100,number: Number.endAndCenterAndStart,secondsMarker: SecondsMarker.secondsAndMinute,counterStyle: TextStyle(color: Colors.black,fontSize: 25,)),),
              Expanded(child: FlutterGauge(secondsMarker: SecondsMarker.none,hand: Hand.short,number: Number.none,width: 200,index: 38.0,fontFamily: "Iran",counterStyle: TextStyle(color: Colors.black,fontSize: 35),counterAlign: CounterAlign.center,isDecimal: false),),
            ],
          ),
          Row(
            children: <Widget>[
              Expanded(child: FlutterGauge(handSize: 30,width: 200,index: 80.0,fontFamily: "Iran",end: 100,number: Number.endAndCenterAndStart,secondsMarker: SecondsMarker.secondsAndMinute,hand: Hand.short,counterStyle: TextStyle(color: Colors.black,fontSize: 22,)),),
              Expanded(child: FlutterGauge(handSize: 30,width: 200,index: 65.0,fontFamily: "Iran",end: 500,number: Number.endAndStart,secondsMarker: SecondsMarker.minutes,isCircle: false,counterStyle: TextStyle(color: Colors.black,fontSize: 25,)),),
            ],
          ),
          Row(
            children: <Widget>[
              Expanded(child: Container(color: Colors.black38,child: FlutterGauge(inactiveColor: Colors.white38,activeColor: Colors.white,handSize: 30,width: 200,index: 65.0,fontFamily: "Iran",end: 400,number: Number.none,secondsMarker: SecondsMarker.minutes,isCircle: false,hand: Hand.none,counterAlign: CounterAlign.center,counterStyle: TextStyle(color: Colors.white,fontSize: 30,),isDecimal: false,)),),
              Expanded(child: FlutterGauge(width: 200,index: 67.3,fontFamily: "Iran",counterStyle: TextStyle(color: Colors.black,fontSize: 35,),numberInAndOut: NumberInAndOut.outside,counterAlign: CounterAlign.center,secondsMarker: SecondsMarker.secondsAndMinute,hand: Hand.short),),
            ],
          ),

          Row(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              Expanded(child: FlutterGauge(index: 50.0,counterStyle : TextStyle(color: Colors.black,fontSize: 25,),widthCircle: 10,secondsMarker: SecondsMarker.none,number: Number.all),),
              Expanded(child: FlutterGauge(index: 25.0,counterStyle : TextStyle(color: Colors.black,fontSize: 25,),secondsMarker: SecondsMarker.secondsAndMinute,number: Number.all,numberInAndOut: NumberInAndOut.outside,)),
            ],
          ),
          Row(
            mainAxisAlignment: MainAxisAlignment.center,
            children: <Widget>[
              Expanded(child: FlutterGauge(index: 50.0,width: 800,counterStyle : TextStyle(color: Colors.black,fontSize: 25,),widthCircle: 10,secondsMarker: SecondsMarker.none,number: Number.all),),
            ],
          ),

        ],
      ),
    );
  }
}



[0.0.1] - TODO: Add release date.

  • TODO: Describe initial release.

example/README.md

example #

A new Flutter application.

Getting Started #

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Use this package as a library

1. Depend on it

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


dependencies:
  flutter_gauge: ^1.0.8

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_gauge/flutter_gauge.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
43
Health:
Code health derived from static analysis. [more]
97
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
67
Learn more about scoring.

We analyzed this package on Dec 13, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.0
  • pana: 0.13.1+4
  • Flutter: 1.12.13+hotfix.4

Health suggestions

Fix lib/fluttergauge.dart. (-1.99 points)

Analysis of lib/fluttergauge.dart reported 4 hints:

line 2 col 8: Unused import: 'dart:developer'.

line 6 col 8: Unused import: 'package:flutter/material.dart'.

line 22 col 7: This class (or a class which this class inherits from) is marked as '@immutable', but one or more of its instance fields are not final: FlutterGaugeMain.start, FlutterGaugeMain.end, FlutterGaugeMain.highlightStart, FlutterGaugeMain.highlightEnd, FlutterGaugeMain.fontFamily, FlutterGaugeMain.widthCircle, FlutterGaugeMain.eventObservable, FlutterGaugeMain.number, FlutterGaugeMain.counterAlign, FlutterGaugeMain.hand, FlutterGaugeMain.isCircle, FlutterGaugeMain.isMark, FlutterGaugeMain.handSize, FlutterGaugeMain.secondsMarker, FlutterGaugeMain.shadowHand, FlutterGaugeMain.circleColor, FlutterGaugeMain.handColor, FlutterGaugeMain.backgroundColor, FlutterGaugeMain.indicatorColor, FlutterGaugeMain.paddingHand, FlutterGaugeMain.width, FlutterGaugeMain.numberInAndOut, FlutterGaugeMain.counterStyle, FlutterGaugeMain.textStyle, FlutterGaugeMain.padding, FlutterGaugeMain.inactiveColor, FlutterGaugeMain.activeColor, FlutterGaugeMain.isDecimal

line 72 col 30: Cancel instances of dart.async.StreamSubscription.

Fix lib/flutter_gauge.dart. (-0.50 points)

Analysis of lib/flutter_gauge.dart reported 1 hint:

line 53 col 7: This class (or a class which this class inherits from) is marked as '@immutable', but one or more of its instance fields are not final: FlutterGauge.start, FlutterGauge.end, FlutterGauge.fontFamily, FlutterGauge.widthCircle, FlutterGauge.index, FlutterGauge.width, FlutterGauge.number, FlutterGauge.numberInAndOut, FlutterGauge.counterAlign, FlutterGauge.hand, FlutterGauge.isCircle, FlutterGauge.handSize, FlutterGauge.isDecimal, FlutterGauge.secondsMarker, FlutterGauge.shadowHand, FlutterGauge.circleColor, FlutterGauge.handColor, FlutterGauge.backgroundColor, FlutterGauge.indicatorColor, FlutterGauge.inactiveColor, FlutterGauge.activeColor, FlutterGauge.paddingHand, FlutterGauge.animate, FlutterGauge.counterStyle, FlutterGauge.textStyle

Fix lib/gaugetextpainter.dart. (-0.50 points)

Analysis of lib/gaugetextpainter.dart reported 1 hint:

line 5 col 8: Unused import: 'fluttergauge.dart'.

Fix lib/handpainter.dart. (-0.50 points)

Analysis of lib/handpainter.dart reported 1 hint:

line 6 col 8: Unused import: 'fluttergauge.dart'.

Format lib/linepainter.dart.

Run flutter format to format lib/linepainter.dart.

Maintenance issues and suggestions

Use constrained dependencies. (-20 points)

The pubspec.yaml contains 1 dependency without version constraints. Specify version ranges for the following dependencies: rxdart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.68.0 <3.0.0
flutter 0.0.0
rxdart >=0.18.1 0.23.1
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