device_kit 0.1.1 copy "device_kit: ^0.1.1" to clipboard
device_kit: ^0.1.1 copied to clipboard

PlatformAndroidiOS
outdated

Flutter plugin for Device.

example/lib/main.dart

import 'dart:io';

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

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

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

class _MyAppState extends State<MyApp> {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Device Kit'),
        ),
        body: ListView(
          children: <Widget>[
            ListTile(
              title: const Text('getDeviceId'),
              onTap: () async {
                print('Device Id: ${await Device.getDeviceId()}');
              },
            ),
            ListTile(
              title: const Text('getMac'),
              onTap: () async {
                print('Mac: ${await Device.getMac()}');
              },
            ),
            ListTile(
              title: const Text('isCharging'),
              onTap: () async {
                print('isCharging: ${await Device.isCharging()}');
              },
            ),
            ListTile(
              title: const Text('isSimMounted'),
              onTap: () async {
                print('isSimMounted: ${await Device.isSimMounted()}');
              },
            ),
            ListTile(
              title: const Text('isVPNOn'),
              onTap: () async {
                print('isVPNOn: ${await Device.isVPNOn()}');
              },
            ),
            ListTile(
              title: const Text('localeName'),
              onTap: () {
                print('localeName: ${Platform.localeName}');
              },
            ),
            ListTile(
              title: const Text('timeZone'),
              onTap: () {
                print(
                    'timeZone: ${DateTime.now().timeZoneName} - ${DateTime.now().timeZoneOffset}');
              },
            ),
          ],
        ),
      ),
    );
  }
}
0
likes
135
points
22
downloads

Publisher

verified publisherrxreader.com

Weekly Downloads

Flutter plugin for Device.

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

flutter

More

Packages that depend on device_kit

Packages that implement device_kit