Jorge SinCodigo
Jorge SinCodigo
Ambassador
 · Top 0.1% Flutterflow Developer

Custom Gauge Widget

My two cents

 
Package Name: Customgauge
Pubdev Url: https://pub.dev/packages/customgauge
Parametersvalue 
myText 

[image.png]
Codeimport 'package:customgauge/customgauge.dart';

class Customgauge extends StatefulWidget {
  const Customgauge({
    Key key,
    this.width,
    this.height,
    this.value,
    this.myText,
  }) : super(key: key);

  final double width;
  final double height;
  final double value;
  final String myText;

  @override
  _CustomgaugeState createState() => _CustomgaugeState();
}

class _CustomgaugeState extends State {
  @override
  Widget build(BuildContext context) {
    return Container(
      child: CustomGauge(
        gaugeSize: widget.width,
        segments: [
          GaugeSegment('Low', 20, Colors.red),
          GaugeSegment('Medium', 40, Colors.orange),
          GaugeSegment('High', 40, Colors.green),
        ],
        currentValue: widget.value,
        displayWidget: Text(
          widget.myText,
          style: TextStyle(fontSize: 12, color: Colors.black),
        ),
      ),
    );
  }
} 
1
2 replies