Pigeon: Definitions for onCastStateChanged
- Generated Pigeons for `HostApis` in Android and iOS
This commit is contained in:
parent
df223cb80d
commit
c7dfd746d7
5 changed files with 36 additions and 0 deletions
|
|
@ -154,6 +154,13 @@ public class HostApis {
|
||||||
callback.reply(output);
|
callback.reply(output);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
public void onCastStateChanged(Long castStateArg, Reply<Void> callback) {
|
||||||
|
BasicMessageChannel<Object> channel =
|
||||||
|
new BasicMessageChannel<>(binaryMessenger, "dev.flutter.pigeon.CastFlutterApi.onCastStateChanged", getCodec());
|
||||||
|
channel.send(new ArrayList<Object>(Arrays.asList(castStateArg)), channelReply -> {
|
||||||
|
callback.reply(null);
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
private static Map<String, Object> wrapError(Throwable exception) {
|
private static Map<String, Object> wrapError(Throwable exception) {
|
||||||
Map<String, Object> errorMap = new HashMap<>();
|
Map<String, Object> errorMap = new HashMap<>();
|
||||||
|
|
|
||||||
|
|
@ -31,5 +31,6 @@ NSObject<FlutterMessageCodec> *CastFlutterApiGetCodec(void);
|
||||||
@interface CastFlutterApi : NSObject
|
@interface CastFlutterApi : NSObject
|
||||||
- (instancetype)initWithBinaryMessenger:(id<FlutterBinaryMessenger>)binaryMessenger;
|
- (instancetype)initWithBinaryMessenger:(id<FlutterBinaryMessenger>)binaryMessenger;
|
||||||
- (void)getSessionMessageNamespacesWithCompletion:(void(^)(NSArray<NSString *> *, NSError *_Nullable))completion;
|
- (void)getSessionMessageNamespacesWithCompletion:(void(^)(NSArray<NSString *> *, NSError *_Nullable))completion;
|
||||||
|
- (void)onCastStateChangedCastState:(NSNumber *)castState completion:(void(^)(NSError *_Nullable))completion;
|
||||||
@end
|
@end
|
||||||
NS_ASSUME_NONNULL_END
|
NS_ASSUME_NONNULL_END
|
||||||
|
|
|
||||||
|
|
@ -194,4 +194,14 @@ NSObject<FlutterMessageCodec> *CastFlutterApiGetCodec() {
|
||||||
completion(output, nil);
|
completion(output, nil);
|
||||||
}];
|
}];
|
||||||
}
|
}
|
||||||
|
- (void)onCastStateChangedCastState:(NSNumber *)arg_castState completion:(void(^)(NSError *_Nullable))completion {
|
||||||
|
FlutterBasicMessageChannel *channel =
|
||||||
|
[FlutterBasicMessageChannel
|
||||||
|
messageChannelWithName:@"dev.flutter.pigeon.CastFlutterApi.onCastStateChanged"
|
||||||
|
binaryMessenger:self.binaryMessenger
|
||||||
|
codec:CastFlutterApiGetCodec()];
|
||||||
|
[channel sendMessage:@[arg_castState] reply:^(id reply) {
|
||||||
|
completion(nil);
|
||||||
|
}];
|
||||||
|
}
|
||||||
@end
|
@end
|
||||||
|
|
|
||||||
|
|
@ -116,6 +116,7 @@ abstract class CastFlutterApi {
|
||||||
static const MessageCodec<Object?> codec = _CastFlutterApiCodec();
|
static const MessageCodec<Object?> codec = _CastFlutterApiCodec();
|
||||||
|
|
||||||
List<String?> getSessionMessageNamespaces();
|
List<String?> getSessionMessageNamespaces();
|
||||||
|
void onCastStateChanged(int castState);
|
||||||
static void setup(CastFlutterApi? api) {
|
static void setup(CastFlutterApi? api) {
|
||||||
{
|
{
|
||||||
const BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
|
const BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
|
||||||
|
|
@ -130,5 +131,21 @@ abstract class CastFlutterApi {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
{
|
||||||
|
const BasicMessageChannel<Object?> channel = BasicMessageChannel<Object?>(
|
||||||
|
'dev.flutter.pigeon.CastFlutterApi.onCastStateChanged', codec);
|
||||||
|
if (api == null) {
|
||||||
|
channel.setMessageHandler(null);
|
||||||
|
} else {
|
||||||
|
channel.setMessageHandler((Object? message) async {
|
||||||
|
assert(message != null, 'Argument for dev.flutter.pigeon.CastFlutterApi.onCastStateChanged was null.');
|
||||||
|
final List<Object?> args = (message as List<Object?>?)!;
|
||||||
|
final int? arg_castState = args[0] as int?;
|
||||||
|
assert(arg_castState != null, 'Argument for dev.flutter.pigeon.CastFlutterApi.onCastStateChanged was null, expected non-null int.');
|
||||||
|
api.onCastStateChanged(arg_castState!);
|
||||||
|
return;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,4 +14,5 @@ abstract class CastApi {
|
||||||
@FlutterApi()
|
@FlutterApi()
|
||||||
abstract class CastFlutterApi {
|
abstract class CastFlutterApi {
|
||||||
List<String> getSessionMessageNamespaces();
|
List<String> getSessionMessageNamespaces();
|
||||||
|
void onCastStateChanged(int castState);
|
||||||
}
|
}
|
||||||
Loading…
Reference in a new issue