Browse Source

ComPDFKit(flutter) - bug修复

liuxiaolong 9 months ago
parent
commit
905fb44e32

+ 2 - 2
README.md

@@ -45,8 +45,8 @@ Please install the following required packages:
 Operating Environment Requirements:
 
 * A minSdkVersion of `21` or higher.
-* A `compileSdkVersion` of `30` or higher.
-* A `targetSdkVersion` of `30` or higher.
+* A `compileSdkVersion` of `33` or higher.
+* A `targetSdkVersion` of `33` or higher.
 * Android ABI(s): x86, x86_64, armeabi-v7a, arm64-v8a.
 
 **iOS**

+ 5 - 2
example/ios/Podfile

@@ -31,8 +31,11 @@ target 'Runner' do
   use_frameworks!
   use_modular_headers!
 
-   pod "ComPDFKit", podspec:'https://www.compdf.com/download/ios/cocoapods/xcframeworks/compdfkit/2.0.2-beta.podspec'
-   pod "ComPDFKit_Tools", podspec:'https://www.compdf.com/download/ios/cocoapods/xcframeworks/compdfkit_tools/2.0.2-beta.podspec'
+#    pod "ComPDFKit", podspec:'https://www.compdf.com/download/ios/cocoapods/xcframeworks/compdfkit/2.0.2-beta.podspec'
+#    pod "ComPDFKit_Tools", podspec:'https://www.compdf.com/download/ios/cocoapods/xcframeworks/compdfkit_tools/2.0.2-beta.podspec'
+
+   pod "ComPDFKit_Tools", podspec:'http://test-pdf-pro.kdan.cn:3026/download/ios/cocoapods/xcframeworks/compdfkit_tools/2.0.2.podspec'
+   pod "ComPDFKit", podspec:'http://test-pdf-pro.kdan.cn:3026/download/ios/cocoapods/xcframeworks/compdfkit/2.0.2.podspec'
   flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
   target 'RunnerTests' do
     inherit! :search_paths

+ 8 - 9
example/lib/cpdf_reader_widget_dark_theme_example.dart

@@ -42,14 +42,13 @@ class _CPDFDarkThemeExampleState extends State<CPDFDarkThemeExample> {
               title: const Text('Dark Theme Example'),
             ),
             body: CPDFReaderWidget(
-                document: widget.documentPath,
-                configuration: CPDFConfiguration(
-                    readerViewConfig:
-                        const ReaderViewConfig(themes: CPDFThemes.dark),
-                    globalConfig: const CPDFGlobalConfig(
-                        themeMode: CPDFThemeMode.dark)),
-              onCreated: (controller) {
-
-              },)));
+              document: widget.documentPath,
+              configuration: CPDFConfiguration(
+                toolbarConfig: const ToolbarConfig(
+                    iosLeftBarAvailableActions: [ToolbarAction.thumbnail]),
+                globalConfig: CPDFGlobalConfig(themeMode: CPDFThemeMode.dark)
+              ),
+              onCreated: (controller) {},
+            )));
   }
 }

+ 4 - 1
example/lib/cpdf_reader_widget_example.dart

@@ -41,7 +41,10 @@ class _CPDFReaderWidgetExampleState extends State<CPDFReaderWidgetExample> {
         ),
         body: CPDFReaderWidget(
           document: widget.documentPath,
-          configuration: CPDFConfiguration(toolbarConfig: ToolbarConfig(iosLeftBarAvailableActions: [ToolbarAction.thumbnail]),),
+          configuration: CPDFConfiguration(
+            toolbarConfig: const ToolbarConfig(
+                iosLeftBarAvailableActions: [ToolbarAction.thumbnail]),
+          ),
           onCreated: (controller) {
             setState(() {
               _controller = controller;

+ 5 - 5
example/lib/examples.dart

@@ -39,11 +39,11 @@ List<Widget> examples(BuildContext context) => [
       title: 'Show CPDFReaderWidget',
       description: 'Display PDF view in flutter widget',
       onTap: () => showCPDFReaderWidget(context)),
-  // if (Platform.isAndroid) ...[
-  //   FeatureItem(title: 'Dark Theme',
-  //       description: 'Opens a document in night mode with a custom dark theme',
-  //       onTap: () => showDarkThemeCPDFReaderWidget(context))
-  // ]
+  if (Platform.isAndroid) ...[
+    FeatureItem(title: 'Dark Theme',
+        description: 'Opens a document in night mode with a custom dark theme',
+        onTap: () => showDarkThemeCPDFReaderWidget(context))
+  ]
 ];