Pigeon 3.x: make pigeon

This commit is contained in:
gianlucaparadise 2022-07-15 08:35:06 +02:00
parent 96e0ad4adf
commit 472174f3cc
6 changed files with 1479 additions and 722 deletions

View file

@ -1,4 +1,4 @@
// Autogenerated from Pigeon (v1.0.8), do not edit directly. // Autogenerated from Pigeon (v3.1.0), do not edit directly.
// See also: https://pub.dev/packages/pigeon // See also: https://pub.dev/packages/pigeon
#import <Foundation/Foundation.h> #import <Foundation/Foundation.h>
@protocol FlutterBinaryMessenger; @protocol FlutterBinaryMessenger;
@ -25,6 +25,37 @@ typedef NS_ENUM(NSUInteger, MediaType) {
MediaTypeUser = 6, MediaTypeUser = 6,
}; };
typedef NS_ENUM(NSUInteger, MediaMetadataKey) {
MediaMetadataKeyAlbumArtist = 0,
MediaMetadataKeyAlbumTitle = 1,
MediaMetadataKeyArtist = 2,
MediaMetadataKeyBookTitle = 3,
MediaMetadataKeyBroadcastDate = 4,
MediaMetadataKeyChapterNumber = 5,
MediaMetadataKeyChapterTitle = 6,
MediaMetadataKeyComposer = 7,
MediaMetadataKeyCreationDate = 8,
MediaMetadataKeyDiscNumber = 9,
MediaMetadataKeyEpisodeNumber = 10,
MediaMetadataKeyHeight = 11,
MediaMetadataKeyLocationLatitude = 12,
MediaMetadataKeyLocationLongitude = 13,
MediaMetadataKeyLocationName = 14,
MediaMetadataKeyQueueItemId = 15,
MediaMetadataKeyReleaseDate = 16,
MediaMetadataKeySeasonNumber = 17,
MediaMetadataKeySectionDuration = 18,
MediaMetadataKeySectionStartAbsoluteTime = 19,
MediaMetadataKeySectionStartTimeInContainer = 20,
MediaMetadataKeySectionStartTimeInMedia = 21,
MediaMetadataKeySeriesTitle = 22,
MediaMetadataKeyStudio = 23,
MediaMetadataKeySubtitle = 24,
MediaMetadataKeyTitle = 25,
MediaMetadataKeyTrackNumber = 26,
MediaMetadataKeyWidth = 27,
};
typedef NS_ENUM(NSUInteger, TrackType) { typedef NS_ENUM(NSUInteger, TrackType) {
TrackTypeUnknown = 0, TrackTypeUnknown = 0,
TrackTypeText = 1, TrackTypeText = 1,
@ -64,12 +95,23 @@ typedef NS_ENUM(NSUInteger, PlayerState) {
@class CastMessage; @class CastMessage;
@interface MediaLoadRequestData : NSObject @interface MediaLoadRequestData : NSObject
+ (instancetype)makeWithShouldAutoplay:(nullable NSNumber *)shouldAutoplay
currentTime:(nullable NSNumber *)currentTime
mediaInfo:(nullable MediaInfo *)mediaInfo;
@property(nonatomic, strong, nullable) NSNumber * shouldAutoplay; @property(nonatomic, strong, nullable) NSNumber * shouldAutoplay;
@property(nonatomic, strong, nullable) NSNumber * currentTime; @property(nonatomic, strong, nullable) NSNumber * currentTime;
@property(nonatomic, strong, nullable) MediaInfo * mediaInfo; @property(nonatomic, strong, nullable) MediaInfo * mediaInfo;
@end @end
@interface MediaInfo : NSObject @interface MediaInfo : NSObject
+ (instancetype)makeWithContentId:(nullable NSString *)contentId
streamType:(StreamType)streamType
contentType:(nullable NSString *)contentType
mediaMetadata:(nullable MediaMetadata *)mediaMetadata
mediaTracks:(nullable NSArray<MediaTrack *> *)mediaTracks
streamDuration:(nullable NSNumber *)streamDuration
adBreakClips:(nullable NSArray<AdBreakClipInfo *> *)adBreakClips
customDataAsJson:(nullable NSString *)customDataAsJson;
@property(nonatomic, copy, nullable) NSString * contentId; @property(nonatomic, copy, nullable) NSString * contentId;
@property(nonatomic, assign) StreamType streamType; @property(nonatomic, assign) StreamType streamType;
@property(nonatomic, copy, nullable) NSString * contentType; @property(nonatomic, copy, nullable) NSString * contentType;
@ -81,15 +123,24 @@ typedef NS_ENUM(NSUInteger, PlayerState) {
@end @end
@interface MediaMetadata : NSObject @interface MediaMetadata : NSObject
+ (instancetype)makeWithMediaType:(MediaType)mediaType
webImages:(nullable NSArray<WebImage *> *)webImages;
@property(nonatomic, assign) MediaType mediaType; @property(nonatomic, assign) MediaType mediaType;
@property(nonatomic, strong, nullable) NSArray<WebImage *> * webImages; @property(nonatomic, strong, nullable) NSArray<WebImage *> * webImages;
@end @end
@interface WebImage : NSObject @interface WebImage : NSObject
+ (instancetype)makeWithUrl:(nullable NSString *)url;
@property(nonatomic, copy, nullable) NSString * url; @property(nonatomic, copy, nullable) NSString * url;
@end @end
@interface MediaTrack : NSObject @interface MediaTrack : NSObject
+ (instancetype)makeWithId:(nullable NSNumber *)id
trackType:(TrackType)trackType
name:(nullable NSString *)name
trackSubtype:(TrackSubtype)trackSubtype
contentId:(nullable NSString *)contentId
language:(nullable NSString *)language;
@property(nonatomic, strong, nullable) NSNumber * id; @property(nonatomic, strong, nullable) NSNumber * id;
@property(nonatomic, assign) TrackType trackType; @property(nonatomic, assign) TrackType trackType;
@property(nonatomic, copy, nullable) NSString * name; @property(nonatomic, copy, nullable) NSString * name;
@ -99,6 +150,10 @@ typedef NS_ENUM(NSUInteger, PlayerState) {
@end @end
@interface MediaStatus : NSObject @interface MediaStatus : NSObject
+ (instancetype)makeWithPlayerState:(PlayerState)playerState
isPlayingAd:(nullable NSNumber *)isPlayingAd
mediaInfo:(nullable MediaInfo *)mediaInfo
adBreakStatus:(nullable AdBreakStatus *)adBreakStatus;
@property(nonatomic, assign) PlayerState playerState; @property(nonatomic, assign) PlayerState playerState;
@property(nonatomic, strong, nullable) NSNumber * isPlayingAd; @property(nonatomic, strong, nullable) NSNumber * isPlayingAd;
@property(nonatomic, strong, nullable) MediaInfo * mediaInfo; @property(nonatomic, strong, nullable) MediaInfo * mediaInfo;
@ -106,12 +161,24 @@ typedef NS_ENUM(NSUInteger, PlayerState) {
@end @end
@interface AdBreakStatus : NSObject @interface AdBreakStatus : NSObject
+ (instancetype)makeWithAdBreakId:(nullable NSString *)adBreakId
adBreakClipId:(nullable NSString *)adBreakClipId
whenSkippableMs:(nullable NSNumber *)whenSkippableMs;
@property(nonatomic, copy, nullable) NSString * adBreakId; @property(nonatomic, copy, nullable) NSString * adBreakId;
@property(nonatomic, copy, nullable) NSString * adBreakClipId; @property(nonatomic, copy, nullable) NSString * adBreakClipId;
@property(nonatomic, strong, nullable) NSNumber * whenSkippableMs; @property(nonatomic, strong, nullable) NSNumber * whenSkippableMs;
@end @end
@interface AdBreakClipInfo : NSObject @interface AdBreakClipInfo : NSObject
+ (instancetype)makeWithId:(nullable NSString *)id
title:(nullable NSString *)title
contentId:(nullable NSString *)contentId
contentUrl:(nullable NSString *)contentUrl
clickThroughUrl:(nullable NSString *)clickThroughUrl
durationMs:(nullable NSNumber *)durationMs
imageUrl:(nullable NSString *)imageUrl
mimeType:(nullable NSString *)mimeType
whenSkippableMs:(nullable NSNumber *)whenSkippableMs;
@property(nonatomic, copy, nullable) NSString * id; @property(nonatomic, copy, nullable) NSString * id;
@property(nonatomic, copy, nullable) NSString * title; @property(nonatomic, copy, nullable) NSString * title;
@property(nonatomic, copy, nullable) NSString * contentId; @property(nonatomic, copy, nullable) NSString * contentId;
@ -124,6 +191,12 @@ typedef NS_ENUM(NSUInteger, PlayerState) {
@end @end
@interface MediaQueueItem : NSObject @interface MediaQueueItem : NSObject
+ (instancetype)makeWithItemId:(nullable NSNumber *)itemId
playbackDuration:(nullable NSNumber *)playbackDuration
startTime:(nullable NSNumber *)startTime
media:(nullable MediaInfo *)media
autoplay:(nullable NSNumber *)autoplay
preloadTime:(nullable NSNumber *)preloadTime;
@property(nonatomic, strong, nullable) NSNumber * itemId; @property(nonatomic, strong, nullable) NSNumber * itemId;
@property(nonatomic, strong, nullable) NSNumber * playbackDuration; @property(nonatomic, strong, nullable) NSNumber * playbackDuration;
@property(nonatomic, strong, nullable) NSNumber * startTime; @property(nonatomic, strong, nullable) NSNumber * startTime;
@ -133,12 +206,17 @@ typedef NS_ENUM(NSUInteger, PlayerState) {
@end @end
@interface CastDevice : NSObject @interface CastDevice : NSObject
+ (instancetype)makeWithDeviceId:(nullable NSString *)deviceId
friendlyName:(nullable NSString *)friendlyName
modelName:(nullable NSString *)modelName;
@property(nonatomic, copy, nullable) NSString * deviceId; @property(nonatomic, copy, nullable) NSString * deviceId;
@property(nonatomic, copy, nullable) NSString * friendlyName; @property(nonatomic, copy, nullable) NSString * friendlyName;
@property(nonatomic, copy, nullable) NSString * modelName; @property(nonatomic, copy, nullable) NSString * modelName;
@end @end
@interface CastMessage : NSObject @interface CastMessage : NSObject
+ (instancetype)makeWithNamespace:(nullable NSString *)namespace
message:(nullable NSString *)message;
@property(nonatomic, copy, nullable) NSString * namespace; @property(nonatomic, copy, nullable) NSString * namespace;
@property(nonatomic, copy, nullable) NSString * message; @property(nonatomic, copy, nullable) NSString * message;
@end @end
@ -150,8 +228,10 @@ NSObject<FlutterMessageCodec> *CastHostApiGetCodec(void);
- (void)sendMessageMessage:(CastMessage *)message error:(FlutterError *_Nullable *_Nonnull)error; - (void)sendMessageMessage:(CastMessage *)message error:(FlutterError *_Nullable *_Nonnull)error;
- (void)showCastDialogWithError:(FlutterError *_Nullable *_Nonnull)error; - (void)showCastDialogWithError:(FlutterError *_Nullable *_Nonnull)error;
- (void)setMuteMuted:(NSNumber *)muted error:(FlutterError *_Nullable *_Nonnull)error; - (void)setMuteMuted:(NSNumber *)muted error:(FlutterError *_Nullable *_Nonnull)error;
/// @return `nil` only when `error != nil`.
- (nullable CastDevice *)getCastDeviceWithError:(FlutterError *_Nullable *_Nonnull)error; - (nullable CastDevice *)getCastDeviceWithError:(FlutterError *_Nullable *_Nonnull)error;
- (void)loadMediaLoadRequestDataRequest:(MediaLoadRequestData *)request error:(FlutterError *_Nullable *_Nonnull)error; - (void)loadMediaLoadRequestDataRequest:(MediaLoadRequestData *)request error:(FlutterError *_Nullable *_Nonnull)error;
/// @return `nil` only when `error != nil`.
- (nullable MediaInfo *)getMediaInfoWithError:(FlutterError *_Nullable *_Nonnull)error; - (nullable MediaInfo *)getMediaInfoWithError:(FlutterError *_Nullable *_Nonnull)error;
- (void)playWithError:(FlutterError *_Nullable *_Nonnull)error; - (void)playWithError:(FlutterError *_Nullable *_Nonnull)error;
- (void)pauseWithError:(FlutterError *_Nullable *_Nonnull)error; - (void)pauseWithError:(FlutterError *_Nullable *_Nonnull)error;
@ -161,7 +241,9 @@ NSObject<FlutterMessageCodec> *CastHostApiGetCodec(void);
- (void)queueAppendItemItem:(MediaQueueItem *)item error:(FlutterError *_Nullable *_Nonnull)error; - (void)queueAppendItemItem:(MediaQueueItem *)item error:(FlutterError *_Nullable *_Nonnull)error;
- (void)queueNextItemWithError:(FlutterError *_Nullable *_Nonnull)error; - (void)queueNextItemWithError:(FlutterError *_Nullable *_Nonnull)error;
- (void)queuePrevItemWithError:(FlutterError *_Nullable *_Nonnull)error; - (void)queuePrevItemWithError:(FlutterError *_Nullable *_Nonnull)error;
/// @return `nil` only when `error != nil`.
- (nullable NSNumber *)getQueueItemCountWithError:(FlutterError *_Nullable *_Nonnull)error; - (nullable NSNumber *)getQueueItemCountWithError:(FlutterError *_Nullable *_Nonnull)error;
/// @return `nil` only when `error != nil`.
- (nullable MediaQueueItem *)getQueueItemAtIndexIndex:(NSNumber *)index error:(FlutterError *_Nullable *_Nonnull)error; - (nullable MediaQueueItem *)getQueueItemAtIndexIndex:(NSNumber *)index error:(FlutterError *_Nullable *_Nonnull)error;
@end @end
@ -172,7 +254,7 @@ 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 *> *_Nullable, NSError *_Nullable))completion;
- (void)onCastStateChangedCastState:(NSNumber *)castState completion:(void(^)(NSError *_Nullable))completion; - (void)onCastStateChangedCastState:(NSNumber *)castState completion:(void(^)(NSError *_Nullable))completion;
- (void)onMessageReceivedMessage:(CastMessage *)message completion:(void(^)(NSError *_Nullable))completion; - (void)onMessageReceivedMessage:(CastMessage *)message completion:(void(^)(NSError *_Nullable))completion;
- (void)onSessionStartingWithCompletion:(void(^)(NSError *_Nullable))completion; - (void)onSessionStartingWithCompletion:(void(^)(NSError *_Nullable))completion;

View file

@ -1,4 +1,4 @@
// Autogenerated from Pigeon (v1.0.8), do not edit directly. // Autogenerated from Pigeon (v3.1.0), do not edit directly.
// See also: https://pub.dev/packages/pigeon // See also: https://pub.dev/packages/pigeon
#import "PlatformBridgeApis.h" #import "PlatformBridgeApis.h"
#import <Flutter/Flutter.h> #import <Flutter/Flutter.h>
@ -11,16 +11,25 @@ static NSDictionary<NSString *, id> *wrapResult(id result, FlutterError *error)
NSDictionary *errorDict = (NSDictionary *)[NSNull null]; NSDictionary *errorDict = (NSDictionary *)[NSNull null];
if (error) { if (error) {
errorDict = @{ errorDict = @{
@"code": (error.code ? error.code : [NSNull null]), @"code": (error.code ?: [NSNull null]),
@"message": (error.message ? error.message : [NSNull null]), @"message": (error.message ?: [NSNull null]),
@"details": (error.details ? error.details : [NSNull null]), @"details": (error.details ?: [NSNull null]),
}; };
} }
return @{ return @{
@"result": (result ? result : [NSNull null]), @"result": (result ?: [NSNull null]),
@"error": errorDict, @"error": errorDict,
}; };
} }
static id GetNullableObject(NSDictionary* dict, id key) {
id result = dict[key];
return (result == [NSNull null]) ? nil : result;
}
static id GetNullableObjectAtIndex(NSArray* array, NSInteger key) {
id result = array[key];
return (result == [NSNull null]) ? nil : result;
}
@interface MediaLoadRequestData () @interface MediaLoadRequestData ()
+ (MediaLoadRequestData *)fromMap:(NSDictionary *)dict; + (MediaLoadRequestData *)fromMap:(NSDictionary *)dict;
@ -68,285 +77,344 @@ static NSDictionary<NSString *, id> *wrapResult(id result, FlutterError *error)
@end @end
@implementation MediaLoadRequestData @implementation MediaLoadRequestData
+ (instancetype)makeWithShouldAutoplay:(nullable NSNumber *)shouldAutoplay
currentTime:(nullable NSNumber *)currentTime
mediaInfo:(nullable MediaInfo *)mediaInfo {
MediaLoadRequestData* pigeonResult = [[MediaLoadRequestData alloc] init];
pigeonResult.shouldAutoplay = shouldAutoplay;
pigeonResult.currentTime = currentTime;
pigeonResult.mediaInfo = mediaInfo;
return pigeonResult;
}
+ (MediaLoadRequestData *)fromMap:(NSDictionary *)dict { + (MediaLoadRequestData *)fromMap:(NSDictionary *)dict {
MediaLoadRequestData *result = [[MediaLoadRequestData alloc] init]; MediaLoadRequestData *pigeonResult = [[MediaLoadRequestData alloc] init];
result.shouldAutoplay = dict[@"shouldAutoplay"]; pigeonResult.shouldAutoplay = GetNullableObject(dict, @"shouldAutoplay");
if ((NSNull *)result.shouldAutoplay == [NSNull null]) { pigeonResult.currentTime = GetNullableObject(dict, @"currentTime");
result.shouldAutoplay = nil; pigeonResult.mediaInfo = [MediaInfo fromMap:GetNullableObject(dict, @"mediaInfo")];
} return pigeonResult;
result.currentTime = dict[@"currentTime"];
if ((NSNull *)result.currentTime == [NSNull null]) {
result.currentTime = nil;
}
result.mediaInfo = [MediaInfo fromMap:dict[@"mediaInfo"]];
if ((NSNull *)result.mediaInfo == [NSNull null]) {
result.mediaInfo = nil;
}
return result;
} }
- (NSDictionary *)toMap { - (NSDictionary *)toMap {
return [NSDictionary dictionaryWithObjectsAndKeys:(self.shouldAutoplay ? self.shouldAutoplay : [NSNull null]), @"shouldAutoplay", (self.currentTime ? self.currentTime : [NSNull null]), @"currentTime", (self.mediaInfo ? [self.mediaInfo toMap] : [NSNull null]), @"mediaInfo", nil]; return @{
@"shouldAutoplay" : (self.shouldAutoplay ?: [NSNull null]),
@"currentTime" : (self.currentTime ?: [NSNull null]),
@"mediaInfo" : (self.mediaInfo ? [self.mediaInfo toMap] : [NSNull null]),
};
} }
@end @end
@implementation MediaInfo @implementation MediaInfo
+ (instancetype)makeWithContentId:(nullable NSString *)contentId
streamType:(StreamType)streamType
contentType:(nullable NSString *)contentType
mediaMetadata:(nullable MediaMetadata *)mediaMetadata
mediaTracks:(nullable NSArray<MediaTrack *> *)mediaTracks
streamDuration:(nullable NSNumber *)streamDuration
adBreakClips:(nullable NSArray<AdBreakClipInfo *> *)adBreakClips
customDataAsJson:(nullable NSString *)customDataAsJson {
MediaInfo* pigeonResult = [[MediaInfo alloc] init];
pigeonResult.contentId = contentId;
pigeonResult.streamType = streamType;
pigeonResult.contentType = contentType;
pigeonResult.mediaMetadata = mediaMetadata;
pigeonResult.mediaTracks = mediaTracks;
pigeonResult.streamDuration = streamDuration;
pigeonResult.adBreakClips = adBreakClips;
pigeonResult.customDataAsJson = customDataAsJson;
return pigeonResult;
}
+ (MediaInfo *)fromMap:(NSDictionary *)dict { + (MediaInfo *)fromMap:(NSDictionary *)dict {
MediaInfo *result = [[MediaInfo alloc] init]; MediaInfo *pigeonResult = [[MediaInfo alloc] init];
result.contentId = dict[@"contentId"]; pigeonResult.contentId = GetNullableObject(dict, @"contentId");
if ((NSNull *)result.contentId == [NSNull null]) { pigeonResult.streamType = [GetNullableObject(dict, @"streamType") integerValue];
result.contentId = nil; pigeonResult.contentType = GetNullableObject(dict, @"contentType");
} pigeonResult.mediaMetadata = [MediaMetadata fromMap:GetNullableObject(dict, @"mediaMetadata")];
result.streamType = [dict[@"streamType"] integerValue]; pigeonResult.mediaTracks = GetNullableObject(dict, @"mediaTracks");
result.contentType = dict[@"contentType"]; pigeonResult.streamDuration = GetNullableObject(dict, @"streamDuration");
if ((NSNull *)result.contentType == [NSNull null]) { pigeonResult.adBreakClips = GetNullableObject(dict, @"adBreakClips");
result.contentType = nil; pigeonResult.customDataAsJson = GetNullableObject(dict, @"customDataAsJson");
} return pigeonResult;
result.mediaMetadata = [MediaMetadata fromMap:dict[@"mediaMetadata"]];
if ((NSNull *)result.mediaMetadata == [NSNull null]) {
result.mediaMetadata = nil;
}
result.mediaTracks = dict[@"mediaTracks"];
if ((NSNull *)result.mediaTracks == [NSNull null]) {
result.mediaTracks = nil;
}
result.streamDuration = dict[@"streamDuration"];
if ((NSNull *)result.streamDuration == [NSNull null]) {
result.streamDuration = nil;
}
result.adBreakClips = dict[@"adBreakClips"];
if ((NSNull *)result.adBreakClips == [NSNull null]) {
result.adBreakClips = nil;
}
result.customDataAsJson = dict[@"customDataAsJson"];
if ((NSNull *)result.customDataAsJson == [NSNull null]) {
result.customDataAsJson = nil;
}
return result;
} }
- (NSDictionary *)toMap { - (NSDictionary *)toMap {
return [NSDictionary dictionaryWithObjectsAndKeys:(self.contentId ? self.contentId : [NSNull null]), @"contentId", @(self.streamType), @"streamType", (self.contentType ? self.contentType : [NSNull null]), @"contentType", (self.mediaMetadata ? [self.mediaMetadata toMap] : [NSNull null]), @"mediaMetadata", (self.mediaTracks ? self.mediaTracks : [NSNull null]), @"mediaTracks", (self.streamDuration ? self.streamDuration : [NSNull null]), @"streamDuration", (self.adBreakClips ? self.adBreakClips : [NSNull null]), @"adBreakClips", (self.customDataAsJson ? self.customDataAsJson : [NSNull null]), @"customDataAsJson", nil]; return @{
@"contentId" : (self.contentId ?: [NSNull null]),
@"streamType" : @(self.streamType),
@"contentType" : (self.contentType ?: [NSNull null]),
@"mediaMetadata" : (self.mediaMetadata ? [self.mediaMetadata toMap] : [NSNull null]),
@"mediaTracks" : (self.mediaTracks ?: [NSNull null]),
@"streamDuration" : (self.streamDuration ?: [NSNull null]),
@"adBreakClips" : (self.adBreakClips ?: [NSNull null]),
@"customDataAsJson" : (self.customDataAsJson ?: [NSNull null]),
};
} }
@end @end
@implementation MediaMetadata @implementation MediaMetadata
+ (instancetype)makeWithMediaType:(MediaType)mediaType
webImages:(nullable NSArray<WebImage *> *)webImages {
MediaMetadata* pigeonResult = [[MediaMetadata alloc] init];
pigeonResult.mediaType = mediaType;
pigeonResult.webImages = webImages;
return pigeonResult;
}
+ (MediaMetadata *)fromMap:(NSDictionary *)dict { + (MediaMetadata *)fromMap:(NSDictionary *)dict {
MediaMetadata *result = [[MediaMetadata alloc] init]; MediaMetadata *pigeonResult = [[MediaMetadata alloc] init];
result.mediaType = [dict[@"mediaType"] integerValue]; pigeonResult.mediaType = [GetNullableObject(dict, @"mediaType") integerValue];
result.webImages = dict[@"webImages"]; pigeonResult.webImages = GetNullableObject(dict, @"webImages");
if ((NSNull *)result.webImages == [NSNull null]) { return pigeonResult;
result.webImages = nil;
}
return result;
} }
- (NSDictionary *)toMap { - (NSDictionary *)toMap {
return [NSDictionary dictionaryWithObjectsAndKeys:@(self.mediaType), @"mediaType", (self.webImages ? self.webImages : [NSNull null]), @"webImages", nil]; return @{
@"mediaType" : @(self.mediaType),
@"webImages" : (self.webImages ?: [NSNull null]),
};
} }
@end @end
@implementation WebImage @implementation WebImage
+ (instancetype)makeWithUrl:(nullable NSString *)url {
WebImage* pigeonResult = [[WebImage alloc] init];
pigeonResult.url = url;
return pigeonResult;
}
+ (WebImage *)fromMap:(NSDictionary *)dict { + (WebImage *)fromMap:(NSDictionary *)dict {
WebImage *result = [[WebImage alloc] init]; WebImage *pigeonResult = [[WebImage alloc] init];
result.url = dict[@"url"]; pigeonResult.url = GetNullableObject(dict, @"url");
if ((NSNull *)result.url == [NSNull null]) { return pigeonResult;
result.url = nil;
}
return result;
} }
- (NSDictionary *)toMap { - (NSDictionary *)toMap {
return [NSDictionary dictionaryWithObjectsAndKeys:(self.url ? self.url : [NSNull null]), @"url", nil]; return @{
@"url" : (self.url ?: [NSNull null]),
};
} }
@end @end
@implementation MediaTrack @implementation MediaTrack
+ (instancetype)makeWithId:(nullable NSNumber *)id
trackType:(TrackType)trackType
name:(nullable NSString *)name
trackSubtype:(TrackSubtype)trackSubtype
contentId:(nullable NSString *)contentId
language:(nullable NSString *)language {
MediaTrack* pigeonResult = [[MediaTrack alloc] init];
pigeonResult.id = id;
pigeonResult.trackType = trackType;
pigeonResult.name = name;
pigeonResult.trackSubtype = trackSubtype;
pigeonResult.contentId = contentId;
pigeonResult.language = language;
return pigeonResult;
}
+ (MediaTrack *)fromMap:(NSDictionary *)dict { + (MediaTrack *)fromMap:(NSDictionary *)dict {
MediaTrack *result = [[MediaTrack alloc] init]; MediaTrack *pigeonResult = [[MediaTrack alloc] init];
result.id = dict[@"id"]; pigeonResult.id = GetNullableObject(dict, @"id");
if ((NSNull *)result.id == [NSNull null]) { pigeonResult.trackType = [GetNullableObject(dict, @"trackType") integerValue];
result.id = nil; pigeonResult.name = GetNullableObject(dict, @"name");
} pigeonResult.trackSubtype = [GetNullableObject(dict, @"trackSubtype") integerValue];
result.trackType = [dict[@"trackType"] integerValue]; pigeonResult.contentId = GetNullableObject(dict, @"contentId");
result.name = dict[@"name"]; pigeonResult.language = GetNullableObject(dict, @"language");
if ((NSNull *)result.name == [NSNull null]) { return pigeonResult;
result.name = nil;
}
result.trackSubtype = [dict[@"trackSubtype"] integerValue];
result.contentId = dict[@"contentId"];
if ((NSNull *)result.contentId == [NSNull null]) {
result.contentId = nil;
}
result.language = dict[@"language"];
if ((NSNull *)result.language == [NSNull null]) {
result.language = nil;
}
return result;
} }
- (NSDictionary *)toMap { - (NSDictionary *)toMap {
return [NSDictionary dictionaryWithObjectsAndKeys:(self.id ? self.id : [NSNull null]), @"id", @(self.trackType), @"trackType", (self.name ? self.name : [NSNull null]), @"name", @(self.trackSubtype), @"trackSubtype", (self.contentId ? self.contentId : [NSNull null]), @"contentId", (self.language ? self.language : [NSNull null]), @"language", nil]; return @{
@"id" : (self.id ?: [NSNull null]),
@"trackType" : @(self.trackType),
@"name" : (self.name ?: [NSNull null]),
@"trackSubtype" : @(self.trackSubtype),
@"contentId" : (self.contentId ?: [NSNull null]),
@"language" : (self.language ?: [NSNull null]),
};
} }
@end @end
@implementation MediaStatus @implementation MediaStatus
+ (instancetype)makeWithPlayerState:(PlayerState)playerState
isPlayingAd:(nullable NSNumber *)isPlayingAd
mediaInfo:(nullable MediaInfo *)mediaInfo
adBreakStatus:(nullable AdBreakStatus *)adBreakStatus {
MediaStatus* pigeonResult = [[MediaStatus alloc] init];
pigeonResult.playerState = playerState;
pigeonResult.isPlayingAd = isPlayingAd;
pigeonResult.mediaInfo = mediaInfo;
pigeonResult.adBreakStatus = adBreakStatus;
return pigeonResult;
}
+ (MediaStatus *)fromMap:(NSDictionary *)dict { + (MediaStatus *)fromMap:(NSDictionary *)dict {
MediaStatus *result = [[MediaStatus alloc] init]; MediaStatus *pigeonResult = [[MediaStatus alloc] init];
result.playerState = [dict[@"playerState"] integerValue]; pigeonResult.playerState = [GetNullableObject(dict, @"playerState") integerValue];
result.isPlayingAd = dict[@"isPlayingAd"]; pigeonResult.isPlayingAd = GetNullableObject(dict, @"isPlayingAd");
if ((NSNull *)result.isPlayingAd == [NSNull null]) { pigeonResult.mediaInfo = [MediaInfo fromMap:GetNullableObject(dict, @"mediaInfo")];
result.isPlayingAd = nil; pigeonResult.adBreakStatus = [AdBreakStatus fromMap:GetNullableObject(dict, @"adBreakStatus")];
} return pigeonResult;
result.mediaInfo = [MediaInfo fromMap:dict[@"mediaInfo"]];
if ((NSNull *)result.mediaInfo == [NSNull null]) {
result.mediaInfo = nil;
}
result.adBreakStatus = [AdBreakStatus fromMap:dict[@"adBreakStatus"]];
if ((NSNull *)result.adBreakStatus == [NSNull null]) {
result.adBreakStatus = nil;
}
return result;
} }
- (NSDictionary *)toMap { - (NSDictionary *)toMap {
return [NSDictionary dictionaryWithObjectsAndKeys:@(self.playerState), @"playerState", (self.isPlayingAd ? self.isPlayingAd : [NSNull null]), @"isPlayingAd", (self.mediaInfo ? [self.mediaInfo toMap] : [NSNull null]), @"mediaInfo", (self.adBreakStatus ? [self.adBreakStatus toMap] : [NSNull null]), @"adBreakStatus", nil]; return @{
@"playerState" : @(self.playerState),
@"isPlayingAd" : (self.isPlayingAd ?: [NSNull null]),
@"mediaInfo" : (self.mediaInfo ? [self.mediaInfo toMap] : [NSNull null]),
@"adBreakStatus" : (self.adBreakStatus ? [self.adBreakStatus toMap] : [NSNull null]),
};
} }
@end @end
@implementation AdBreakStatus @implementation AdBreakStatus
+ (instancetype)makeWithAdBreakId:(nullable NSString *)adBreakId
adBreakClipId:(nullable NSString *)adBreakClipId
whenSkippableMs:(nullable NSNumber *)whenSkippableMs {
AdBreakStatus* pigeonResult = [[AdBreakStatus alloc] init];
pigeonResult.adBreakId = adBreakId;
pigeonResult.adBreakClipId = adBreakClipId;
pigeonResult.whenSkippableMs = whenSkippableMs;
return pigeonResult;
}
+ (AdBreakStatus *)fromMap:(NSDictionary *)dict { + (AdBreakStatus *)fromMap:(NSDictionary *)dict {
AdBreakStatus *result = [[AdBreakStatus alloc] init]; AdBreakStatus *pigeonResult = [[AdBreakStatus alloc] init];
result.adBreakId = dict[@"adBreakId"]; pigeonResult.adBreakId = GetNullableObject(dict, @"adBreakId");
if ((NSNull *)result.adBreakId == [NSNull null]) { pigeonResult.adBreakClipId = GetNullableObject(dict, @"adBreakClipId");
result.adBreakId = nil; pigeonResult.whenSkippableMs = GetNullableObject(dict, @"whenSkippableMs");
} return pigeonResult;
result.adBreakClipId = dict[@"adBreakClipId"];
if ((NSNull *)result.adBreakClipId == [NSNull null]) {
result.adBreakClipId = nil;
}
result.whenSkippableMs = dict[@"whenSkippableMs"];
if ((NSNull *)result.whenSkippableMs == [NSNull null]) {
result.whenSkippableMs = nil;
}
return result;
} }
- (NSDictionary *)toMap { - (NSDictionary *)toMap {
return [NSDictionary dictionaryWithObjectsAndKeys:(self.adBreakId ? self.adBreakId : [NSNull null]), @"adBreakId", (self.adBreakClipId ? self.adBreakClipId : [NSNull null]), @"adBreakClipId", (self.whenSkippableMs ? self.whenSkippableMs : [NSNull null]), @"whenSkippableMs", nil]; return @{
@"adBreakId" : (self.adBreakId ?: [NSNull null]),
@"adBreakClipId" : (self.adBreakClipId ?: [NSNull null]),
@"whenSkippableMs" : (self.whenSkippableMs ?: [NSNull null]),
};
} }
@end @end
@implementation AdBreakClipInfo @implementation AdBreakClipInfo
+ (instancetype)makeWithId:(nullable NSString *)id
title:(nullable NSString *)title
contentId:(nullable NSString *)contentId
contentUrl:(nullable NSString *)contentUrl
clickThroughUrl:(nullable NSString *)clickThroughUrl
durationMs:(nullable NSNumber *)durationMs
imageUrl:(nullable NSString *)imageUrl
mimeType:(nullable NSString *)mimeType
whenSkippableMs:(nullable NSNumber *)whenSkippableMs {
AdBreakClipInfo* pigeonResult = [[AdBreakClipInfo alloc] init];
pigeonResult.id = id;
pigeonResult.title = title;
pigeonResult.contentId = contentId;
pigeonResult.contentUrl = contentUrl;
pigeonResult.clickThroughUrl = clickThroughUrl;
pigeonResult.durationMs = durationMs;
pigeonResult.imageUrl = imageUrl;
pigeonResult.mimeType = mimeType;
pigeonResult.whenSkippableMs = whenSkippableMs;
return pigeonResult;
}
+ (AdBreakClipInfo *)fromMap:(NSDictionary *)dict { + (AdBreakClipInfo *)fromMap:(NSDictionary *)dict {
AdBreakClipInfo *result = [[AdBreakClipInfo alloc] init]; AdBreakClipInfo *pigeonResult = [[AdBreakClipInfo alloc] init];
result.id = dict[@"id"]; pigeonResult.id = GetNullableObject(dict, @"id");
if ((NSNull *)result.id == [NSNull null]) { pigeonResult.title = GetNullableObject(dict, @"title");
result.id = nil; pigeonResult.contentId = GetNullableObject(dict, @"contentId");
} pigeonResult.contentUrl = GetNullableObject(dict, @"contentUrl");
result.title = dict[@"title"]; pigeonResult.clickThroughUrl = GetNullableObject(dict, @"clickThroughUrl");
if ((NSNull *)result.title == [NSNull null]) { pigeonResult.durationMs = GetNullableObject(dict, @"durationMs");
result.title = nil; pigeonResult.imageUrl = GetNullableObject(dict, @"imageUrl");
} pigeonResult.mimeType = GetNullableObject(dict, @"mimeType");
result.contentId = dict[@"contentId"]; pigeonResult.whenSkippableMs = GetNullableObject(dict, @"whenSkippableMs");
if ((NSNull *)result.contentId == [NSNull null]) { return pigeonResult;
result.contentId = nil;
}
result.contentUrl = dict[@"contentUrl"];
if ((NSNull *)result.contentUrl == [NSNull null]) {
result.contentUrl = nil;
}
result.clickThroughUrl = dict[@"clickThroughUrl"];
if ((NSNull *)result.clickThroughUrl == [NSNull null]) {
result.clickThroughUrl = nil;
}
result.durationMs = dict[@"durationMs"];
if ((NSNull *)result.durationMs == [NSNull null]) {
result.durationMs = nil;
}
result.imageUrl = dict[@"imageUrl"];
if ((NSNull *)result.imageUrl == [NSNull null]) {
result.imageUrl = nil;
}
result.mimeType = dict[@"mimeType"];
if ((NSNull *)result.mimeType == [NSNull null]) {
result.mimeType = nil;
}
result.whenSkippableMs = dict[@"whenSkippableMs"];
if ((NSNull *)result.whenSkippableMs == [NSNull null]) {
result.whenSkippableMs = nil;
}
return result;
} }
- (NSDictionary *)toMap { - (NSDictionary *)toMap {
return [NSDictionary dictionaryWithObjectsAndKeys:(self.id ? self.id : [NSNull null]), @"id", (self.title ? self.title : [NSNull null]), @"title", (self.contentId ? self.contentId : [NSNull null]), @"contentId", (self.contentUrl ? self.contentUrl : [NSNull null]), @"contentUrl", (self.clickThroughUrl ? self.clickThroughUrl : [NSNull null]), @"clickThroughUrl", (self.durationMs ? self.durationMs : [NSNull null]), @"durationMs", (self.imageUrl ? self.imageUrl : [NSNull null]), @"imageUrl", (self.mimeType ? self.mimeType : [NSNull null]), @"mimeType", (self.whenSkippableMs ? self.whenSkippableMs : [NSNull null]), @"whenSkippableMs", nil]; return @{
@"id" : (self.id ?: [NSNull null]),
@"title" : (self.title ?: [NSNull null]),
@"contentId" : (self.contentId ?: [NSNull null]),
@"contentUrl" : (self.contentUrl ?: [NSNull null]),
@"clickThroughUrl" : (self.clickThroughUrl ?: [NSNull null]),
@"durationMs" : (self.durationMs ?: [NSNull null]),
@"imageUrl" : (self.imageUrl ?: [NSNull null]),
@"mimeType" : (self.mimeType ?: [NSNull null]),
@"whenSkippableMs" : (self.whenSkippableMs ?: [NSNull null]),
};
} }
@end @end
@implementation MediaQueueItem @implementation MediaQueueItem
+ (instancetype)makeWithItemId:(nullable NSNumber *)itemId
playbackDuration:(nullable NSNumber *)playbackDuration
startTime:(nullable NSNumber *)startTime
media:(nullable MediaInfo *)media
autoplay:(nullable NSNumber *)autoplay
preloadTime:(nullable NSNumber *)preloadTime {
MediaQueueItem* pigeonResult = [[MediaQueueItem alloc] init];
pigeonResult.itemId = itemId;
pigeonResult.playbackDuration = playbackDuration;
pigeonResult.startTime = startTime;
pigeonResult.media = media;
pigeonResult.autoplay = autoplay;
pigeonResult.preloadTime = preloadTime;
return pigeonResult;
}
+ (MediaQueueItem *)fromMap:(NSDictionary *)dict { + (MediaQueueItem *)fromMap:(NSDictionary *)dict {
MediaQueueItem *result = [[MediaQueueItem alloc] init]; MediaQueueItem *pigeonResult = [[MediaQueueItem alloc] init];
result.itemId = dict[@"itemId"]; pigeonResult.itemId = GetNullableObject(dict, @"itemId");
if ((NSNull *)result.itemId == [NSNull null]) { pigeonResult.playbackDuration = GetNullableObject(dict, @"playbackDuration");
result.itemId = nil; pigeonResult.startTime = GetNullableObject(dict, @"startTime");
} pigeonResult.media = [MediaInfo fromMap:GetNullableObject(dict, @"media")];
result.playbackDuration = dict[@"playbackDuration"]; pigeonResult.autoplay = GetNullableObject(dict, @"autoplay");
if ((NSNull *)result.playbackDuration == [NSNull null]) { pigeonResult.preloadTime = GetNullableObject(dict, @"preloadTime");
result.playbackDuration = nil; return pigeonResult;
}
result.startTime = dict[@"startTime"];
if ((NSNull *)result.startTime == [NSNull null]) {
result.startTime = nil;
}
result.media = [MediaInfo fromMap:dict[@"media"]];
if ((NSNull *)result.media == [NSNull null]) {
result.media = nil;
}
result.autoplay = dict[@"autoplay"];
if ((NSNull *)result.autoplay == [NSNull null]) {
result.autoplay = nil;
}
result.preloadTime = dict[@"preloadTime"];
if ((NSNull *)result.preloadTime == [NSNull null]) {
result.preloadTime = nil;
}
return result;
} }
- (NSDictionary *)toMap { - (NSDictionary *)toMap {
return [NSDictionary dictionaryWithObjectsAndKeys:(self.itemId ? self.itemId : [NSNull null]), @"itemId", (self.playbackDuration ? self.playbackDuration : [NSNull null]), @"playbackDuration", (self.startTime ? self.startTime : [NSNull null]), @"startTime", (self.media ? [self.media toMap] : [NSNull null]), @"media", (self.autoplay ? self.autoplay : [NSNull null]), @"autoplay", (self.preloadTime ? self.preloadTime : [NSNull null]), @"preloadTime", nil]; return @{
@"itemId" : (self.itemId ?: [NSNull null]),
@"playbackDuration" : (self.playbackDuration ?: [NSNull null]),
@"startTime" : (self.startTime ?: [NSNull null]),
@"media" : (self.media ? [self.media toMap] : [NSNull null]),
@"autoplay" : (self.autoplay ?: [NSNull null]),
@"preloadTime" : (self.preloadTime ?: [NSNull null]),
};
} }
@end @end
@implementation CastDevice @implementation CastDevice
+ (instancetype)makeWithDeviceId:(nullable NSString *)deviceId
friendlyName:(nullable NSString *)friendlyName
modelName:(nullable NSString *)modelName {
CastDevice* pigeonResult = [[CastDevice alloc] init];
pigeonResult.deviceId = deviceId;
pigeonResult.friendlyName = friendlyName;
pigeonResult.modelName = modelName;
return pigeonResult;
}
+ (CastDevice *)fromMap:(NSDictionary *)dict { + (CastDevice *)fromMap:(NSDictionary *)dict {
CastDevice *result = [[CastDevice alloc] init]; CastDevice *pigeonResult = [[CastDevice alloc] init];
result.deviceId = dict[@"deviceId"]; pigeonResult.deviceId = GetNullableObject(dict, @"deviceId");
if ((NSNull *)result.deviceId == [NSNull null]) { pigeonResult.friendlyName = GetNullableObject(dict, @"friendlyName");
result.deviceId = nil; pigeonResult.modelName = GetNullableObject(dict, @"modelName");
} return pigeonResult;
result.friendlyName = dict[@"friendlyName"];
if ((NSNull *)result.friendlyName == [NSNull null]) {
result.friendlyName = nil;
}
result.modelName = dict[@"modelName"];
if ((NSNull *)result.modelName == [NSNull null]) {
result.modelName = nil;
}
return result;
} }
- (NSDictionary *)toMap { - (NSDictionary *)toMap {
return [NSDictionary dictionaryWithObjectsAndKeys:(self.deviceId ? self.deviceId : [NSNull null]), @"deviceId", (self.friendlyName ? self.friendlyName : [NSNull null]), @"friendlyName", (self.modelName ? self.modelName : [NSNull null]), @"modelName", nil]; return @{
@"deviceId" : (self.deviceId ?: [NSNull null]),
@"friendlyName" : (self.friendlyName ?: [NSNull null]),
@"modelName" : (self.modelName ?: [NSNull null]),
};
} }
@end @end
@implementation CastMessage @implementation CastMessage
+ (instancetype)makeWithNamespace:(nullable NSString *)namespace
message:(nullable NSString *)message {
CastMessage* pigeonResult = [[CastMessage alloc] init];
pigeonResult.namespace = namespace;
pigeonResult.message = message;
return pigeonResult;
}
+ (CastMessage *)fromMap:(NSDictionary *)dict { + (CastMessage *)fromMap:(NSDictionary *)dict {
CastMessage *result = [[CastMessage alloc] init]; CastMessage *pigeonResult = [[CastMessage alloc] init];
result.namespace = dict[@"namespace"]; pigeonResult.namespace = GetNullableObject(dict, @"namespace");
if ((NSNull *)result.namespace == [NSNull null]) { pigeonResult.message = GetNullableObject(dict, @"message");
result.namespace = nil; return pigeonResult;
}
result.message = dict[@"message"];
if ((NSNull *)result.message == [NSNull null]) {
result.message = nil;
}
return result;
} }
- (NSDictionary *)toMap { - (NSDictionary *)toMap {
return [NSDictionary dictionaryWithObjectsAndKeys:(self.namespace ? self.namespace : [NSNull null]), @"namespace", (self.message ? self.message : [NSNull null]), @"message", nil]; return @{
@"namespace" : (self.namespace ?: [NSNull null]),
@"message" : (self.message ?: [NSNull null]),
};
} }
@end @end
@ -449,28 +517,28 @@ static NSDictionary<NSString *, id> *wrapResult(id result, FlutterError *error)
@end @end
NSObject<FlutterMessageCodec> *CastHostApiGetCodec() { NSObject<FlutterMessageCodec> *CastHostApiGetCodec() {
static dispatch_once_t s_pred = 0; static dispatch_once_t sPred = 0;
static FlutterStandardMessageCodec *s_sharedObject = nil; static FlutterStandardMessageCodec *sSharedObject = nil;
dispatch_once(&s_pred, ^{ dispatch_once(&sPred, ^{
CastHostApiCodecReaderWriter *readerWriter = [[CastHostApiCodecReaderWriter alloc] init]; CastHostApiCodecReaderWriter *readerWriter = [[CastHostApiCodecReaderWriter alloc] init];
s_sharedObject = [FlutterStandardMessageCodec codecWithReaderWriter:readerWriter]; sSharedObject = [FlutterStandardMessageCodec codecWithReaderWriter:readerWriter];
}); });
return s_sharedObject; return sSharedObject;
} }
void CastHostApiSetup(id<FlutterBinaryMessenger> binaryMessenger, NSObject<CastHostApi> *api) { void CastHostApiSetup(id<FlutterBinaryMessenger> binaryMessenger, NSObject<CastHostApi> *api) {
{ {
FlutterBasicMessageChannel *channel = FlutterBasicMessageChannel *channel =
[FlutterBasicMessageChannel [[FlutterBasicMessageChannel alloc]
messageChannelWithName:@"dev.flutter.pigeon.CastHostApi.sendMessage" initWithName:@"dev.flutter.pigeon.CastHostApi.sendMessage"
binaryMessenger:binaryMessenger binaryMessenger:binaryMessenger
codec:CastHostApiGetCodec()]; codec:CastHostApiGetCodec() ];
if (api) { if (api) {
NSCAssert([api respondsToSelector:@selector(sendMessageMessage:error:)], @"CastHostApi api (%@) doesn't respond to @selector(sendMessageMessage:error:)", api); NSCAssert([api respondsToSelector:@selector(sendMessageMessage:error:)], @"CastHostApi api (%@) doesn't respond to @selector(sendMessageMessage:error:)", api);
[channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) {
NSArray *args = message; NSArray *args = message;
CastMessage *arg_message = args[0]; CastMessage *arg_message = GetNullableObjectAtIndex(args, 0);
FlutterError *error; FlutterError *error;
[api sendMessageMessage:arg_message error:&error]; [api sendMessageMessage:arg_message error:&error];
callback(wrapResult(nil, error)); callback(wrapResult(nil, error));
@ -482,10 +550,10 @@ void CastHostApiSetup(id<FlutterBinaryMessenger> binaryMessenger, NSObject<CastH
} }
{ {
FlutterBasicMessageChannel *channel = FlutterBasicMessageChannel *channel =
[FlutterBasicMessageChannel [[FlutterBasicMessageChannel alloc]
messageChannelWithName:@"dev.flutter.pigeon.CastHostApi.showCastDialog" initWithName:@"dev.flutter.pigeon.CastHostApi.showCastDialog"
binaryMessenger:binaryMessenger binaryMessenger:binaryMessenger
codec:CastHostApiGetCodec()]; codec:CastHostApiGetCodec() ];
if (api) { if (api) {
NSCAssert([api respondsToSelector:@selector(showCastDialogWithError:)], @"CastHostApi api (%@) doesn't respond to @selector(showCastDialogWithError:)", api); NSCAssert([api respondsToSelector:@selector(showCastDialogWithError:)], @"CastHostApi api (%@) doesn't respond to @selector(showCastDialogWithError:)", api);
[channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) {
@ -500,15 +568,15 @@ void CastHostApiSetup(id<FlutterBinaryMessenger> binaryMessenger, NSObject<CastH
} }
{ {
FlutterBasicMessageChannel *channel = FlutterBasicMessageChannel *channel =
[FlutterBasicMessageChannel [[FlutterBasicMessageChannel alloc]
messageChannelWithName:@"dev.flutter.pigeon.CastHostApi.setMute" initWithName:@"dev.flutter.pigeon.CastHostApi.setMute"
binaryMessenger:binaryMessenger binaryMessenger:binaryMessenger
codec:CastHostApiGetCodec()]; codec:CastHostApiGetCodec() ];
if (api) { if (api) {
NSCAssert([api respondsToSelector:@selector(setMuteMuted:error:)], @"CastHostApi api (%@) doesn't respond to @selector(setMuteMuted:error:)", api); NSCAssert([api respondsToSelector:@selector(setMuteMuted:error:)], @"CastHostApi api (%@) doesn't respond to @selector(setMuteMuted:error:)", api);
[channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) {
NSArray *args = message; NSArray *args = message;
NSNumber *arg_muted = args[0]; NSNumber *arg_muted = GetNullableObjectAtIndex(args, 0);
FlutterError *error; FlutterError *error;
[api setMuteMuted:arg_muted error:&error]; [api setMuteMuted:arg_muted error:&error];
callback(wrapResult(nil, error)); callback(wrapResult(nil, error));
@ -520,10 +588,10 @@ void CastHostApiSetup(id<FlutterBinaryMessenger> binaryMessenger, NSObject<CastH
} }
{ {
FlutterBasicMessageChannel *channel = FlutterBasicMessageChannel *channel =
[FlutterBasicMessageChannel [[FlutterBasicMessageChannel alloc]
messageChannelWithName:@"dev.flutter.pigeon.CastHostApi.getCastDevice" initWithName:@"dev.flutter.pigeon.CastHostApi.getCastDevice"
binaryMessenger:binaryMessenger binaryMessenger:binaryMessenger
codec:CastHostApiGetCodec()]; codec:CastHostApiGetCodec() ];
if (api) { if (api) {
NSCAssert([api respondsToSelector:@selector(getCastDeviceWithError:)], @"CastHostApi api (%@) doesn't respond to @selector(getCastDeviceWithError:)", api); NSCAssert([api respondsToSelector:@selector(getCastDeviceWithError:)], @"CastHostApi api (%@) doesn't respond to @selector(getCastDeviceWithError:)", api);
[channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) {
@ -538,15 +606,15 @@ void CastHostApiSetup(id<FlutterBinaryMessenger> binaryMessenger, NSObject<CastH
} }
{ {
FlutterBasicMessageChannel *channel = FlutterBasicMessageChannel *channel =
[FlutterBasicMessageChannel [[FlutterBasicMessageChannel alloc]
messageChannelWithName:@"dev.flutter.pigeon.CastHostApi.loadMediaLoadRequestData" initWithName:@"dev.flutter.pigeon.CastHostApi.loadMediaLoadRequestData"
binaryMessenger:binaryMessenger binaryMessenger:binaryMessenger
codec:CastHostApiGetCodec()]; codec:CastHostApiGetCodec() ];
if (api) { if (api) {
NSCAssert([api respondsToSelector:@selector(loadMediaLoadRequestDataRequest:error:)], @"CastHostApi api (%@) doesn't respond to @selector(loadMediaLoadRequestDataRequest:error:)", api); NSCAssert([api respondsToSelector:@selector(loadMediaLoadRequestDataRequest:error:)], @"CastHostApi api (%@) doesn't respond to @selector(loadMediaLoadRequestDataRequest:error:)", api);
[channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) {
NSArray *args = message; NSArray *args = message;
MediaLoadRequestData *arg_request = args[0]; MediaLoadRequestData *arg_request = GetNullableObjectAtIndex(args, 0);
FlutterError *error; FlutterError *error;
[api loadMediaLoadRequestDataRequest:arg_request error:&error]; [api loadMediaLoadRequestDataRequest:arg_request error:&error];
callback(wrapResult(nil, error)); callback(wrapResult(nil, error));
@ -558,10 +626,10 @@ void CastHostApiSetup(id<FlutterBinaryMessenger> binaryMessenger, NSObject<CastH
} }
{ {
FlutterBasicMessageChannel *channel = FlutterBasicMessageChannel *channel =
[FlutterBasicMessageChannel [[FlutterBasicMessageChannel alloc]
messageChannelWithName:@"dev.flutter.pigeon.CastHostApi.getMediaInfo" initWithName:@"dev.flutter.pigeon.CastHostApi.getMediaInfo"
binaryMessenger:binaryMessenger binaryMessenger:binaryMessenger
codec:CastHostApiGetCodec()]; codec:CastHostApiGetCodec() ];
if (api) { if (api) {
NSCAssert([api respondsToSelector:@selector(getMediaInfoWithError:)], @"CastHostApi api (%@) doesn't respond to @selector(getMediaInfoWithError:)", api); NSCAssert([api respondsToSelector:@selector(getMediaInfoWithError:)], @"CastHostApi api (%@) doesn't respond to @selector(getMediaInfoWithError:)", api);
[channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) {
@ -576,10 +644,10 @@ void CastHostApiSetup(id<FlutterBinaryMessenger> binaryMessenger, NSObject<CastH
} }
{ {
FlutterBasicMessageChannel *channel = FlutterBasicMessageChannel *channel =
[FlutterBasicMessageChannel [[FlutterBasicMessageChannel alloc]
messageChannelWithName:@"dev.flutter.pigeon.CastHostApi.play" initWithName:@"dev.flutter.pigeon.CastHostApi.play"
binaryMessenger:binaryMessenger binaryMessenger:binaryMessenger
codec:CastHostApiGetCodec()]; codec:CastHostApiGetCodec() ];
if (api) { if (api) {
NSCAssert([api respondsToSelector:@selector(playWithError:)], @"CastHostApi api (%@) doesn't respond to @selector(playWithError:)", api); NSCAssert([api respondsToSelector:@selector(playWithError:)], @"CastHostApi api (%@) doesn't respond to @selector(playWithError:)", api);
[channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) {
@ -594,10 +662,10 @@ void CastHostApiSetup(id<FlutterBinaryMessenger> binaryMessenger, NSObject<CastH
} }
{ {
FlutterBasicMessageChannel *channel = FlutterBasicMessageChannel *channel =
[FlutterBasicMessageChannel [[FlutterBasicMessageChannel alloc]
messageChannelWithName:@"dev.flutter.pigeon.CastHostApi.pause" initWithName:@"dev.flutter.pigeon.CastHostApi.pause"
binaryMessenger:binaryMessenger binaryMessenger:binaryMessenger
codec:CastHostApiGetCodec()]; codec:CastHostApiGetCodec() ];
if (api) { if (api) {
NSCAssert([api respondsToSelector:@selector(pauseWithError:)], @"CastHostApi api (%@) doesn't respond to @selector(pauseWithError:)", api); NSCAssert([api respondsToSelector:@selector(pauseWithError:)], @"CastHostApi api (%@) doesn't respond to @selector(pauseWithError:)", api);
[channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) {
@ -612,10 +680,10 @@ void CastHostApiSetup(id<FlutterBinaryMessenger> binaryMessenger, NSObject<CastH
} }
{ {
FlutterBasicMessageChannel *channel = FlutterBasicMessageChannel *channel =
[FlutterBasicMessageChannel [[FlutterBasicMessageChannel alloc]
messageChannelWithName:@"dev.flutter.pigeon.CastHostApi.stop" initWithName:@"dev.flutter.pigeon.CastHostApi.stop"
binaryMessenger:binaryMessenger binaryMessenger:binaryMessenger
codec:CastHostApiGetCodec()]; codec:CastHostApiGetCodec() ];
if (api) { if (api) {
NSCAssert([api respondsToSelector:@selector(stopWithError:)], @"CastHostApi api (%@) doesn't respond to @selector(stopWithError:)", api); NSCAssert([api respondsToSelector:@selector(stopWithError:)], @"CastHostApi api (%@) doesn't respond to @selector(stopWithError:)", api);
[channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) {
@ -630,10 +698,10 @@ void CastHostApiSetup(id<FlutterBinaryMessenger> binaryMessenger, NSObject<CastH
} }
{ {
FlutterBasicMessageChannel *channel = FlutterBasicMessageChannel *channel =
[FlutterBasicMessageChannel [[FlutterBasicMessageChannel alloc]
messageChannelWithName:@"dev.flutter.pigeon.CastHostApi.showTracksChooserDialog" initWithName:@"dev.flutter.pigeon.CastHostApi.showTracksChooserDialog"
binaryMessenger:binaryMessenger binaryMessenger:binaryMessenger
codec:CastHostApiGetCodec()]; codec:CastHostApiGetCodec() ];
if (api) { if (api) {
NSCAssert([api respondsToSelector:@selector(showTracksChooserDialogWithError:)], @"CastHostApi api (%@) doesn't respond to @selector(showTracksChooserDialogWithError:)", api); NSCAssert([api respondsToSelector:@selector(showTracksChooserDialogWithError:)], @"CastHostApi api (%@) doesn't respond to @selector(showTracksChooserDialogWithError:)", api);
[channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) {
@ -648,10 +716,10 @@ void CastHostApiSetup(id<FlutterBinaryMessenger> binaryMessenger, NSObject<CastH
} }
{ {
FlutterBasicMessageChannel *channel = FlutterBasicMessageChannel *channel =
[FlutterBasicMessageChannel [[FlutterBasicMessageChannel alloc]
messageChannelWithName:@"dev.flutter.pigeon.CastHostApi.skipAd" initWithName:@"dev.flutter.pigeon.CastHostApi.skipAd"
binaryMessenger:binaryMessenger binaryMessenger:binaryMessenger
codec:CastHostApiGetCodec()]; codec:CastHostApiGetCodec() ];
if (api) { if (api) {
NSCAssert([api respondsToSelector:@selector(skipAdWithError:)], @"CastHostApi api (%@) doesn't respond to @selector(skipAdWithError:)", api); NSCAssert([api respondsToSelector:@selector(skipAdWithError:)], @"CastHostApi api (%@) doesn't respond to @selector(skipAdWithError:)", api);
[channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) {
@ -666,15 +734,15 @@ void CastHostApiSetup(id<FlutterBinaryMessenger> binaryMessenger, NSObject<CastH
} }
{ {
FlutterBasicMessageChannel *channel = FlutterBasicMessageChannel *channel =
[FlutterBasicMessageChannel [[FlutterBasicMessageChannel alloc]
messageChannelWithName:@"dev.flutter.pigeon.CastHostApi.queueAppendItem" initWithName:@"dev.flutter.pigeon.CastHostApi.queueAppendItem"
binaryMessenger:binaryMessenger binaryMessenger:binaryMessenger
codec:CastHostApiGetCodec()]; codec:CastHostApiGetCodec() ];
if (api) { if (api) {
NSCAssert([api respondsToSelector:@selector(queueAppendItemItem:error:)], @"CastHostApi api (%@) doesn't respond to @selector(queueAppendItemItem:error:)", api); NSCAssert([api respondsToSelector:@selector(queueAppendItemItem:error:)], @"CastHostApi api (%@) doesn't respond to @selector(queueAppendItemItem:error:)", api);
[channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) {
NSArray *args = message; NSArray *args = message;
MediaQueueItem *arg_item = args[0]; MediaQueueItem *arg_item = GetNullableObjectAtIndex(args, 0);
FlutterError *error; FlutterError *error;
[api queueAppendItemItem:arg_item error:&error]; [api queueAppendItemItem:arg_item error:&error];
callback(wrapResult(nil, error)); callback(wrapResult(nil, error));
@ -686,10 +754,10 @@ void CastHostApiSetup(id<FlutterBinaryMessenger> binaryMessenger, NSObject<CastH
} }
{ {
FlutterBasicMessageChannel *channel = FlutterBasicMessageChannel *channel =
[FlutterBasicMessageChannel [[FlutterBasicMessageChannel alloc]
messageChannelWithName:@"dev.flutter.pigeon.CastHostApi.queueNextItem" initWithName:@"dev.flutter.pigeon.CastHostApi.queueNextItem"
binaryMessenger:binaryMessenger binaryMessenger:binaryMessenger
codec:CastHostApiGetCodec()]; codec:CastHostApiGetCodec() ];
if (api) { if (api) {
NSCAssert([api respondsToSelector:@selector(queueNextItemWithError:)], @"CastHostApi api (%@) doesn't respond to @selector(queueNextItemWithError:)", api); NSCAssert([api respondsToSelector:@selector(queueNextItemWithError:)], @"CastHostApi api (%@) doesn't respond to @selector(queueNextItemWithError:)", api);
[channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) {
@ -704,10 +772,10 @@ void CastHostApiSetup(id<FlutterBinaryMessenger> binaryMessenger, NSObject<CastH
} }
{ {
FlutterBasicMessageChannel *channel = FlutterBasicMessageChannel *channel =
[FlutterBasicMessageChannel [[FlutterBasicMessageChannel alloc]
messageChannelWithName:@"dev.flutter.pigeon.CastHostApi.queuePrevItem" initWithName:@"dev.flutter.pigeon.CastHostApi.queuePrevItem"
binaryMessenger:binaryMessenger binaryMessenger:binaryMessenger
codec:CastHostApiGetCodec()]; codec:CastHostApiGetCodec() ];
if (api) { if (api) {
NSCAssert([api respondsToSelector:@selector(queuePrevItemWithError:)], @"CastHostApi api (%@) doesn't respond to @selector(queuePrevItemWithError:)", api); NSCAssert([api respondsToSelector:@selector(queuePrevItemWithError:)], @"CastHostApi api (%@) doesn't respond to @selector(queuePrevItemWithError:)", api);
[channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) {
@ -722,10 +790,10 @@ void CastHostApiSetup(id<FlutterBinaryMessenger> binaryMessenger, NSObject<CastH
} }
{ {
FlutterBasicMessageChannel *channel = FlutterBasicMessageChannel *channel =
[FlutterBasicMessageChannel [[FlutterBasicMessageChannel alloc]
messageChannelWithName:@"dev.flutter.pigeon.CastHostApi.getQueueItemCount" initWithName:@"dev.flutter.pigeon.CastHostApi.getQueueItemCount"
binaryMessenger:binaryMessenger binaryMessenger:binaryMessenger
codec:CastHostApiGetCodec()]; codec:CastHostApiGetCodec() ];
if (api) { if (api) {
NSCAssert([api respondsToSelector:@selector(getQueueItemCountWithError:)], @"CastHostApi api (%@) doesn't respond to @selector(getQueueItemCountWithError:)", api); NSCAssert([api respondsToSelector:@selector(getQueueItemCountWithError:)], @"CastHostApi api (%@) doesn't respond to @selector(getQueueItemCountWithError:)", api);
[channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) {
@ -740,15 +808,15 @@ void CastHostApiSetup(id<FlutterBinaryMessenger> binaryMessenger, NSObject<CastH
} }
{ {
FlutterBasicMessageChannel *channel = FlutterBasicMessageChannel *channel =
[FlutterBasicMessageChannel [[FlutterBasicMessageChannel alloc]
messageChannelWithName:@"dev.flutter.pigeon.CastHostApi.getQueueItemAtIndex" initWithName:@"dev.flutter.pigeon.CastHostApi.getQueueItemAtIndex"
binaryMessenger:binaryMessenger binaryMessenger:binaryMessenger
codec:CastHostApiGetCodec()]; codec:CastHostApiGetCodec() ];
if (api) { if (api) {
NSCAssert([api respondsToSelector:@selector(getQueueItemAtIndexIndex:error:)], @"CastHostApi api (%@) doesn't respond to @selector(getQueueItemAtIndexIndex:error:)", api); NSCAssert([api respondsToSelector:@selector(getQueueItemAtIndexIndex:error:)], @"CastHostApi api (%@) doesn't respond to @selector(getQueueItemAtIndexIndex:error:)", api);
[channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) {
NSArray *args = message; NSArray *args = message;
NSNumber *arg_index = args[0]; NSNumber *arg_index = GetNullableObjectAtIndex(args, 0);
FlutterError *error; FlutterError *error;
MediaQueueItem *output = [api getQueueItemAtIndexIndex:arg_index error:&error]; MediaQueueItem *output = [api getQueueItemAtIndexIndex:arg_index error:&error];
callback(wrapResult(output, error)); callback(wrapResult(output, error));
@ -851,13 +919,13 @@ void CastHostApiSetup(id<FlutterBinaryMessenger> binaryMessenger, NSObject<CastH
@end @end
NSObject<FlutterMessageCodec> *CastFlutterApiGetCodec() { NSObject<FlutterMessageCodec> *CastFlutterApiGetCodec() {
static dispatch_once_t s_pred = 0; static dispatch_once_t sPred = 0;
static FlutterStandardMessageCodec *s_sharedObject = nil; static FlutterStandardMessageCodec *sSharedObject = nil;
dispatch_once(&s_pred, ^{ dispatch_once(&sPred, ^{
CastFlutterApiCodecReaderWriter *readerWriter = [[CastFlutterApiCodecReaderWriter alloc] init]; CastFlutterApiCodecReaderWriter *readerWriter = [[CastFlutterApiCodecReaderWriter alloc] init];
s_sharedObject = [FlutterStandardMessageCodec codecWithReaderWriter:readerWriter]; sSharedObject = [FlutterStandardMessageCodec codecWithReaderWriter:readerWriter];
}); });
return s_sharedObject; return sSharedObject;
} }
@ -866,6 +934,7 @@ NSObject<FlutterMessageCodec> *CastFlutterApiGetCodec() {
@end @end
@implementation CastFlutterApi @implementation CastFlutterApi
- (instancetype)initWithBinaryMessenger:(NSObject<FlutterBinaryMessenger> *)binaryMessenger { - (instancetype)initWithBinaryMessenger:(NSObject<FlutterBinaryMessenger> *)binaryMessenger {
self = [super init]; self = [super init];
if (self) { if (self) {
@ -873,8 +942,7 @@ NSObject<FlutterMessageCodec> *CastFlutterApiGetCodec() {
} }
return self; return self;
} }
- (void)getSessionMessageNamespacesWithCompletion:(void(^)(NSArray<NSString *> *_Nullable, NSError *_Nullable))completion {
- (void)getSessionMessageNamespacesWithCompletion:(void(^)(NSArray<NSString *> *, NSError *_Nullable))completion {
FlutterBasicMessageChannel *channel = FlutterBasicMessageChannel *channel =
[FlutterBasicMessageChannel [FlutterBasicMessageChannel
messageChannelWithName:@"dev.flutter.pigeon.CastFlutterApi.getSessionMessageNamespaces" messageChannelWithName:@"dev.flutter.pigeon.CastFlutterApi.getSessionMessageNamespaces"
@ -891,7 +959,7 @@ NSObject<FlutterMessageCodec> *CastFlutterApiGetCodec() {
messageChannelWithName:@"dev.flutter.pigeon.CastFlutterApi.onCastStateChanged" messageChannelWithName:@"dev.flutter.pigeon.CastFlutterApi.onCastStateChanged"
binaryMessenger:self.binaryMessenger binaryMessenger:self.binaryMessenger
codec:CastFlutterApiGetCodec()]; codec:CastFlutterApiGetCodec()];
[channel sendMessage:@[arg_castState] reply:^(id reply) { [channel sendMessage:@[arg_castState ?: [NSNull null]] reply:^(id reply) {
completion(nil); completion(nil);
}]; }];
} }
@ -901,7 +969,7 @@ NSObject<FlutterMessageCodec> *CastFlutterApiGetCodec() {
messageChannelWithName:@"dev.flutter.pigeon.CastFlutterApi.onMessageReceived" messageChannelWithName:@"dev.flutter.pigeon.CastFlutterApi.onMessageReceived"
binaryMessenger:self.binaryMessenger binaryMessenger:self.binaryMessenger
codec:CastFlutterApiGetCodec()]; codec:CastFlutterApiGetCodec()];
[channel sendMessage:@[arg_message] reply:^(id reply) { [channel sendMessage:@[arg_message ?: [NSNull null]] reply:^(id reply) {
completion(nil); completion(nil);
}]; }];
} }
@ -1001,7 +1069,7 @@ NSObject<FlutterMessageCodec> *CastFlutterApiGetCodec() {
messageChannelWithName:@"dev.flutter.pigeon.CastFlutterApi.onStatusUpdated" messageChannelWithName:@"dev.flutter.pigeon.CastFlutterApi.onStatusUpdated"
binaryMessenger:self.binaryMessenger binaryMessenger:self.binaryMessenger
codec:CastFlutterApiGetCodec()]; codec:CastFlutterApiGetCodec()];
[channel sendMessage:@[arg_mediaStatus] reply:^(id reply) { [channel sendMessage:@[arg_mediaStatus ?: [NSNull null]] reply:^(id reply) {
completion(nil); completion(nil);
}]; }];
} }
@ -1051,7 +1119,7 @@ NSObject<FlutterMessageCodec> *CastFlutterApiGetCodec() {
messageChannelWithName:@"dev.flutter.pigeon.CastFlutterApi.onAdBreakStatusUpdated" messageChannelWithName:@"dev.flutter.pigeon.CastFlutterApi.onAdBreakStatusUpdated"
binaryMessenger:self.binaryMessenger binaryMessenger:self.binaryMessenger
codec:CastFlutterApiGetCodec()]; codec:CastFlutterApiGetCodec()];
[channel sendMessage:@[arg_mediaStatus] reply:^(id reply) { [channel sendMessage:@[arg_mediaStatus ?: [NSNull null]] reply:^(id reply) {
completion(nil); completion(nil);
}]; }];
} }
@ -1071,7 +1139,7 @@ NSObject<FlutterMessageCodec> *CastFlutterApiGetCodec() {
messageChannelWithName:@"dev.flutter.pigeon.CastFlutterApi.onProgressUpdated" messageChannelWithName:@"dev.flutter.pigeon.CastFlutterApi.onProgressUpdated"
binaryMessenger:self.binaryMessenger binaryMessenger:self.binaryMessenger
codec:CastFlutterApiGetCodec()]; codec:CastFlutterApiGetCodec()];
[channel sendMessage:@[arg_progressMs, arg_durationMs] reply:^(id reply) { [channel sendMessage:@[arg_progressMs ?: [NSNull null], arg_durationMs ?: [NSNull null]] reply:^(id reply) {
completion(nil); completion(nil);
}]; }];
} }
@ -1081,7 +1149,7 @@ NSObject<FlutterMessageCodec> *CastFlutterApiGetCodec() {
messageChannelWithName:@"dev.flutter.pigeon.CastFlutterApi.onAdBreakClipProgressUpdated" messageChannelWithName:@"dev.flutter.pigeon.CastFlutterApi.onAdBreakClipProgressUpdated"
binaryMessenger:self.binaryMessenger binaryMessenger:self.binaryMessenger
codec:CastFlutterApiGetCodec()]; codec:CastFlutterApiGetCodec()];
[channel sendMessage:@[arg_adBreakId, arg_adBreakClipId, arg_progressMs, arg_durationMs, arg_whenSkippableMs] reply:^(id reply) { [channel sendMessage:@[arg_adBreakId ?: [NSNull null], arg_adBreakClipId ?: [NSNull null], arg_progressMs ?: [NSNull null], arg_durationMs ?: [NSNull null], arg_whenSkippableMs ?: [NSNull null]] reply:^(id reply) {
completion(nil); completion(nil);
}]; }];
} }
@ -1091,7 +1159,7 @@ NSObject<FlutterMessageCodec> *CastFlutterApiGetCodec() {
messageChannelWithName:@"dev.flutter.pigeon.CastFlutterApi.itemsInsertedInRange" messageChannelWithName:@"dev.flutter.pigeon.CastFlutterApi.itemsInsertedInRange"
binaryMessenger:self.binaryMessenger binaryMessenger:self.binaryMessenger
codec:CastFlutterApiGetCodec()]; codec:CastFlutterApiGetCodec()];
[channel sendMessage:@[arg_insertIndex, arg_insertCount] reply:^(id reply) { [channel sendMessage:@[arg_insertIndex ?: [NSNull null], arg_insertCount ?: [NSNull null]] reply:^(id reply) {
completion(nil); completion(nil);
}]; }];
} }
@ -1111,7 +1179,7 @@ NSObject<FlutterMessageCodec> *CastFlutterApiGetCodec() {
messageChannelWithName:@"dev.flutter.pigeon.CastFlutterApi.itemsRemovedAtIndexes" messageChannelWithName:@"dev.flutter.pigeon.CastFlutterApi.itemsRemovedAtIndexes"
binaryMessenger:self.binaryMessenger binaryMessenger:self.binaryMessenger
codec:CastFlutterApiGetCodec()]; codec:CastFlutterApiGetCodec()];
[channel sendMessage:@[arg_indexes] reply:^(id reply) { [channel sendMessage:@[arg_indexes ?: [NSNull null]] reply:^(id reply) {
completion(nil); completion(nil);
}]; }];
} }
@ -1121,7 +1189,7 @@ NSObject<FlutterMessageCodec> *CastFlutterApiGetCodec() {
messageChannelWithName:@"dev.flutter.pigeon.CastFlutterApi.itemsReorderedAtIndexes" messageChannelWithName:@"dev.flutter.pigeon.CastFlutterApi.itemsReorderedAtIndexes"
binaryMessenger:self.binaryMessenger binaryMessenger:self.binaryMessenger
codec:CastFlutterApiGetCodec()]; codec:CastFlutterApiGetCodec()];
[channel sendMessage:@[arg_indexes, arg_insertBeforeIndex] reply:^(id reply) { [channel sendMessage:@[arg_indexes ?: [NSNull null], arg_insertBeforeIndex ?: [NSNull null]] reply:^(id reply) {
completion(nil); completion(nil);
}]; }];
} }
@ -1131,7 +1199,7 @@ NSObject<FlutterMessageCodec> *CastFlutterApiGetCodec() {
messageChannelWithName:@"dev.flutter.pigeon.CastFlutterApi.itemsUpdatedAtIndexes" messageChannelWithName:@"dev.flutter.pigeon.CastFlutterApi.itemsUpdatedAtIndexes"
binaryMessenger:self.binaryMessenger binaryMessenger:self.binaryMessenger
codec:CastFlutterApiGetCodec()]; codec:CastFlutterApiGetCodec()];
[channel sendMessage:@[arg_indexes] reply:^(id reply) { [channel sendMessage:@[arg_indexes ?: [NSNull null]] reply:^(id reply) {
completion(nil); completion(nil);
}]; }];
} }

File diff suppressed because it is too large Load diff

View file

@ -213,7 +213,7 @@ packages:
name: pigeon name: pigeon
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.8" version: "3.1.0"
pub_semver: pub_semver:
dependency: transitive dependency: transitive
description: description:

View file

@ -16,7 +16,7 @@ dev_dependencies:
dartdoc: ^4.1.0 dartdoc: ^4.1.0
flutter_test: flutter_test:
sdk: flutter sdk: flutter
pigeon: ^1.0.8 pigeon: ^3.1.0
# For information on the generic Dart part of this file, see the # For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec # following page: https://dart.dev/tools/pub/pubspec