[web] Add BackgroundIsolateBinaryMessenger.ensureInitialized to web. (#145786)
This PR makes the static API of the `BackgroundIsolateBinaryMessenger` consistent between its web and IO implementations. This way, multi-platform applications will compile for the web when using the `ensureInitialized` method (even though it'll throw at runtime, like the `instance` getter, because isolates are not supported on the web). ### Issues * Fixes: https://github.com/flutter/flutter/issues/145260
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
// Copyright 2014 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import 'dart:ui' as ui;
|
||||
import 'package:flutter/services.dart';
|
||||
|
||||
void main() {
|
||||
BackgroundIsolateBinaryMessenger.ensureInitialized(
|
||||
ui.RootIsolateToken.instance!
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user