Skip to content

Commit

Permalink
🐛 Fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexV525 committed Sep 20, 2024
1 parent 7cca9f2 commit 52c0ebd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions lib/src/fluwx.dart
Original file line number Diff line number Diff line change
Expand Up @@ -129,17 +129,17 @@ class Fluwx {

/// Unsubscribe responses from WeChat
@Deprecated("use [removeSubscriber] instead")
unsubscribeResponse(WeChatResponseSubscriber listener) {
void unsubscribeResponse(WeChatResponseSubscriber listener) {
removeSubscriber(listener);
}

/// remove your subscriber from WeChat
removeSubscriber(WeChatResponseSubscriber listener) {
void removeSubscriber(WeChatResponseSubscriber listener) {
_responseListeners.remove(listener);
}

/// remove all existing
clearSubscribers() {
void clearSubscribers() {
_responseListeners.clear();
}
}
11 changes: 5 additions & 6 deletions lib/src/foundation/cancelable.dart
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,19 @@
* the License.
*/

import '../response/wechat_response.dart';
import 'package:flutter/foundation.dart';

typedef WeChatResponseSubscriber = Function(WeChatResponse response);
mixin FluwxCancelable {
cancel();
void cancel();
}

class FluwxCancelableImpl implements FluwxCancelable {
final Function onCancel;
const FluwxCancelableImpl({required this.onCancel});

FluwxCancelableImpl({required this.onCancel});
final VoidCallback onCancel;

@override
cancel() {
void cancel() {
onCancel();
}
}
1 change: 1 addition & 0 deletions lib/src/response/wechat_response.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import 'dart:typed_data';
const String _errCode = 'errCode';
const String _errStr = 'errStr';

typedef WeChatResponseSubscriber = void Function(WeChatResponse response);
typedef _WeChatResponseInvoker = WeChatResponse Function(Map argument);

Map<String, _WeChatResponseInvoker> _nameAndResponseMapper = {
Expand Down

0 comments on commit 52c0ebd

Please sign in to comment.