device_type 0.0.6 device_type: ^0.0.6 copied to clipboard
A new Flutter plugin used to determine whether the device is a Phone, Phablet, Tablet, or a Larger Device like a Desktop.
0.0.6 #
device_type #
A new Flutter plugin used to determine whether the device is a Phone, Phablet, Tablet, or a Larger Device like a Desktop.
Essential Guide #
Installation #
- Add the latest version of package to your pubspec.yaml (and run
dart pub get
):
dependencies:
device_type: ^0.0.6
- Import the package and use it in your Flutter App.
import 'package:device_type/device_type.dart';
String _getDeviceType(BuildContext context) {
return DeviceType.getDeviceType(context);
}
@override
Widget build(BuildContext context) {
deviceType = _getDeviceType(context);
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('Plugin Device Type'),
),
body: Center(
child: Text('Running on: $deviceType\n'),
),
),
);
}
Package Documentation #
Example of using the library to determine whether the device is a Phone, Phablet, Tablet, or a Larger Device.
Find Package at pub.dev #
Example of using the library to determine whether the device is a Phone, Phablet, Tablet, or a Larger Device.