import 'dart:convert';
import 'dart:io';

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

class ValidTokenProvider{
  final String _url = "smart.solerpalau.mx";

  Future<bool> fetchValidToken(String token) async{
    final url = Uri.https(_url, 'PR/api/v1/quiosco/estantes');
    final res = await http.get(url,
        headers: {
          HttpHeaders.authorizationHeader : "Bearer $token"
        }
    );

    final decodedData = jsonDecode(res.body);
    return decodedData['response'];
  }
}