awareframework_battery 0.0.5
awareframework_battery: ^0.0.5 copied to clipboard

Flutter Android iOS

The Battery sensor monitors battery information and monitors power related events

example/lib/main.dart

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

void main() => runApp(new MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => new _MyAppState();
}

class _MyAppState extends State<MyApp> {

  BatterySensor sensor;
  BatterySensorConfig config;

  @override
  void initState() {
    super.initState();

    config = BatterySensorConfig()
      ..debug = true;

    sensor = new BatterySensor.init(config);

    sensor.start();
  }

  @override
  Widget build(BuildContext context) {


    return new MaterialApp(
      home: new Scaffold(
          appBar: new AppBar(
            title: const Text('Plugin Example App'),
          ),
          body: new BatteryCard(sensor: sensor,)
      ),
    );
  }
}
0
likes
80
pub points
0%
popularity

The Battery sensor monitors battery information and monitors power related events

Homepage

Documentation

API reference

Uploader

yukinishi55@gmail.com

License

Apache 2.0 (LICENSE)

Dependencies

awareframework_core, flutter

More

Packages that depend on awareframework_battery