PlatformData class final
Client-side implementation of BrowserPlatform for web browsers.
Constructors
- PlatformData({String baseUrl = '', String currentUrl = '', String userAgent = '', int width = 0, int height = 0, String? language})
- Creates a client-side PlatformData instance.
Properties
- baseUrl → String
-
Base URL. If server-side, it's just '/'.
no setter
- currentUrl → String
-
Current URL without the baseUrl.
Always starts with a leading '/'.
no setter
- device → String
-
Device name.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- height → int
-
Browser screen height.
no setter
- isAndroid → bool
-
Returns
trueif the platform is Android.no setter - isDesktop → bool
-
Returns
trueif the platform is a desktop or laptop.no setter - isiOS → bool
-
Returns
trueif the platform is iOS.no setter - isiPad → bool
-
Returns
trueif the platform is an iPad.no setter - isIphone → bool
-
Returns
trueif the platform is an iPhone.no setter - isMacOS → bool
-
Returns
trueif the platform is MacOS.no setter - isMobile → bool
-
Returns
trueif the platform is mobile.no setter - isMobileBrowser → bool
-
Returns
trueif the application is running on a mobile browser but not as a PWA.no setter - isPWA → bool
-
Returns
trueif the application is running as a Progressive Web App.no setter - isTablet → bool
-
Returns
trueif the platform is tablet.no setter - isWindows → bool
-
Returns
trueif the platform is Windows.no setter - language → String
-
Language.
no setter
- location → Location
-
final
- name → String
-
Browser platform name.
no setter
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- userAgent → String
-
User agent.
no setter
- width → int
-
Browser screen width.
no setter
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
Convert the platform data to a JSON map.
inherited
-
toString(
) → String -
Convert the platform data to a JSON string.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited