another_gauge 1.0.4 copy "another_gauge: ^1.0.4" to clipboard
another_gauge: ^1.0.4 copied to clipboard

Another customizable Gauge widget for Flutter, with automatic needle and cap ranged color

example/lib/main.dart

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

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

class MyApp extends StatefulWidget {
  const MyApp({Key? key}) : super(key: key);
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  ValueNotifier<double> valueNotifier = ValueNotifier(0);
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
        debugShowCheckedModeBanner: false,
        home: Scaffold(
          appBar: AppBar(
            title: const Text('AnotherGauge examples'),
          ),
          body: Column(
            children: [
              Row(
                mainAxisAlignment: MainAxisAlignment.center,
                children: [
                  ElevatedButton(onPressed: () { valueNotifier.value +=15;}, child: Text('Increment')),
                  SizedBox(width: 16,),
                  ElevatedButton(onPressed: () { valueNotifier.value -=15;}, child: Text('Decrement')),
                ],
              ),
              Expanded(
                child: Container(
                    color: Colors.grey[200],
                    child: Center(
                      child: AnotherGauge(
                          valueNotifier: valueNotifier,
                          capBorderColor: Colors.white,
                          capBorderWidth: 5,
                          capColor: Colors.white10,
                          faceStartColor: Colors.blueGrey,
                          //faceEndColor: Colors.blueAccent,
                          subTicksColor: Colors.white,
                          needleColor: Colors.white,
                          mainTicksColor: Colors.red,
                          rangeNeedleColor: true,
                          strokeWidth: 10,
                          showFrame: true,
                          gaugeSize: 256,
                          segments: [
                            GaugeSegment('Low', 200, Colors.green),
                            GaugeSegment('Medium', 40, Colors.orange),
                            GaugeSegment('High', 20, Colors.red),
                          ],
                          valueSymbol: ' km/h',
                          displayWidget: const Text('Speed',
                          style: TextStyle(color: Colors.white, fontSize: 12, fontWeight: FontWeight.bold)),
                          maxValue: 260,
                      ),
                    ),
                ),
              ),
            ],
          )
        )
    );
  }
}
6
likes
0
points
42
downloads

Publisher

unverified uploader

Weekly Downloads

Another customizable Gauge widget for Flutter, with automatic needle and cap ranged color

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on another_gauge