handleMethodCall method

Future handleMethodCall(
  1. MethodCall call
)

Handles method calls over the MethodChannel of this plugin. Note: Check the "federated" architecture for a new way of doing this: https://flutter.dev/go/federated-plugins

Implementation

Future<dynamic> handleMethodCall(MethodCall call) async {
  switch (call.method) {
    case 'isPlatformSupported':
      return html.window.navigator.credentials != null && context.hasProperty("PasswordCredential");
    case 'getLoginData':
      return await getLoginData();
    case 'saveLoginData':
      return await saveLoginData(
        username: call.arguments['username'],
        password: call.arguments['username'],
      );
    case 'disableAutoLogIn':
      return await disableAutoLogIn();
    default:
      throw PlatformException(
        code: 'Unimplemented',
        details: 'autologin_plugin for web doesn\'t implement \'${call.method}\'',
      );
  }
}