Animated, highly customizable, open-source Flutter gauge indicator widgets

Overview

Gauge indicator

Animated, highly customizable, open-source Flutter gauge indicator widgets. They use renderbox under the hood, thus ensuring high performance.

Working web example of package here

AnimatedRadialgauge

Usage

It is as simple as defining a RadialGauge or an AnimatedRadialGauge widget in your widget tree.

Code

/// Build method of your widget.
@override
Widget build(BuildContext context) {
  // Create animated radial gauge.
  // All arguments changes will be automatically animated.
  return AnimatedRadialGauge(
    /// The animation duration.
    duration: const Duration(milliseconds: 500),
    /// Gauge value.
    value: gaugeValue,
    /// Provide the [min] and [max] value for the [value] argument.
    min: 0,
    max: 100,
    /// Optionally, you can configure your gauge, providing additional
    /// styles and transformers.
    axis: GaugeAxis(
      /// Render the gauge as a 260-degree arc.
      degrees: 260,
      /// Display the green value progress.
      transformer: const GaugeAxisTransformer.progress(color: Colors.red),
      /// Set the background color and axis thickness.
      style: const GaugeAxisStyle(
        thickness: 20,
        background: Color(0xFFD9DEEB),
      ),
      /// Define the pointer that will indicate the progress.
      pointer: RoundedTrianglePointer(
        size: 20,
        backgroundColor: Colors.black,
        borderRadius: 2,
        border: const GaugePointerBorder(
          color: Colors.white,
          width: 2,
        ),
      ),
    ),
    /// You can also, define the child builder.
    /// This way you will build a value label, but you can use the widget of your choice.
    ///
    /// For non-value related widgets, take a look at the [child] parameter.
    builder: (context, child, value) => RadialGaugeLabel(
      value: value,
      style: const TextStyle(
        color: Colors.black,
        fontSize: 46,
        fontWeight: FontWeight.bold,
      ),
    ),
  );
}

Output

example

Linear Gauge

example

Usage

It is as simple as defining a LinearGauge or an AnimatedLinearGauge widget in your widget tree.

Code

@override
Widget build(BuildContext context) {
  // All property changes are animated
  return AnimatedLinearGauge(
    // Value of the gauge, for special cases we allow doubles
    value: 5,
    // Maximum value constrained to integer
    // for special edge case evasion
    max: 15,
    // color of the full width background rect
    backgroundColor:
        const Color.fromARGB(255, 132, 132, 132),
    // how much space do you want on the vertical axis of segments,
    // does not affect thumb height
    verticalSegmentMargin: 2.0,
    // how rounded are supposed to be the corners
    cornerRadius: 8.0,
    // width of separators dividing bar into individual segments
    separatorThickness: 2.0,
    // you can prevent widget from displaying dividers
    // when there is a lot of very thin segments,
    // if segment is thinner than this value, no separators will
    // be rendered
    minimumSegmentThickness: 8.0,
    // you can define many color ranges on the axis,
    // if you do not pass any semgent here
    // it will put one by default
    segments: const [
      LinearGaugeSegment(
        // you do not define ending value of the segment directly,
        // it will continue till next segment or to max value
        start: 0,
        color: Colors.red,
      ),
      LinearGaugeSegment(
        start: 5,
        color: Colors.green,
      ),
      LinearGaugeSegment(
        start: 10,
        color: Colors.blue,
      ),
    ],
    // duration of the animation
    duration: const Duration(milliseconds: 400),
    // curve implementation that you want to use
    curve: Curves.ease,
    // callback triggered when the animation ends
    onEnd: () {},
    // you can override default thumb style
    thumbStyle: const ThumbStyle(
      // infill color
      color: Colors.white,
      // width of the outer cutout mask
      strokeWidth: 2.0,
      // width of the infill
      thickness: 6.0,
    ),
  );
}

Output

example

You might also like...

Flutter package: Assorted layout widgets that boldly go where no native Flutter widgets have gone before.

Flutter package: Assorted layout widgets that boldly go where no native Flutter widgets have gone before.

assorted_layout_widgets I will slowly but surely add interesting widgets, classes and methods to this package. Despite the package name, they are not

Dec 22, 2022

Flutter-useful-widgets - Flutter Useful Widgets

Flutter-useful-widgets - Flutter Useful Widgets

useful_widgets This package makes it easy to build apps by providing a list of simple and useful widgets. import 'package:useful_widgets/useful_widget

Jun 20, 2022

Custom widgets and utils using Flutter framework widgets and Dart language

reuse_widgets_and_utils The custom widgets and utils using Flutter framework widgets and Dart programming language. Getting Started This project is a

Oct 29, 2021

Widgets beginner - Widgets beginner with flutter

Widgets beginner - Widgets beginner with flutter

