Создание коллекций
This commit is contained in:
@@ -6,13 +6,18 @@
|
||||
// @dart = 3.7
|
||||
|
||||
import 'dart:io'; // flutter_ignore: dart_io_import.
|
||||
import 'package:file_picker/file_picker.dart';
|
||||
import 'package:path_provider_android/path_provider_android.dart';
|
||||
import 'package:file_picker/file_picker.dart';
|
||||
import 'package:path_provider_foundation/path_provider_foundation.dart';
|
||||
import 'package:file_picker/file_picker.dart';
|
||||
import 'package:package_info_plus/package_info_plus.dart';
|
||||
import 'package:path_provider_linux/path_provider_linux.dart';
|
||||
import 'package:share_plus/share_plus.dart';
|
||||
import 'package:url_launcher_linux/url_launcher_linux.dart';
|
||||
import 'package:file_picker/file_picker.dart';
|
||||
import 'package:path_provider_foundation/path_provider_foundation.dart';
|
||||
import 'package:file_picker/file_picker.dart';
|
||||
import 'package:flutter_secure_storage_windows/flutter_secure_storage_windows.dart';
|
||||
import 'package:package_info_plus/package_info_plus.dart';
|
||||
import 'package:path_provider_windows/path_provider_windows.dart';
|
||||
@@ -25,6 +30,15 @@ class _PluginRegistrant {
|
||||
@pragma('vm:entry-point')
|
||||
static void register() {
|
||||
if (Platform.isAndroid) {
|
||||
try {
|
||||
FilePickerIO.registerWith();
|
||||
} catch (err) {
|
||||
print(
|
||||
'`file_picker` threw an error: $err. '
|
||||
'The app may not function as expected until you remove this plugin from pubspec.yaml'
|
||||
);
|
||||
}
|
||||
|
||||
try {
|
||||
PathProviderAndroid.registerWith();
|
||||
} catch (err) {
|
||||
@@ -35,6 +49,15 @@ class _PluginRegistrant {
|
||||
}
|
||||
|
||||
} else if (Platform.isIOS) {
|
||||
try {
|
||||
FilePickerIO.registerWith();
|
||||
} catch (err) {
|
||||
print(
|
||||
'`file_picker` threw an error: $err. '
|
||||
'The app may not function as expected until you remove this plugin from pubspec.yaml'
|
||||
);
|
||||
}
|
||||
|
||||
try {
|
||||
PathProviderFoundation.registerWith();
|
||||
} catch (err) {
|
||||
@@ -45,6 +68,15 @@ class _PluginRegistrant {
|
||||
}
|
||||
|
||||
} else if (Platform.isLinux) {
|
||||
try {
|
||||
FilePickerLinux.registerWith();
|
||||
} catch (err) {
|
||||
print(
|
||||
'`file_picker` threw an error: $err. '
|
||||
'The app may not function as expected until you remove this plugin from pubspec.yaml'
|
||||
);
|
||||
}
|
||||
|
||||
try {
|
||||
PackageInfoPlusLinuxPlugin.registerWith();
|
||||
} catch (err) {
|
||||
@@ -82,6 +114,15 @@ class _PluginRegistrant {
|
||||
}
|
||||
|
||||
} else if (Platform.isMacOS) {
|
||||
try {
|
||||
FilePickerMacOS.registerWith();
|
||||
} catch (err) {
|
||||
print(
|
||||
'`file_picker` threw an error: $err. '
|
||||
'The app may not function as expected until you remove this plugin from pubspec.yaml'
|
||||
);
|
||||
}
|
||||
|
||||
try {
|
||||
PathProviderFoundation.registerWith();
|
||||
} catch (err) {
|
||||
@@ -92,6 +133,15 @@ class _PluginRegistrant {
|
||||
}
|
||||
|
||||
} else if (Platform.isWindows) {
|
||||
try {
|
||||
FilePickerWindows.registerWith();
|
||||
} catch (err) {
|
||||
print(
|
||||
'`file_picker` threw an error: $err. '
|
||||
'The app may not function as expected until you remove this plugin from pubspec.yaml'
|
||||
);
|
||||
}
|
||||
|
||||
try {
|
||||
FlutterSecureStorageWindows.registerWith();
|
||||
} catch (err) {
|
||||
|
||||
Reference in New Issue
Block a user