mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
fix: unable to get the device info in test mode (#4359)
This commit is contained in:
@ -14,20 +14,17 @@ class DeviceOrApplicationInfoTask extends LaunchTask {
|
||||
|
||||
@override
|
||||
Future<void> initialize(LaunchContext context) async {
|
||||
// Can't get the device info from test environment
|
||||
if (!context.env.isTest) {
|
||||
final DeviceInfoPlugin deviceInfoPlugin = DeviceInfoPlugin();
|
||||
final PackageInfo packageInfo = await PackageInfo.fromPlatform();
|
||||
final DeviceInfoPlugin deviceInfoPlugin = DeviceInfoPlugin();
|
||||
final PackageInfo packageInfo = await PackageInfo.fromPlatform();
|
||||
|
||||
if (Platform.isAndroid) {
|
||||
final androidInfo = await deviceInfoPlugin.androidInfo;
|
||||
androidSDKVersion = androidInfo.version.sdkInt;
|
||||
}
|
||||
if (Platform.isAndroid) {
|
||||
final androidInfo = await deviceInfoPlugin.androidInfo;
|
||||
androidSDKVersion = androidInfo.version.sdkInt;
|
||||
}
|
||||
|
||||
if (Platform.isAndroid || Platform.isIOS) {
|
||||
applicationVersion = packageInfo.version;
|
||||
buildNumber = packageInfo.buildNumber;
|
||||
}
|
||||
if (Platform.isAndroid || Platform.isIOS) {
|
||||
applicationVersion = packageInfo.version;
|
||||
buildNumber = packageInfo.buildNumber;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user