flutter/lib/utils/wechat_business_view.dart
2025-09-29 02:34:41 +08:00

20 lines
621 B
Dart
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import 'package:flutter/services.dart';
import 'package:loopin/IM/im_friend_listeners.dart';
class WechatBusinessView {
static const MethodChannel _channel = MethodChannel('wechat_business_view'); // mainactivity.ktappdelegate.swift
/// 调起微信确认收款码
static Future<bool> openBusinessView({required String packageInfo}) async {
try {
final result = await _channel.invokeMethod('openBusinessView', {
'package': packageInfo,
});
return result == true;
} on PlatformException catch (e) {
logger.w('调用失败: ${e.message}');
return false;
}
}
}