ensureInitialized static method Null safety

LiveTestWidgetsFlutterBinding ensureInitialized()

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.


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