TF-4136 Fix DeviceInfoPlugin is instantiated on every access.

This commit is contained in:
dab246
2026-01-12 11:19:34 +07:00
committed by Dat H. Pham
parent 72e4343398
commit 6601a48984
2 changed files with 5 additions and 1 deletions
+4 -1
View File
@@ -15,8 +15,10 @@ class ApplicationManager {
@visibleForTesting
static DeviceInfoPlugin? debugDeviceInfoOverride;
DeviceInfoPlugin? _deviceInfoCache;
DeviceInfoPlugin get _deviceInfo =>
debugDeviceInfoOverride ?? DeviceInfoPlugin();
debugDeviceInfoOverride ?? (_deviceInfoCache ??= DeviceInfoPlugin());
PackageInfo? _packageInfoCache;
String? _versionCache;
@@ -31,6 +33,7 @@ class ApplicationManager {
_cachedWebUserAgent = null;
_cachedMobileUserAgent = null;
_isMobileUserAgentInitialized = false;
_deviceInfoCache = null;
}
Future<PackageInfo> getPackageInfo() async {