login method

Future login({
  1. required String user,
  2. required String pass,
  3. String host = 'main',
  4. required String app,
  5. required String projectId,
})

se loguea al host */

Implementation

Future login({
  required String user,
  required String pass,
  String host = 'main',
  required String app,
  required String projectId,
}) async {
  //

  //  consulta para loguearse
  var r = await request('/sistema/login/access',
      data: {
        'user': user,
        'pass': pass,
        'app': name,
        'projectId': projectIid
      },
      host: host);

  // marcando el primero uso
  if (firstTimeUse.isEmpty) {
    var ahora = DateTime.now().toIso8601String();
    await LocalStorage.setTo('firstTimeUse', ahora);
    firstTimeUse = ahora;
  }

  await _onLogged();
  return r;
}