Widgets beginner - Widgets beginner with flutter

Feb 6, 2022

RoundedLoadingButton is a Flutter package with a simple implementation of an animated loading button, complete with success and error animations.

RoundedLoadingButton is a Flutter package with a simple implementation of an animated loading button, complete with success and error animations.

rounded_loading_button RoundedLoadingButton is a Flutter package with a simple implementation of an animated loading button, complete with success and

Jan 4, 2023

A Flutter package to show beautiful animated snackbars directly using overlay

A Flutter package to show beautiful animated snackbars directly using overlay

Easily show beautiful snack bars directly using overlays. Create custom snack bars and show them with awesome animations.

Dec 27, 2022

Animated Search Bar package lets you add a beautiful search bar to your Flutter app.

Animated Search Bar package lets you add a beautiful search bar to your Flutter app.

Animated Search Bar Animated Search Bar package lets you add a beautiful search bar to your Flutter app. Installation Add the latest version of packag

Aug 7, 2022

Telegram Animated Widget

telegram_widgets A new Flutter project. Getting Started This project is a starting point for a Flutter application. A few resources to get you started

Jul 10, 2022

Customizable Flutter widget which syncronize ScrollView with PageView as tabs

Customizable Flutter widget which syncronize ScrollView with PageView as tabs

scrollable_list_tab_scroller Customizable Flutter widget which syncronize ScrollView with PageView as tabs. Create a custom page view as tabs which sy

Dec 21, 2022
Releases(v0.2.0)
  • v0.2.0(Jun 7, 2022)

    What's Changed

    • FEATURE Redone folder structure of example by @KopaczP in https://github.com/HTD-Health/gauge_indicator/pull/5
    • FEATURE Add linear gauge widget by @KopaczP in https://github.com/HTD-Health/gauge_indicator/pull/10
    • FEATURE Add linear gauge example page by @KopaczP in https://github.com/HTD-Health/gauge_indicator/pull/11
    • FEATURE Suppress separators based on minimum segment width by @KopaczP in https://github.com/HTD-Health/gauge_indicator/pull/12
    • FEATURE Animated linear gauge by @KopaczP in https://github.com/HTD-Health/gauge_indicator/pull/13
    • Bump package version to 0.2.0-dev.1 by @KopaczP in https://github.com/HTD-Health/gauge_indicator/pull/14
    • FIX Redo linear gauge bar width calculation by @KopaczP in https://github.com/HTD-Health/gauge_indicator/pull/15
    • FEATURE Preferred height param by @KopaczP in https://github.com/HTD-Health/gauge_indicator/pull/16
    • FIX Remove broken workaround for spacing between segments by @KopaczP in https://github.com/HTD-Health/gauge_indicator/pull/17
    • FEATURE Display example as tab view by @KopaczP in https://github.com/HTD-Health/gauge_indicator/pull/18
    • FEATURE Remove dangling dependencies by @KopaczP in https://github.com/HTD-Health/gauge_indicator/pull/19
    • FEATURE Added readme for linear gauge by @KopaczP in https://github.com/HTD-Health/gauge_indicator/pull/20
    • FEATURE Introduced the child parameters to the radial gauge. by @kamilklyta in https://github.com/HTD-Health/gauge_indicator/pull/21
    • Add a missing dependency by @kamilklyta in https://github.com/HTD-Health/gauge_indicator/pull/22
    • FEATURE Linear gauge polishing by @KopaczP in https://github.com/HTD-Health/gauge_indicator/pull/23
    • DOCS Add example to the readme by @kamilklyta in https://github.com/HTD-Health/gauge_indicator/pull/24
    • FEATURE Finishing touches pre-release 0.2.0 by @KopaczP in https://github.com/HTD-Health/gauge_indicator/pull/25

    New Contributors

    • @KopaczP made their first contribution in https://github.com/HTD-Health/gauge_indicator/pull/5

    Full Changelog: https://github.com/HTD-Health/gauge_indicator/compare/v0.1.0...v0.2.0

    Source code(tar.gz)
    Source code(zip)
  • v0.2.0-dev.2(Jun 3, 2022)

    What's Changed

    • FIX Redo linear gauge bar width calculation by @KopaczP in https://github.com/HTD-Health/gauge_indicator/pull/15
    • FEATURE Preferred height param by @KopaczP in https://github.com/HTD-Health/gauge_indicator/pull/16
    • FIX Remove broken workaround for spacing between segments by @KopaczP in https://github.com/HTD-Health/gauge_indicator/pull/17
    • FEATURE Display example as tab view by @KopaczP in https://github.com/HTD-Health/gauge_indicator/pull/18
    • FEATURE Remove dangling dependencies by @KopaczP in https://github.com/HTD-Health/gauge_indicator/pull/19
    • FEATURE Added readme for linear gauge by @KopaczP in https://github.com/HTD-Health/gauge_indicator/pull/20
    • FEATURE Introduced the child parameters to the radial gauge. by @kamilklyta in https://github.com/HTD-Health/gauge_indicator/pull/21
    • FIX Add a missing dependency by @kamilklyta in https://github.com/HTD-Health/gauge_indicator/pull/22

    Full Changelog: https://github.com/HTD-Health/gauge_indicator/compare/v0.2.0-dev.1...v0.2.0-dev.2

    Source code(tar.gz)
    Source code(zip)
  • v0.2.0-dev.1(May 31, 2022)

    What's Changed

    • FEATURE Redone folder structure of example by @KopaczP in https://github.com/HTD-Health/gauge_indicator/pull/5
    • FEATURE Add linear gauge widget by @KopaczP in https://github.com/HTD-Health/gauge_indicator/pull/10
    • FEATURE Add linear gauge example page by @KopaczP in https://github.com/HTD-Health/gauge_indicator/pull/11
    • FEATURE Suppress separators based on minimum segment width by @KopaczP in https://github.com/HTD-Health/gauge_indicator/pull/12
    • FEATURE Animated linear gauge by @KopaczP in https://github.com/HTD-Health/gauge_indicator/pull/13

    New Contributors

    • @KopaczP made their first contribution in https://github.com/HTD-Health/gauge_indicator/pull/5

    Full Changelog: https://github.com/HTD-Health/gauge_indicator/compare/v0.1.0...v0.2.0-dev.1

    Source code(tar.gz)
    Source code(zip)
  • v0.1.0(May 9, 2022)

    Changes:

    • Migrated to the render box.
    • Added flutter_lints package for the analysis.
    • Removed gauge custom painter.
    • Renamed Gauge into AnimatedRadialGauge.
      • AnimatedRadialGauge is simplicity animated widget.
      • Added initialValue which describes the value from which the gauge indicator will be initially animated to the current value.
    • Added RadialGauge widget, that supports drawing gauge indicator without the animations.

    Full Changelog: https://github.com/HTD-Health/gauge_indicator/compare/v0.0.1...v0.1.0

    Source code(tar.gz)
    Source code(zip)
  • v0.0.1(May 5, 2022)

