device_type 0.0.1
device_type: ^0.0.1 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.
device_type #
A new Flutter plugin used to determine whether the device is a Phone, Phablet, Tablet, or a Larger Device like a Desktop.
class _MyAppState extends State
@override void initState() { super.initState(); // Call the function to get the device type in initState
}
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'), ), ), ); } }