From 8d0eb4f07dcb8429cdfa3883fe1faaea24501108 Mon Sep 17 00:00:00 2001 From: Tien Do Nam Date: Fri, 29 Nov 2024 17:03:52 +0100 Subject: [PATCH] feat: remove device_info_plus dependency --- packages/pdfx/lib/src/renderer/has_pdf_support.dart | 10 ++-------- packages/pdfx/pubspec.yaml | 1 - 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/packages/pdfx/lib/src/renderer/has_pdf_support.dart b/packages/pdfx/lib/src/renderer/has_pdf_support.dart index b10b9e74..8280ee0a 100644 --- a/packages/pdfx/lib/src/renderer/has_pdf_support.dart +++ b/packages/pdfx/lib/src/renderer/has_pdf_support.dart @@ -1,20 +1,14 @@ import 'dart:async'; -import 'package:device_info_plus/device_info_plus.dart'; import 'package:universal_platform/universal_platform.dart'; -final _deviceInfo = DeviceInfoPlugin(); - Future hasPdfSupport() async { if (UniversalPlatform.isMacOS || UniversalPlatform.isIOS || UniversalPlatform.isWindows || - UniversalPlatform.isWeb) { + UniversalPlatform.isWeb || + UniversalPlatform.isAndroid) { return true; } - if (UniversalPlatform.isAndroid) { - final androidInfo = await _deviceInfo.androidInfo; - return androidInfo.version.sdkInt >= 21; - } return false; } diff --git a/packages/pdfx/pubspec.yaml b/packages/pdfx/pubspec.yaml index 2281dcd8..a3c1900c 100644 --- a/packages/pdfx/pubspec.yaml +++ b/packages/pdfx/pubspec.yaml @@ -14,7 +14,6 @@ dependencies: flutter_web_plugins: sdk: flutter plugin_platform_interface: ^2.1.8 - device_info_plus: ^11.0.0 uuid: ^4.5.0 meta: ^1.15.0 extension: ^0.6.0