realtime_battery_indicator 1.0.2 copy "realtime_battery_indicator: ^1.0.2" to clipboard
realtime_battery_indicator: ^1.0.2 copied to clipboard

A realtime good looking customizable battery indicator for all platforms.

example/lib/main.dart

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

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData(
        brightness: Brightness.dark,
        useMaterial3: true,
      ),
      debugShowCheckedModeBanner: false,
      home: const MyHomePage(),
    );
  }
}

class MyHomePage extends StatelessWidget {
  const MyHomePage({super.key});

  @override
  Widget build(BuildContext context) {
    return const Scaffold(
      body: Column(
        children: [
          SizedBox(height: 20),
          Text(
            'Realtime Battery Indicator',
            style: TextStyle(
              fontSize: 20,
              fontWeight: FontWeight.bold,
            ),
          ),
          SizedBox(height: 180),
          Text(
            'With Battery Level',
            style: TextStyle(
              fontSize: 20,
              fontWeight: FontWeight.bold,
            ),
          ),
          SizedBox(height: 10),
          Row(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              BatteryIndicator(),
            ],
          ),
          SizedBox(height: 20),
          Text(
            'Without Battery Level',
            style: TextStyle(
              fontSize: 20,
              fontWeight: FontWeight.bold,
            ),
          ),
          SizedBox(height: 10),
          Row(
            mainAxisAlignment: MainAxisAlignment.center,
            children: [
              BatteryIndicator(
                showBatteryLevel: false,
                size: 20.0,
                textStyle: TextStyle(
                  fontSize: 20.0,
                  fontWeight: FontWeight.bold,
                ),
                duration: Duration(milliseconds: 200),
              ),
            ],
          ),
        ],
      ),
    );
  }
}
2
likes
150
pub points
30%
popularity

Publisher

verified publishermantreshkhurana.com

A realtime good looking customizable battery indicator for all platforms.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

battery_plus, flutter

More

Packages that depend on realtime_battery_indicator