GeekyAnts / GaugesFlutter

A gauge package for Flutter that displays progress and can be customized for appearance and behavior.
https://pub.dev/packages/geekyants_flutter_gauges
MIT License
67 stars 15 forks source link

Feature: Number Formatter #268

Open Afroz-Shaikh opened 3 months ago

Afroz-Shaikh commented 3 months ago

Description

The Linear Gauge in the package lacks a built-in number formatter, as highlighted in this issue.Also the basic formatting breaks when numbers with weird values are given

LinearGauge(
          start: -70.33,
          end: 62.4444,
          gaugeOrientation: GaugeOrientation.horizontal,
          enableGaugeAnimation: true,
          rulers: RulerStyle(
            rulerPosition: RulerPosition.bottom,
          ),
          pointers: const [
            Pointer(
              value: 50,
              shape: PointerShape.circle,
            ),
          ],
        ),

image

To address this, we have used the intl package's NumberFormat as a parameter. User will able to pass the numberformat and change the values as desired, by default the numberformat parameter Defaults to NumberFormat('#.##').

image