Commit 6c281611 authored by qorri_di's avatar qorri_di

contact_api.dart

parent 37c031b2
...@@ -6,7 +6,7 @@ import 'package:medapp_eksad/model/contact_model.dart'; ...@@ -6,7 +6,7 @@ import 'package:medapp_eksad/model/contact_model.dart';
var cmd = 'https://dmsdev-api.eksad.com/gateway/medapp/v1/cmd'; var cmd = 'https://dmsdev-api.eksad.com/gateway/medapp/v1/cmd';
var qry = 'https://dmsdev-api.eksad.com/gateway/medapp/v1/qry'; var qry = 'https://dmsdev-api.eksad.com/gateway/medapp/v1/qry';
Future savecontact(nama, email, nohp, message) async { Future<bool> savecontact(nama, email, nohp, message) async {
final response = await http.post( final response = await http.post(
Uri.parse('$cmd/contact/save'), Uri.parse('$cmd/contact/save'),
body: jsonEncode({ body: jsonEncode({
...@@ -17,12 +17,12 @@ Future savecontact(nama, email, nohp, message) async { ...@@ -17,12 +17,12 @@ Future savecontact(nama, email, nohp, message) async {
headers: { headers: {
'Content-type': 'application/json; charset=UTF-8', 'Content-type': 'application/json; charset=UTF-8',
}); });
// if (response.statusCode == 200) { if (response.statusCode == 200) {
// return true; return true;
// } else { } else {
// return false; return false;
// } }
return response.statusCode; // return response.statusCode;
} }
Future<List<contact>> showcontact() async { Future<List<contact>> showcontact() async {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment