flutter_gauge widget
gauge widget with flutter.
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),),
],
),
],
),
);
}
}
Comments are closed.