-
Notifications
You must be signed in to change notification settings - Fork 30.1k
Description
There are already Java and Objective-C implementations of MethodChannel and the various other Channel and Codec classes for message passing. For plugins for the web platform and Fuchsia, Dart implementations of these classes are needed to decode messages from the client side, but these classes are in package:flutter and so are inaccessible from the platform side.
I suggest splitting these classes out into another package, say package:flutter_channels, and exporting most of the classes from package:flutter/services.dart. Some of the classes directly use BinaryMessages to communicate with the platform side, these can be refactored so that the BinaryMessages dependency is factored out, and in package:flutter we can have implementations MethodChannel in package:flutter which extends a BaseMethodChannel from package:flutter_channels by using BinaryMessages for passing binary messages.
Once we refactor the platform channels code into a platform-independent package, we'll be able to use the same Codec code for Flutter web plugins as in the Flutter framework.