get_devicetype_onex 1.0.0 copy "get_devicetype_onex: ^1.0.0" to clipboard
get_devicetype_onex: ^1.0.0 copied to clipboard

easily detect device type out of tablet/phablet/mobile. used size and orientation based logic

example/lib/main.dart

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

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

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

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('what is device type '),
        ),
        body: Center(
          child: Text(
              'Device is a: ${GetDeviceTypeOnex.isTabletPhabletOrMobile(context)}\n'),
        ),
      ),
    );
  }
}
1
likes
140
points
53
downloads

Publisher

unverified uploader

Weekly Downloads

easily detect device type out of tablet/phablet/mobile. used size and orientation based logic

Documentation

API reference

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on get_devicetype_onex