import 'dart:async'; import 'package:flutter/foundation.dart'; import 'package:flutter/services.dart'; class Jdsdk { static const MethodChannel _channel = const MethodChannel('jdsdk'); static Future get platformVersion async { final String version = await _channel.invokeMethod('getPlatformVersion'); return version; } ///初始化sdk static Future init({required String appKey, required String appSecret}) async { var result = await _channel.invokeMethod('init',{"appKey": appKey, "appSecret": appSecret}); return result?.toString(); } ///打开京东任意url static Future openUrl({required String url}) async { final String version = await _channel.invokeMethod('openUrl',{"url": url}); return version?.toString(); } }