shiniwat / animated_battery_gauge

A simple, easily customizable battery widget

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

animated_battery_gauge widget

Very simple to use animated battery gauge widget.

Screenshots

  • Horizontal gauge mode
  • Vertical gauge mode
  • Horizontal grid mode

Features

  • Both animated and static widgets exist. AnimatedBatteryGauge is animated version, and BatteryGauge is non-animated version.
  • Both horizontal and vertical widgets are supported. See screenshot above.
  • Starting from version 0.2.0, the widget takes mode parameter, which takes BatteryGaugePaintMode. You can take either gauge, grid, or none as the mode parameter.

Getting started

Please see example app under example folder.

Usage

It is as simple as using BatteryGauge or AnimatedBatteryGauge as your child widget.

Widget build(BuildContext context) {
  return CupertinoPageScaffold(
    navigationBar: CupertinoNavigationBar(
      middle: Text('Animated Battery Demo'),
    ),
    child: Center(
      child: AnimatedBatteryGauge(
        duration: Duration(seconds: 2),
        value: 60,
        size: Size(150, 70),
        borderColor: CupertinoColors.systemGrey,
        valueColor: CupertinoColors.activeGreen,
        mode: BatteryGaugePaintMode.gauge,
        hasText: true,
      ),
    ),
  );
}

About

A simple, easily customizable battery widget

License:BSD 3-Clause "New" or "Revised" License


Languages

Language:C++ 35.0%Language:CMake 30.8%Language:Dart 22.7%Language:C 3.1%Language:HTML 2.8%Language:Swift 2.0%Language:Shell 1.6%Language:Objective-C 1.0%Language:Java 0.9%Language:Kotlin 0.2%