saveSettingsOTP function
Future<String?>
saveSettingsOTP(
- String _otpPrefix,
- String _otpNumber,
- String _twilioAccountSID,
- String _twilioAuthToken,
- String _twilioServiceId,
- dynamic _nexmoFrom,
- dynamic _nexmoText,
- dynamic _nexmoApiKey,
- dynamic _nexmoApiSecret,
- dynamic _sMSToFrom,
- dynamic _sMSToText,
- dynamic _sMSToApiKey,
)
Implementation
Future<String?> saveSettingsOTP(String _otpPrefix, String _otpNumber,
String _twilioAccountSID, String _twilioAuthToken, String _twilioServiceId,
_nexmoFrom, _nexmoText, _nexmoApiKey, _nexmoApiSecret, _sMSToFrom,
_sMSToText, _sMSToApiKey) async{
appSettings.otpPrefix = _otpPrefix;
appSettings.otpNumber = int.parse(_otpNumber);
appSettings.twilioAccountSID = _twilioAccountSID;
appSettings.twilioAuthToken = _twilioAuthToken;
appSettings.twilioServiceId = _twilioServiceId;
// nexmo
appSettings.nexmoFrom = _nexmoFrom;
appSettings.nexmoText = _nexmoText;
appSettings.nexmoApiKey = _nexmoApiKey;
appSettings.nexmoApiSecret = _nexmoApiSecret;
// sms.to
appSettings.smsToFrom = _sMSToFrom;
appSettings.smsToText = _sMSToText;
appSettings.smsToApiKey = _sMSToApiKey;
var _data = {
"otpEnable": appSettings.otpEnable,
"otpPrefix": appSettings.otpPrefix,
"otpNumber": appSettings.otpNumber,
"otpTwilioEnable": appSettings.otpTwilioEnable,
"twilioAccountSID": appSettings.twilioAccountSID,
"twilioAuthToken": appSettings.twilioAuthToken,
"twilioServiceId": appSettings.twilioServiceId,
// nexmo
"otpNexmoEnable" : appSettings.otpNexmoEnable,
"nexmoFrom" : appSettings.nexmoFrom,
"nexmoText" : appSettings.nexmoText,
"nexmoApiKey" : appSettings.nexmoApiKey,
"nexmoApiSecret" : appSettings.nexmoApiSecret,
// sms.to
"otpSMSToEnable" : appSettings.otpSMSToEnable,
"smsToFrom" : appSettings.smsToFrom,
"smsToText" : appSettings.smsToText,
"smsToApiKey" : appSettings.smsToApiKey,
};
try{
await dbSetDocumentInTable("settings", "main", _data);
}catch(ex){
return "saveSettingsOTP " + ex.toString();
}
return null;
}