microphonePermission static method

Future<StreamSubscription<void>> microphonePermission()

Requests the permission to use a microphone and holds it until unsubscribed.

Implementation

static Future<StreamSubscription<void>> microphonePermission() async {
  try {
    await Permission.microphone.request();
  } catch (_) {
    // No-op.
  }

  return const Stream.empty().listen((_) {});
}