updateMessage method
Implementation
void updateMessage(String key, String value) async {
await SQLService.execute('sp_editMessage',
params: {'messageId': key, 'title': value}).then((data) {
var tmpList = Methods.getList(data, 'thongBao');
if (tmpList.isNotEmpty &&
Methods.getString(tmpList.first, 'message') == 'thanhCong') {
Get.dialog(Dialog(
backgroundColor: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
),
child: Padding(
padding:
const EdgeInsets.only(top: 20, right: 20, left: 20, bottom: 8),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: [
const Text(
'Cập nhật thành công',
style: TextStyle(fontWeight: FontWeight.w600, fontSize: 14),
),
const SizedBox(
height: 8,
),
InkWell(
onTap: () {
Get.back();
},
child: Container(
padding: const EdgeInsets.all(8),
alignment: Alignment.center,
child: const Text(
'OK',
style: TextStyle(color: Color(0xff2a367e)),
),
),
)
]),
),
));
}
});
}