dudas_provider.dart 876 B

12345678910111213141516171819202122232425262728293031323334353637
  1. import 'dart:convert';
  2. import 'package:http/http.dart' as http;
  3. class DudasProvider{
  4. final String _url = "smart.solerpalau.mx";
  5. Future<Map<String, dynamic>> enviarDudas(
  6. String token,
  7. String ncli,
  8. String depa,
  9. String name,
  10. String corc,
  11. String asun,
  12. String ipco,
  13. String mens
  14. ) async{
  15. final url = Uri.https(_url, 'PR/api/v1/quiosco/enviarDudasComentarios');
  16. final res = await http.post(url,
  17. headers: {
  18. 'Authorization' : 'Bearer $token'
  19. },
  20. body: {
  21. 'NCLI' : ncli,
  22. 'DEPA' : depa,
  23. 'NAME' : name,
  24. 'CORC' : corc,
  25. 'ASUN' : asun,
  26. 'IPCO' : ipco,
  27. 'MENS' : mens
  28. }
  29. );
  30. final decodedData = jsonDecode(res.body);
  31. return {'error' : !decodedData['response'], 'mensaje' : decodedData['message']};
  32. }
  33. }