import 'dart:convert';

import 'package:fluttertoast/fluttertoast.dart';
import 'package:quiosco_soler_2/src/models/imei_model.dart';
import 'package:http/http.dart' as http;

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

  Future<ImeiModel> fetchImei(String imei) async{
    final url = Uri.https(_url, 'PR/api/v1/imeiVerify');
    final response = await http.post(url,
      body: {
        'IMEI' : imei,
        'esIOS': 'No'
      }
    );

    final decodedData = jsonDecode(response.body);
    final res = ImeiModel.fromJson(decodedData);

    return res;
  }
}