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';
var cmd = 'https://dmsdev-api.eksad.com/gateway/medapp/v1/cmd';
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(
Uri.parse('$cmd/contact/save'),
body: jsonEncode({
......@@ -17,12 +17,12 @@ Future savecontact(nama, email, nohp, message) async {
headers: {
'Content-type': 'application/json; charset=UTF-8',
});
// if (response.statusCode == 200) {
// return true;
// } else {
// return false;
// }
return response.statusCode;
if (response.statusCode == 200) {
return true;
} else {
return false;
}
// return response.statusCode;
}
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