stop static method
Stop foreground task.
Implementation
static Future<void> stop() async {
// If the task is not running, the update function is not executed.
if (!await isRunningTask) return;
_removePort();
_methodChannel.invokeMethod('stopForegroundService');
_printMessage('FlutterForegroundTask stopped.');
}