Moved the default BinaryMessenger instance to ServicesBinding (#38464)

* Moved the default BinaryMessenger instance to ServicesBinding

This reverts commit 821602aef3.

* Added assertion in defaultBinaryMessenger. Also fixed the devicelab tests.
This commit is contained in:
adazh
2019-08-21 16:47:42 -07:00
committed by GitHub
parent ddb10dd9d1
commit 93c32c4ff6
32 changed files with 251 additions and 158 deletions

View File

@@ -20,6 +20,8 @@ Future<void> main() async {
final int port = httpServer.port;
print('Listening on port $port.');
// Initializes bindings before using any platform channels.
WidgetsFlutterBinding.ensureInitialized();
final ByteData byteData = await rootBundle.load('images/coast.jpg');
final Uint8List bytes = byteData.buffer
.asUint8List(byteData.offsetInBytes, byteData.lengthInBytes);