flutter京东SDK插件
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
 
 
 
 
 

26 行
797 B

  1. import 'dart:async';
  2. import 'package:flutter/foundation.dart';
  3. import 'package:flutter/services.dart';
  4. class Jdsdk {
  5. static const MethodChannel _channel = const MethodChannel('jdsdk');
  6. static Future<String> get platformVersion async {
  7. final String version = await _channel.invokeMethod('getPlatformVersion');
  8. return version;
  9. }
  10. ///初始化sdk
  11. static Future<String> init({@required String appKey, @required String appSecret}) async {
  12. var result = await _channel.invokeMethod('init',{"appKey": appKey, "appSecret": appSecret});
  13. return result?.toString();
  14. }
  15. ///打开京东任意url
  16. static Future<String> openUrl({@required String url}) async {
  17. final String version = await _channel.invokeMethod('openUrl',{"url": url});
  18. return version?.toString();
  19. }
  20. }