useAuthEmulator method Null safety

Future<void> useAuthEmulator(
  1. String host,
  2. int port

Changes this instance to point to an Auth emulator running locally.

Set the host of the local emulator, such as "localhost" Set the port of the local emulator, such as "9099" (port 9099 is default for auth package)

Note: Must be called immediately, prior to accessing auth methods. Do not use with production credentials as emulator traffic is not encrypted.


Future<void> useAuthEmulator(String host, int port) async {
  String mappedHost = host;

  if (!kIsWeb && defaultTargetPlatform == {
    if (mappedHost == 'localhost' || mappedHost == '') {
      // ignore: avoid_print
      print('Mapping Auth Emulator host "$mappedHost" to "".');
      mappedHost = '';

  await _delegate.useAuthEmulator(mappedHost, port);