import 'dart:io'; import 'package:flutter/material.dart'; import 'package:recording_tool/core/platform/app_platform_info.dart'; class DeviceUtils { DeviceUtils._(); static double screenWidth(BuildContext context) => MediaQuery.sizeOf(context).width; static double screenHeight(BuildContext context) => MediaQuery.sizeOf(context).height; static double topSafePadding(BuildContext context) => MediaQuery.paddingOf(context).top; static double bottomSafePadding(BuildContext context) => MediaQuery.paddingOf(context).bottom; static Future isPhysicalDevice() async { return (await AppPlatformInfo.deviceInfo()).isPhysicalDevice; } static Future> deviceInfo() async { if (!Platform.isAndroid && !Platform.isIOS) { return {'platform': Platform.operatingSystem}; } return (await AppPlatformInfo.deviceInfo()).values; } }