Commit 30053f2f authored by Adam Barth's avatar Adam Barth Committed by GitHub

Deprecate HostMessages (#7352)

This class is just an alias for PlatformMessages. We'll remove it after a short
deprecation period.
parent 5c360c83
......@@ -49,7 +49,7 @@ class _HelloServicesState extends State<HelloServices> {
Future<Null> _getLocation() async {
final Map<String, String> message = <String, String>{'provider': 'network'};
final Map<String, dynamic> reply = await HostMessages.sendJSON('getLocation', message);
final Map<String, dynamic> reply = await PlatformMessages.sendJSON('getLocation', message);
// If the widget was removed from the tree while the message was in flight,
// we want to discard the reply rather than calling setState to update our
// non-existent appearance.
......@@ -65,5 +65,5 @@ class _HelloServicesState extends State<HelloServices> {
void main() {
runApp(new HelloServices());
HostMessages.addJSONMessageHandler('getRandom', handleGetRandom);
PlatformMessages.setJSONMessageHandler('getRandom', handleGetRandom);
}
......@@ -6,8 +6,8 @@ import 'dart:async';
import 'platform_messages.dart';
/// A service that can be implemented by the host application and the
/// Flutter framework to exchange application-specific messages.
/// Deprecated. Use [PlatformMessages] instead.
@deprecated
class HostMessages {
/// Send a message to the host application.
static Future<String> sendToHost(String channel, [String message = '']) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment