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

import '../models/modelos.dart';

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

  Future<Modelos> fetchModelos() async{
    final url = Uri.https(_url, 'PR/api/v1/obtenerProductos');
    final res = await http.get(url);
    final decodedData = jsonDecode(res.body);

    final modelos = Modelos.fromJson(decodedData);
    return modelos;
  }
}