I am unable to send an invokeMethod over a channel.
Whenever I try, the error from the title shows up.
I've ran this in a new project, this being the only dependency I use.
I have a button that runst he following code:
Future<void> _openOrUpdateSubWindow() async {
setState(() {
_counter++;
});
final payload = 'Patient Data Update #$_counter';
final activeWindows = await WindowController.getAll();
for (final controller in activeWindows) {
final args = controller.arguments as String? ?? '';
if (args.startsWith('subwindow')) {
await controller.show();
try {
await _channel.invokeMethod('updateData', payload);
} catch (e) {
debugPrint('Error sending live update: $e');
}
return;
}
}
final controller = await WindowController.create(
WindowConfiguration(
hiddenAtLaunch: false,
arguments: 'subwindow:$payload',
),
);
await controller.show();
}
It just doesn't update, and I get the debugPrint every single time.
I am unable to send an invokeMethod over a channel.
Whenever I try, the error from the title shows up.
I've ran this in a new project, this being the only dependency I use.
I have a button that runst he following code:
It just doesn't update, and I get the debugPrint every single time.