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:
parent
6e41359fc5
commit
dd8b9dd43e
@ -109,7 +109,7 @@ class FlowyRunner {
|
|||||||
// there's a flag named _enable in memory_leak_detector.dart. If it's false, the task will be ignored.
|
// there's a flag named _enable in memory_leak_detector.dart. If it's false, the task will be ignored.
|
||||||
MemoryLeakDetectorTask(),
|
MemoryLeakDetectorTask(),
|
||||||
const DebugTask(),
|
const DebugTask(),
|
||||||
const DeviceOrApplicationInfoTask(),
|
|
||||||
// localization
|
// localization
|
||||||
const InitLocalizationTask(),
|
const InitLocalizationTask(),
|
||||||
// init the app window
|
// init the app window
|
||||||
@ -122,6 +122,9 @@ class FlowyRunner {
|
|||||||
// init the app widget
|
// init the app widget
|
||||||
// ignore in test mode
|
// ignore in test mode
|
||||||
if (!mode.isUnitTest) ...[
|
if (!mode.isUnitTest) ...[
|
||||||
|
// The DeviceOrApplicationInfoTask should be placed before the AppWidgetTask to fetch the app information.
|
||||||
|
// It is unable to get the device information from the test environment.
|
||||||
|
const DeviceOrApplicationInfoTask(),
|
||||||
const HotKeyTask(),
|
const HotKeyTask(),
|
||||||
if (isSupabaseEnabled) InitSupabaseTask(),
|
if (isSupabaseEnabled) InitSupabaseTask(),
|
||||||
if (isAppFlowyCloudEnabled) InitAppFlowyCloudTask(),
|
if (isAppFlowyCloudEnabled) InitAppFlowyCloudTask(),
|
||||||
|
@ -14,8 +14,6 @@ class DeviceOrApplicationInfoTask extends LaunchTask {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Future<void> initialize(LaunchContext context) async {
|
Future<void> initialize(LaunchContext context) async {
|
||||||
// Can't get the device info from test environment
|
|
||||||
if (!context.env.isTest) {
|
|
||||||
final DeviceInfoPlugin deviceInfoPlugin = DeviceInfoPlugin();
|
final DeviceInfoPlugin deviceInfoPlugin = DeviceInfoPlugin();
|
||||||
final PackageInfo packageInfo = await PackageInfo.fromPlatform();
|
final PackageInfo packageInfo = await PackageInfo.fromPlatform();
|
||||||
|
|
||||||
@ -29,7 +27,6 @@ class DeviceOrApplicationInfoTask extends LaunchTask {
|
|||||||
buildNumber = packageInfo.buildNumber;
|
buildNumber = packageInfo.buildNumber;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Future<void> dispose() async {}
|
Future<void> dispose() async {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user