Owner
HTD Health
We bring human-centered technology to healthcare. HTD Health helps partners plan, design, develop, and evaluate digital health products and devices.
HTD Health
SKAlertDialog - A highly customizable, powerful and easy-to-use alert dialog for Flutter.

SKAlertDialog A highly customizable, powerful and easy-to-use alert dialog for Flutter. GIF Screenshots SKAlertDialog Basic Alert Alert with buttons A

Senthil_Kumar 7 May 18, 2022
A Highly customizable Phone input Flutter widget that supports country code, validation and contact picker.

A Highly customizable Phone input Flutter widget that supports country code, validation and contact picker.

null 6 Jun 7, 2022
Sliding card is a highly customizable flutter package that will help you create beautiful Cards with a sliding animation effect.

Sliding Card Introduction Sliding card is a highly customizable flutter package that will help you create beautiful Cards with a sliding animation eff

null 21 Nov 4, 2022
Displays a highly customizable week view (or day view) which is able to display events, to be scrolled, to be zoomed-in & out and a lot more !

Displays a highly customizable week view (or day view) which is able to display events, to be scrolled, to be zoomed-in & out and a lot more !

Hugo Delaunay 196 Dec 2, 2022
A highly customizable multiple selection widget with search functionality.

A highly customizable multiple selection widget with search functionality.

null 5 Dec 19, 2022
A highly customizable toggle switch with a loading state.

A highly customizable toggle switch with a loading state.

null 6 Dec 30, 2022
A basic Flutter app that includes some native Widgets like alerts, cards, avatars, animated container, inputs, etc.

Flutter components This project was created with Flutter and some native Widgets like alerts, cards, avatars, animated container, inputs, etc. Getting

Paúl 4 Nov 15, 2021
A Flutter library to add bubble tab indicator to TabBar

Bubble Tab Indicator A Flutter library to add bubble tab indicator to TabBar. Getting Started Add package from github by adding the following to your

Vipul Asri 184 Nov 23, 2022
A Flutter library to add the Common effect (line, bubble, dot ...) of tab indicator.

flutter_tab_indicator A Flutter library to add the Common effect (line, bubble, dot ...) of tab indicator. Showcases Installation Showcases Showcases

CrabMan 14 Jun 19, 2022
A widget displaying children in a line with an overflow indicator at the end if there is not enough space.

overflow_view A widget displaying children in a line with an overflow indicator at the end if there is not enough space. Features Renders children hor

Romain Rastel 153 Dec 19, 2022