Flutter makes it easy to build apps that run everywhere with one codebase. But adding advanced voice interaction features, such as understanding and responding to user commands, can be challenging.
That's what speech-to-intent, or voice commands, does. Instead of just transcribing words, it figures out the user's intent so your app can take action. In this post, we'll add on-device voice commands to a Flutter app using Picovoice's Rhino Flutter SDK. It runs fully offline, reacts instantly, and keeps user data private.
Ease of use is not the only thing Rhino shines when it comes to adding voice control to Flutter apps, Rhino is 8.4x more accurate than Google Dialogflow. With improved accuracy, Rhino delivers more consistent results—building user trust through dependable, on-device understanding.
This guide shows how to add custom, on-device voice commands to a Flutter app with Rhino Speech-to-Intent.
What you'll learn:
- How to set up audio recording permissions for iOS and Android
- How to add Rhino Speech-to-Intent to your Flutter app
What you need:
- Flutter SDK (2.8.1+)
- Android SDK (21+)
- JDK (11+)
- Xcode (13+)
Enable Microphone Permissions
This tutorial requires recording audio, so before we begin, you'll need to configure your Flutter project to request audio recording permissions from the user. Make sure the appropriate permissions are enabled for each platform:
iOS
Add the following block to Info.plist:
Android
Add the following block to AndroidManifest.xml:
Internet is required only for licensing and usage tracking. Audio remains on-device, and is not streamed. Once Rhino has been initialized, it can run offline.
Add Custom Voice Commands to Flutter App
- Add Rhino Flutter Plugins: To use Rhino Speech-to-Intent in your Flutter project, add the flutter_voice_processor and rhino_flutter plugins to your project's dependencies. Open your project's pubspec.yamlfile and add the following:
- Get Your Picovoice Access Key: Sign up for a free Picovoice Console account and obtain your - AccessKey. The- AccessKeyis only required for authentication and authorization.
- Train Custom Context: Create a custom context using the Picovoice Console. Refer to the Rhino syntax cheat sheet to learn how to build your context. 
If you'd like to see a video walkthrough for this step, check out Picovoice Console Tutorial: Rhino Speech-to-Intent.
- Add Context Files to Your Project: Once you are done building your context, download the context files. You will need to download two context files—one for Android, and one for iOS. The files will have a .rhnextension. Place the context files into your project'sassets/folder and add the file path to yourpubspec.yaml:
- Using Non-English Model Files (Optional): If you created a non-English context, you will also need to add the corresponding model file for the language you chose. Also place the model file into your project's assets/folder and add the file path to yourpubspec.yaml:
Step-by-Step Code Walkthrough
- Define a function to handle the intents that will be returned by RhinoManager(next step). The intent will be of class RhinoInference.
- Create an instance of RhinoManager. Be sure to replace the placeholders, and pass in your_inferenceCallback()function.
- To start listening for voice commands, callprocess(). WhenRhinoManagerdetects that something was said, it will automatically stop processing, whether it understood the command or not. To start listening again for the next command, callprocess()again.
- Once you no longer need RhinoManager, be sure to release the resources acquired by callingdelete().
Complete Code Example
Below is a fully implemented widget you can add to your project to see Rhino in action. Be sure to replace {ACCESS_KEY} with your own AccessKey from Picovoice Console, {CONTEXT_FILE} with your context files, and {MODEL_FILE} with your model file (if applicable).
This is a simplified example that includes all the essential code to get you started. If you'd like to see a complete working app, check out the Rhino Flutter demo on our GitHub repository.
This tutorial uses the following packages:
You can also explore our documentation for more details:
Start Building






