[Flutter] Fix sending notifications without content
This commit is contained in:
@@ -284,7 +284,9 @@ class _SendRootPageState extends State<SendRootPage> {
|
||||
}
|
||||
|
||||
try {
|
||||
await APIClient.sendMessage(acc.userID!, acc.tokenSend!, _msgContent.text);
|
||||
var content = (_msgContent.text != '') ? _msgContent.text : null;
|
||||
|
||||
await APIClient.sendMessage(acc.userID!, acc.tokenSend!, _msgTitle.text, content: content);
|
||||
Toaster.success("Success", 'Message sent');
|
||||
setState(() {
|
||||
_msgTitle.clear();
|
||||
@@ -306,7 +308,11 @@ class _SendRootPageState extends State<SendRootPage> {
|
||||
}
|
||||
|
||||
try {
|
||||
await APIClient.sendMessage(acc.userID!, acc.tokenSend!, _msgContent.text, channel: _channelName.text, senderName: _senderName.text, priority: _priority);
|
||||
var content = (_msgContent.text != '') ? _msgContent.text : null;
|
||||
var channel = (_channelName.text != '') ? _channelName.text : null;
|
||||
var sender = (_senderName.text != '') ? _senderName.text : null;
|
||||
|
||||
await APIClient.sendMessage(acc.userID!, acc.tokenSend!, _msgTitle.text, content: content, channel: channel, senderName: sender, priority: _priority);
|
||||
Toaster.success("Success", 'Message sent');
|
||||
setState(() {
|
||||
_msgTitle.clear();
|
||||
|
||||
Reference in New Issue
Block a user