mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2025-07-22 08:27:12 +00:00

* feat: show indicator when importing appflowy data * Update frontend/appflowy_flutter/lib/workspace/presentation/settings/widgets/setting_file_import_appflowy_data_view.dart Co-authored-by: Mathias Mogensen <42929161+Xazin@users.noreply.github.com> * chore: fix analyzer * chore: fix test --------- Co-authored-by: Mathias Mogensen <42929161+Xazin@users.noreply.github.com>
37 lines
1.0 KiB
Dart
37 lines
1.0 KiB
Dart
import 'dart:io';
|
|
|
|
import 'package:device_info_plus/device_info_plus.dart';
|
|
import 'package:package_info_plus/package_info_plus.dart';
|
|
|
|
import '../startup.dart';
|
|
|
|
class DeviceOrApplicationInfoTask extends LaunchTask {
|
|
const DeviceOrApplicationInfoTask();
|
|
|
|
static int androidSDKVersion = -1;
|
|
static String applicationVersion = '';
|
|
static String buildNumber = '';
|
|
|
|
@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();
|
|
|
|
if (Platform.isAndroid) {
|
|
final androidInfo = await deviceInfoPlugin.androidInfo;
|
|
androidSDKVersion = androidInfo.version.sdkInt;
|
|
}
|
|
|
|
if (Platform.isAndroid || Platform.isIOS) {
|
|
applicationVersion = packageInfo.version;
|
|
buildNumber = packageInfo.buildNumber;
|
|
}
|
|
}
|
|
}
|
|
|
|
@override
|
|
Future<void> dispose() async {}
|
|
}
|