alitorki2651 / flutter_gauge

Other
24 stars 27 forks source link

isCircle parameter shows circle correctly only if width/height are higher than a threshold #6

Open belatarmohammed opened 4 years ago

belatarmohammed commented 4 years ago

First of all, many thanks for the great work. When I set isCircle to true and width lower or equals to 200, the circle is not displaying correctly around the minutes circle. You can see reselt here: http://belatar.info/cours/flutter_gauge_pbm.png

Here is my Code:

                    FlutterGauge(
                              handSize: 30,widthCircle: 5,width: 200,handColor: Colors.deepOrangeAccent,
                              index: (sDevice!=null&&sDevice.speedKPH!=null)?sDevice.speedKPH:0,
                              fontFamily: "Iran",
                              end: 240,
                              number: Number.endAndCenterAndStart,
                              secondsMarker: SecondsMarker.secondsAndMinute,
                              hand: Hand.short,
                              counterStyle: TextStyle(color: Colors.blueAccent,fontSize: 22,fontWeight: FontWeight.w700),
                              counterAlign: CounterAlign.center,
                              isDecimal: false,isCircle: true,
                    ),
flutternoob commented 4 years ago

Let the default size be the default value as specified in the example. Wrap the FlutterGauge widget in a container widget with a width and height that you prefer. Maybe that will work. I was able to change the size of the FlutterGauge widget from the example by wrapping the FlutterGauge widget in a Container widget.

`Container(
      width: 125,
      height: 125,
      child:
          FlutterGauge(
            circleColor: Colors.blue,
              handSize: 5,
              width: 200,
              index: 0,
              end: 240,
              widthCircle: 5,
              counterAlign: CounterAlign.bottom,
              numberInAndOut: NumberInAndOut.outside,
              indicatorColor: Colors.grey,
              number: Number.endAndStart,
              hand: Hand.long,
              handColor: Colors.deepOrangeAccent,
              secondsMarker: SecondsMarker.secondsAndMinute,
              counterStyle: TextStyle(
                color: Colors.black,
                fontSize: 10,
              )),
    );`

Use a long handle if possible, using the short handle does not work properly. Hope this helps.