hasPermission property

Future<bool> hasPermission

Returns true if the user has already granted permission to access the microphone, does not prompt the user.

This method can be called before initialize to check if permission has already been granted. If this returns false then the initialize call will prompt the user for permission if it is allowed to do so. Note that applications cannot ask for permission again if the user has denied them permission in the past.

Implementation

Future<bool> get hasPermission async {
  var hasPermission = await SpeechToTextPlatform.instance.hasPermission();
  return hasPermission;
}