-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Closed
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterp: pigeonrelated to pigeon messaging codegen toolrelated to pigeon messaging codegen toolpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.team-ecosystemOwned by Ecosystem teamOwned by Ecosystem teamtriaged-ecosystemTriaged by Ecosystem teamTriaged by Ecosystem team
Description
Use case
It would be useful to have typesafe event channels in pigeon as these currently have to be created manually (and type safety has to be ensured manually).
Proposal
Automatically translate Stream getters to event channels:
@HostApi()
abstract class VideoPlayerApi {
// The following getter represents the new feature:
Stream<VideoEvent> get videoEvents;
void dispose();
void setLooping(LoopingMessage msg);
void setVolume(VolumeMessage msg);
void play();
PositionMessage position();
void seekTo(PositionMessage msg);
void pause();
void setMixWithOthers(MixWithOthersMessage msg);
}The above example is based on #66710 where an instance of this API represents a single instance of a video player, and so the videoEvents stream would map to an event channel for a particular video player instance.
gaaclarke, splangi, mirzaeiyan, guid-empty, yongjhih and 155 moremirzaeiyan, yongjhih, PascalOtto, hawkkiller, 2shrestha22 and 4 moremirzaeiyan, Foorack, PascalOtto, 2shrestha22, paolorotolo and 7 morePascalOtto, hawkkiller, 2shrestha22, mohachouch, kightsonsanom and 2 more
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listc: new featureNothing broken; request for a new capabilityNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to FlutterA detailed proposal for a change to Flutterp: pigeonrelated to pigeon messaging codegen toolrelated to pigeon messaging codegen toolpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.team-ecosystemOwned by Ecosystem teamOwned by Ecosystem teamtriaged-ecosystemTriaged by Ecosystem teamTriaged by Ecosystem team