New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove old platform messaging API #8837
Remove old platform messaging API #8837
Conversation
/// An command object representing the invocation of a named method. | ||
class MethodCall { | ||
final String method; | ||
final dynamic arguments; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please put constructors first and doc these member variables.
} | ||
|
||
@override | ||
int get hashCode => method.hashCode ^ (arguments?.hashCode ?? 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use hashValues
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also if possible put == and hashCode together so it's obvious that they're equivalent
import 'message_codecs.dart'; | ||
|
||
/// A JSON [PlatformMethodChannel] for navigation. | ||
const PlatformMethodChannel flutterNavigationChannel = const PlatformMethodChannel( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would be a bit cleaner if there was a class that these channels all belonged to as static members. Perhaps:
SystemChannels.navigation
SystemChannels.platform
etc
|
||
@override | ||
bool operator== (dynamic o) { | ||
if (o is! MethodCall) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should probably be a runtimeType check so that ==
isn't sensitive to the order of its arguments
int get hashCode => method.hashCode ^ (arguments?.hashCode ?? 0); | ||
|
||
@override | ||
String toString() => 'MethodCall($method, $arguments)'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/MethodCall/$runtimeType/
in case someone subclasses it
Breaking change: removed facilities for JSON and string messaging from FlutterView/FlutterViewController, leaving only binary messaging there. All other use of flutter communication now goes through FlutterMessageChannel and FlutterMethodChannels. Retained use of String and JSON codecs for now. Companion flutter PR: flutter/flutter#8837
286e381
to
671bf8e
Compare
Breaking change: removed facilities for JSON and string messaging from FlutterView/FlutterViewController, leaving only binary messaging there. All other use of flutter communication now goes through FlutterMessageChannel and FlutterMethodChannels. Retained use of String and JSON codecs for now. Companion flutter PR: flutter/flutter#8837
Breaking change: removed deprecated methods of PlatformMessages, leaving only binary messaging there. All other use of platform communication now goes through PlatformMessageChannel and PlatformMethodChannels. Retained use of String and JSON codecs for now.
Companion engine PR: flutter/engine#3482