Commit 04723573 authored by Budi Prasetyo's avatar Budi Prasetyo

push

parent 56fc8238
import 'dart:convert';
import 'package:http/http.dart' as http;
var cmd = 'https://dmsdev-api.eksad.com/gateway/medapp/v1/cmd';
var qry = 'https://dmsdev-api.eksad.com/gateway/medapp/v1/qry';
Future<bool> createSosmed (wa, ln, tw, ig, yt) async{
final response = await http.post(
Uri.parse('$cmd/settingsosmed/saveSettingSosmed'),
body: jsonEncode(
{
"whatsapp": wa,
"linkedin": ln,
"twitter": tw,
"instagram": ig,
"youtube": yt
}),
headers: {
'Content-type': 'application/json; charset=UTF-8',
});
if (response.statusCode == 200) {
return true;
} else {
return false;
}
}
Future<bool> updateSosmed (wa,ln,tw,ig,yt) async {
final response = await http
.put(Uri.parse('$cmd/settingsosmed/updateSettingSosmed'),
body: jsonEncode({
'whatsapp': wa,
'linkedin': ln,
'twitter': tw,
'instagram': ig,
'youtube': yt
}),
headers: {
'Content-type': 'application/json; charset=UTF-8',
});
if (response.statusCode == 200) {
return true;
} else {
return false;
}
}
Future<List<dynamic>> getSosmedDesc() async {
var response = await http.get(
Uri.parse('$qry/settingsosmed/getSettingSosmedById'));
// Uri.parse('$qry/settingsosmed/getSettingSosmedByIdDesc'));
return jsonDecode(response.body)['data'];
}
\ No newline at end of file
This diff is collapsed.
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