ensureInitialized method Null safety

LiveTestWidgetsFlutterBinding ensureInitialized()
override

Returns an instance of the binding that implements LiveTestWidgetsFlutterBinding. If no binding has yet been initialized, the a new instance is created.

Generally, there is no need to call this method. Use TestWidgetsFlutterBinding.ensureInitialized instead, as it will select the correct test binding implementation automatically.

Implementation

static LiveTestWidgetsFlutterBinding ensureInitialized() {
  if (LiveTestWidgetsFlutterBinding._instance == null) {
    LiveTestWidgetsFlutterBinding();
  }
  return LiveTestWidgetsFlutterBinding.instance;
}