import 'dart:convert';

import 'package:http/http.dart' as http;

class ValidarTokenProvider{
  final _url = "smart.solerpalau.mx";

  Future<bool> validar(String token) async{
    final url = Uri.https(_url, "PR/api/v1/quiosco/matrizMemoriasCalculo/validarToken");
    final res = await http.post(url,
        headers: {
          "Authorization" : "Bearer $token"
        }
    );

    final dec = jsonDecode(res.body);
    return dec.keys.contains("valido");
  }
}