startForegroundService method

Future<void> startForegroundService()

Starts foreground service for background torch operation (Android only). Required for torch to continue working when app is in background.

Implementation

Future<void> startForegroundService() async {
  await TorchFlashlight.startForegroundService();
}