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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user