Skip to content

FurkanTskn/batterylevelbar

Repository files navigation

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,
                    ),
                  ),
                
       ),
      ),  
    );  
  }  
}  

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages