compdfkit.dart 661 B

1234567891011121314151617181920212223242526
  1. import 'package:flutter/services.dart';
  2. import 'package:kmpdfkit_demo/widgets/contains.dart';
  3. class ComPDFKit {
  4. static MethodChannel? _privateChannel;
  5. static MethodChannel get _channel {
  6. if (_privateChannel == null) {
  7. _privateChannel = const MethodChannel(ChannelNames.eventComPDFKitGlobal);
  8. _privateChannel?.setMethodCallHandler(_platformCallHandler);
  9. }
  10. return _privateChannel!;
  11. }
  12. static Future<void> _platformCallHandler(MethodCall call) {
  13. return Future.value();
  14. }
  15. /// gets the ComPDFKit SDK Version Code
  16. static Future<String?> getComPDFKitVersionCode() async => _channel.invokeMethod('ComPDFKitVersion');
  17. }