Finish implementing send page

This commit is contained in:
2025-04-13 01:51:52 +02:00
parent 95353735b0
commit e96be86314
7 changed files with 300 additions and 85 deletions

View File

@@ -178,11 +178,12 @@ class _ChannelScannerResultMessageSendState extends State<ChannelScannerResultMe
),
),
const SizedBox(width: 8),
UI.button(
text: 'Web',
UI.buttonIconOnly(
icon: FontAwesomeIcons.earthAmericas,
onPressed: _onOpenWeb,
square: true,
color: Theme.of(context).colorScheme.secondary,
textColor: Theme.of(context).colorScheme.onSecondary,
iconColor: Theme.of(context).colorScheme.onSecondary,
),
],
),
@@ -200,6 +201,9 @@ class _ChannelScannerResultMessageSendState extends State<ChannelScannerResultMe
try {
await APIClient.sendMessage(widget.value.userID, widget.value.userKey!, _ctrlMessage.text);
Toaster.success("Success", 'Message sent');
setState(() {
_ctrlMessage.clear();
});
} catch (e, stackTrace) {
Toaster.error("Error", 'Failed to send message: ${e.toString()}');
ApplicationLog.error('Failed to send message', trace: stackTrace);