TDeviceUtils class
Utility class for device-related operations such as screen dimensions, device type detection, system UI control, and device capabilities.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
getAppBarHeight(
) → double - Returns the height of the app bar.
- Returns the height of the bottom navigation bar.
-
getDeviceId(
) → Future< String?> - Returns the device's unique identifier (ID) based on platform.
-
getKeyboardHeight(
) → double - Returns the height of the keyboard.
-
getPixelRatio(
BuildContext? context) → double - Returns the pixel ratio of the current device's display.
-
getScreenHeight(
BuildContext? context) → double - Returns the screen height of the current device.
-
getScreenWidth(
BuildContext context) → double - Returns the screen width of the current device.
-
getStatusBarHeight(
BuildContext? context) → double - Returns the height of the status bar.
-
hasInternetConnection(
) → Future< bool> - Checks if the device has an active internet connection.
-
hideKeyboard(
BuildContext context) → void - Hides the keyboard by requesting focus on an empty node.
-
hideStatusBar(
) → void - Hides the status bar.
-
isAndroid(
) → bool - Returns true if the device is an Android device.
-
isDesktopScreen(
BuildContext context) → bool - Returns true if the device screen is large enough for desktop view.
-
isIOS(
) → bool - Returns true if the device is an iOS device.
-
isLandscapeOrientation(
BuildContext context) → bool - Returns true if the device is in landscape orientation.
-
isMobileScreen(
BuildContext context) → bool - Returns true if the device screen is smaller than tablet size, i.e., mobile.
-
isPhysicalDevice(
) → Future< bool> - Checks if the device is a physical Android or iOS device.
-
isPortraitOrientation(
BuildContext context) → bool - Returns true if the device is in portrait orientation.
-
isTabletScreen(
BuildContext context) → bool - Returns true if the device screen is large enough for tablet view but not desktop.
-
launchWebsiteUrl(
String address) → void - Launches a website using the provided URL.
-
setFullScreen(
bool enable) → void -
Enables or disables full-screen mode based on the
enable
parameter. -
setPreferredOrientations(
List< DeviceOrientation> orientations) → Future<void> - Sets the preferred screen orientations.
-
setStatusBarColor(
Color color) → Future< void> - Sets the status bar color.
-
showStatusBar(
) → void - Shows the status bar.
-
vibrate(
Duration duration) → void -
Triggers a vibration for the given
duration
.