DeviceInfoPlugin class
Plugin that manages information related to the platform's device.
This plugin retrieves information from DeviceInfoPlatform
during initialization,
allowing synchronous access from the application or other plugins.
This plugin is automatically created during application initialization and can be accessed from App.package.
Constructors
Properties
- androidDeviceInfo → AndroidDeviceInfo?
-
device information for Android.
no setter
-
app
→ App<
Object> -
The App referenced by the plugin.
no setterinherited
-
dependencies
→ List<
Type> -
The list of other plugins that this plugin depends on.
This property should be used to add the types of other plugins that are required for this Plugin to work.
For example, when using the FirebaseAnalyticsPlugin, you need to include FirebaseCorePlugin.
no setterinherited
- disposed → bool
-
Get whether this Plugin has been disposed.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- initialized → bool
-
Whether this Plugin is initialized or not.
no setterinherited
- iosDeviceInfo → IosDeviceInfo?
-
device information for iOS.
no setter
- linuxInfo → LinuxDeviceInfo?
-
device information for Linux.
no setter
- macOsInfo → MacOsDeviceInfo?
-
device information for macOS.
no setter
-
methodCallLogs
→ List<
MethodCall> -
finalinherited
- name → String
-
The unique name of this Plugin.
This property is referenced in various situations, such as when enabling or disabling the plugin,
and when enabling or disabling the mock, and when communicating with Native code.
no setterinherited
-
Get the list of NavigatorObservers to pass to Patapata for this plugin.
This Observers list will ultimately be added to the App.navigatorObservers list.
no setterinherited
- remoteConfigEnabledKey → String
-
Get the RemoteConfig key name to enable or disable this plugin.
no setterinherited
- requireRemoteConfig → bool
-
This property determines whether initialization should occur after the RemoteConfig system has started when set to true,
or before it starts when set to false.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- webInfo → WebBrowserInfo?
-
device information for WebBrowser.
no setter
- windowsInfo → WindowsDeviceInfo?
-
device information for Windows.
no setter
Methods
-
createAppWidgetWrapper(
Widget child) → Widget -
Wraps the Widget that will ultimately be passed to Flutter's runApp function.
This is used when the plugin needs to wrap App.createAppWidget to add widgets to the App's widget tree.
override
-
createLocalConfig(
) → LocalConfig? -
Specify the LocalConfig to register with Patapata for this plugin.
inherited
-
createRemoteConfig(
) → RemoteConfig? -
Specify the RemoteConfig to register with Patapata for this plugin.
inherited
-
createRemoteMessaging(
) → RemoteMessaging? -
Specify the RemoteMessaging to register with Patapata for this plugin.
inherited
-
dispose(
) → FutureOr< void> -
Disposes this Plugin.
Always call
super.dispose
before any other overridden code. In general you should not call this method as App will do that for you.inherited -
init(
App< Object> app) → FutureOr<bool> -
Executed when a
PatapataApp
run
s or when a this Plugin is added to thePatapataApp
afterrun
. This may return a Future for asynchronous initialization. Always callsuper.init
before any other overridden code.override -
mockPatapataDisable(
) → void -
This is a function to mock patapataDisable running in native code.
It will only be called when kIsTest is true.
inherited
-
mockPatapataEnable(
) → void -
This is a function to mock patapataEnable running in native code.
It will only be called when kIsTest is true.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setMockMethodCallHandler(
) → void -
If your test environment is TargetPlatform.linux, TargetPlatform.windows, Web,
then it assumes that you want to override and specify
DeviceInfoPlatform.instance
, so I'm not considering entering a branch.override -
setMockStreamHandler(
) → void -
A function for mocking a MockStreamHandler.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
-
mockAndroidDeviceInfoMap
↔ Map<
String, dynamic> -
getter/setter pair
-
mockIosDeviceInfoMap
↔ Map<
String, dynamic> -
getter/setter pair
- mockLinuxDeviceInfo ↔ LinuxDeviceInfo
-
getter/setter pair
-
mockMacosDeviceInfoMap
↔ Map<
String, dynamic> -
getter/setter pair
-
mockWebBrowserInfoMap
↔ Map<
String, dynamic> -
getter/setter pair
- mockWindowsDeviceInfo ↔ WindowsDeviceInfo
-
getter/setter pair
Static Methods
-
setMockAndroidDeviceInfo(
{String? id, String? host, String? tags, String? type, String? model, String? board, String? brand, String? device, String? product, String? display, String? hardware, String? bootloader, bool? isPhysicalDevice, String? fingerprint, String? manufacturer, List< String> ? supportedAbis, List<String> ? systemFeatures, List<String> ? supported64BitAbis, List<String> ? supported32BitAbis, Map<String, dynamic> ? version, String? serialNumber, bool? isLowRamDevice}) → void -
Mocks
AndroidDeviceInfo
for testing purposes. -
setMockIosDeviceInfo(
{String? name, String? model, String? modelName, Map< String, dynamic> ? utsname, String? systemName, String? systemVersion, bool? isPhysicalDevice, bool? isiOSAppOnMac, String? localizedModel, String? identifierForVendor}) → void -
Mocks
IosDeviceInfo
for testing purposes. -
setMockLinuxDeviceInfo(
{String? name, String? version, String? id, List< String> ? idLike, String? versionCodename, String? versionId, String? prettyName, String? buildId, String? variant, String? variantId, String? machineId}) → void -
Mocks
LinuxDeviceInfo
for testing purposes. -
setMockMacosDeviceInfo(
{String? arch, String? model, String? modelName, int? activeCPUs, int? memorySize, int? cpuFrequency, String? hostName, String? osRelease, String? computerName, String? kernelVersion, String? systemGUID, int? majorVersion, int? minorVersion, int? patchVersion}) → void -
Mocks
MacOsDeviceInfo
for testing purposes. -
setMockWebBrowserInfo(
{String? browserName, String? appCodeName, String? appName, String? appVersion, double? deviceMemory, String? language, List< String> ? languages, String? platform, String? product, String? productSub, String? userAgent, String? vendor, String? vendorSub, int? hardwareConcurrency, int? maxTouchPoints}) → void -
Mocks
WebBrowserInfo
for testing purposes. -
setMockWindowsDeviceInfo(
{String? computerName, int? numberOfCores, int? systemMemoryInMegabytes, String? userName, int? majorVersion, int? minorVersion, int? buildNumber, int? platformId, String? csdVersion, int? servicePackMajor, int? servicePackMinor, int? suitMask, int? productType, int? reserved, String? buildLab, String? buildLabEx, Uint8List? digitalProductId, String? displayVersion, String? editionId, DateTime? installDate, String? productId, String? productName, String? registeredOwner, String? releaseId, String? deviceId}) → void -
Mocks
WindowsDeviceInfo
for testing purposes.