my_device 0.0.2 copy "my_device: ^0.0.2" to clipboard
my_device: ^0.0.2 copied to clipboard

outdated

Agile and easy access to device information and internet connection alerts

example/lib/main.dart

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

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

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'my_Device',
      theme: ThemeData(
        primarySwatch: Colors.deepPurple,
      ),
      home: const MyHomePage(),
    );
  }
}

class MyHomePage extends StatefulWidget {
  const MyHomePage({
    Key? key,
  }) : super(key: key);

  @override
  State<MyHomePage> createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  @override
  Widget build(BuildContext context) {
    Device(context);
    var screenHeigth = Device.instance.screenHeigth;
    var screenWidth = Device.instance.screenWidth;
    var backgroundAssetPath = Device.instance.backgroundAssetPath;
    // var webDevice = Device.isWeb;
    // var androidDevice = Device.i.isAndroid;
    // var iosDevice = Device.isIOS;

    return Scaffold(
      appBar: AppBar(
        title: const Text('My device'),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: const <Widget>[],
        ),
      ),
    );
  }
}
4
likes
0
points
63
downloads

Publisher

verified publishermisdevelop.app

Weekly Downloads

Agile and easy access to device information and internet connection alerts

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

connectivity_plus, device_info_plus, flutter, handy_dialogs

More

Packages that depend on my_device