Просмотр исходного кода

ComPDFKit(flutter) - 1.新增注释

liuxiaolong 1 год назад
Родитель
Сommit
f2db11aa9a
3 измененных файлов с 17 добавлено и 10 удалено
  1. 4 2
      CHANGELOG.md
  2. 10 5
      lib/compdfkit.dart
  3. 3 3
      pubspec.yaml

+ 4 - 2
CHANGELOG.md

@@ -1,3 +1,5 @@
-## 0.0.1
+## 1.0.0
+
+* ComPDFKit SDK for Android V1.9.0
+* ComPDFKit SDK for IOS V1.9.0
 
-* TODO: Describe initial release.

+ 10 - 5
lib/compdfkit.dart

@@ -10,13 +10,14 @@ import 'dart:io';
 import 'package:flutter/services.dart';
 
 class ComPDFKit {
-  static const MethodChannel _methodChannel = MethodChannel('com.compdfkit.flutter.plugin');
+  static const MethodChannel _methodChannel =
+      MethodChannel('com.compdfkit.flutter.plugin');
 
   static const initSDK = 'init_sdk';
   static const sdkVersionCode = 'sdk_version_code';
   static const sdkBuildTag = "sdk_build_tag";
 
-  /// init ComPDFKit sdk, please enter your ComPDFKit key and secret
+  /// init ComPDFKit sdk, please enter your ComPDFKit [key] and [secret]
   static void init(String key, String secret) async {
     _methodChannel.invokeMethod(initSDK, {'key': key, 'secret': secret});
   }
@@ -28,20 +29,24 @@ class ComPDFKit {
     return versionCode;
   }
 
+  /// get ComPDFKit SDK build tag info
   static Future<String> getSDKBuildTag() async {
     String buildTag = await _methodChannel.invokeMethod(ComPDFKit.sdkBuildTag);
     return buildTag;
   }
 
+  /// Pass in the local file path of the PDF document and display it within a newly opened view.
   static void openDocument(String document) async {
     await _methodChannel.invokeMethod('openDocument', document);
   }
 
+  /// Retrieve the temporary directory path of the currently running platform.
+  /// Currently, only [Android] and [IOS] are supported.
   static Future<Directory> getTemporaryDirectory() async {
-    final String? path = await _methodChannel.invokeMethod('getTemporaryDirectory');
+    final String? path =
+        await _methodChannel.invokeMethod('getTemporaryDirectory');
     if (path == null) {
-      throw Exception(
-          'Unable to get temporary directory');
+      throw Exception('Unable to get temporary directory');
     }
     return Directory(path);
   }

+ 3 - 3
pubspec.yaml

@@ -2,9 +2,9 @@ name: compdfkit_flutter
 description: A new Flutter plugin project.
 version: 0.0.1
 homepage: https://www.compdf.com
-# repository: github仓库地址
-# issue_tracker: 反馈地址
-# documentation: 文档网址
+# repository: https://github.com/ComPDFKit/compdfkit_flutter
+# issue_tracker: https://github.com/ComPDFKit/compdfkit_flutter/issues
+# documentation: https://www.compdf.com/guides/pdf-sdk/android/overview
 
 environment:
   sdk: '>=3.0.5 <4.0.0'