flutter京东SDK插件
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

jdsdk.dart 796 B

2 vuotta sitten
2 vuotta sitten
12345678910111213141516171819202122232425
  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. }