ensureInitialized static method Null safety

AutomatedTestWidgetsFlutterBinding ensureInitialized()

Returns an instance of the binding that implements AutomatedTestWidgetsFlutterBinding. 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 AutomatedTestWidgetsFlutterBinding ensureInitialized() {
  if (AutomatedTestWidgetsFlutterBinding._instance == null) {
  return AutomatedTestWidgetsFlutterBinding.instance;