Skip to content

Latest commit

 

History

History
62 lines (48 loc) · 1.56 KB

README.md

File metadata and controls

62 lines (48 loc) · 1.56 KB

batterylevelbar

Create different types beautiful battery indicator.

Getting Started

To use this plugin, add 'batterylevelbar' in your pubspec.yaml file. alt text

Set your battery style, level, shape and charging mode view specification.

Example

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

void main() => runApp(MyApp());  
  
class MyApp extends StatelessWidget {  
  @override  
  Widget build(BuildContext context) {  
    return MaterialApp(  
      title: 'Battery Bar Demo',  
      theme: ThemeData(  
        primarySwatch: Colors.blue,  
      ),  
      home: BatteryBarDemo(),  
    );  
  }  
}  
  
class BatteryBarDemo extends StatelessWidget {  
  @override  
  Widget build(BuildContext context) {  
    return Scaffold(  
      body: Center(  
        child: Container(
                width: 300,
                height: 300,
                alignment: Alignment.topLeft,
                color: Colors.transparent,
                  child: CustomPaint(
                    painter: Battery_Level_Painter(
                      x: 200,
                      y: 50,
                      lvl: 8,
                      Style: BatteryIndicatorStyle.sensetive,
                      Thickness: BorderThickness.medium ,
                      chargingMod: false,
                    ),
                  ),
                
       ),
      ),  
    );  
  }  
}