/// Copyright © 2014-2023 PDF Technologies, Inc. All Rights Reserved. /// /// THIS SOURCE CODE AND ANY ACCOMPANYING DOCUMENTATION ARE PROTECTED BY INTERNATIONAL COPYRIGHT LAW /// AND MAY NOT BE RESOLD OR REDISTRIBUTED. USAGE IS BOUND TO THE ComPDFKit LICENSE AGREEMENT. /// UNAUTHORIZED REPRODUCTION OR DISTRIBUTION IS SUBJECT TO CIVIL AND CRIMINAL PENALTIES. /// This notice may not be removed from this file. import 'dart:io'; import 'package:flutter/services.dart'; class ComPDFKit { static const _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 static void init(String key, String secret) async { _methodChannel.invokeMethod(initSDK, {'key': key, 'secret': secret}); } /// get ComPDFKit SDK version code static Future getVersionCode() async { String versionCode = await _methodChannel.invokeMethod(ComPDFKit.sdkVersionCode); return versionCode; } static Future getSDKBuildTag() async { String buildTag = await _methodChannel.invokeMethod(ComPDFKit.sdkBuildTag); return buildTag; } static Future getTemporaryDirectory() async { String path = await _methodChannel.invokeMethod('getTemporaryDirectory'); return Directory(path); } }