Committed by
GitHub
perf: change baseDeviceInfo to _baseDeviceInfo
Showing
1 changed file
with
6 additions
and
6 deletions
| @@ -15,14 +15,14 @@ class AutoTrackConfigManager { | @@ -15,14 +15,14 @@ class AutoTrackConfigManager { | ||
| 15 | PackageInfo.fromPlatform().then((value) => _appVersion = value.version); | 15 | PackageInfo.fromPlatform().then((value) => _appVersion = value.version); |
| 16 | DeviceInfoPlugin().deviceInfo.then((value) { | 16 | DeviceInfoPlugin().deviceInfo.then((value) { |
| 17 | _deviceInfo = value.data; | 17 | _deviceInfo = value.data; |
| 18 | - baseDeviceInfo = value; | 18 | + _baseDeviceInfo = value; |
| 19 | }); | 19 | }); |
| 20 | } | 20 | } |
| 21 | 21 | ||
| 22 | String _appVersion = ''; | 22 | String _appVersion = ''; |
| 23 | String get appVersion => _appVersion; | 23 | String get appVersion => _appVersion; |
| 24 | 24 | ||
| 25 | - BaseDeviceInfo? baseDeviceInfo; | 25 | + BaseDeviceInfo? _baseDeviceInfo; |
| 26 | String _deviceId = ''; | 26 | String _deviceId = ''; |
| 27 | String get deviceId => _deviceId; | 27 | String get deviceId => _deviceId; |
| 28 | 28 | ||
| @@ -37,10 +37,10 @@ class AutoTrackConfigManager { | @@ -37,10 +37,10 @@ class AutoTrackConfigManager { | ||
| 37 | 37 | ||
| 38 | void updateConfig(AutoTrackConfig config) { | 38 | void updateConfig(AutoTrackConfig config) { |
| 39 | _config = config; | 39 | _config = config; |
| 40 | - if (baseDeviceInfo is IosDeviceInfo) { | ||
| 41 | - _deviceId = md5.convert(utf8.encode('${(baseDeviceInfo as IosDeviceInfo).identifierForVendor}#${config.appKey}')).toString(); | ||
| 42 | - } else if (baseDeviceInfo is AndroidDeviceInfo) { | ||
| 43 | - _deviceId = md5.convert(utf8.encode('${(baseDeviceInfo as AndroidDeviceInfo).serialNumber}#${config.appKey}')).toString(); | 40 | + if (_baseDeviceInfo is IosDeviceInfo) { |
| 41 | + _deviceId = md5.convert(utf8.encode('${(_baseDeviceInfo as IosDeviceInfo).identifierForVendor}#${config.appKey}')).toString(); | ||
| 42 | + } else if (_baseDeviceInfo is AndroidDeviceInfo) { | ||
| 43 | + _deviceId = md5.convert(utf8.encode('${(_baseDeviceInfo as AndroidDeviceInfo).serialNumber}#${config.appKey}')).toString(); | ||
| 44 | } else { | 44 | } else { |
| 45 | _deviceId = ''; | 45 | _deviceId = ''; |
| 46 | } | 46 | } |
-
Please register or login to post a comment