prefill property

({String hub, String principal, String token}) get prefill

Prefill values for the login form (last Hub + principal, and the remembered token when one is stored — enabling one-click reconnect).

Implementation

({String hub, String principal, String token}) get prefill {
  final hub = _settings.hub ?? '';
  final principal = _settings.principal ?? '';
  var token = '';
  if (_settings.rememberToken && hub.isNotEmpty) {
    try {
      token =
          _settings.tokenFor(
            OmnyShellService.normalizeHubUri(hub).toString(),
          ) ??
          '';
    } on Object {
      token = '';
    }
  }
  return (hub: hub, principal: principal, token: token);
}