Prerequisites
Before proceeding, ensure that your development environment meets the following requirements:- A Zero Runtime account (create one from the Zero Runtime Dashboard).
- The Flutter toolchain and Python 3.11+ installed on your device.
Project Structure
Your project structure should look like this:join_screen.dart: Responsible for the user interface to join a meeting.meeting_screen.dart: Displays the meeting interface and handles meeting logic.api_call.dart: Handles API calls for creating meetings.agent-flutter.py: The Python AI agent backend using the Google Gemini Live API..env: Environment variables for the Python agent’s API keys.
1. Flutter Frontend
Step 1: Create the Flutter app
Step 2: Configure native platform permissions
- Android
- iOS
- macOS
/android/app/src/main/AndroidManifest.xml for the permissions used to implement the audio and video features.build.gradle you will need to increase the minSdkVersion of defaultConfig up to 23 (Flutter’s generator defaults it to 16).Step 3: Configure environment and credentials
roomId from the response and configure it in lib/join_screen.dart and lib/api_call.dart.Step 4: Design the user interface
MeetingScreen widget with audio-only interaction in lib/meeting_screen.dart:2. Python AI Agent
Step 1: Setup the project
zrt and python-dotenv. Every provider plugin ships with zrt.Step 2: Configure environment variables
.env file in your project root to store your token securely for the Python agent:Step 3: Create the AI agent backend
agent-flutter.py) that joins the same meeting room and interacts with users through voice.3. Run the Application
Step 1: Run the Flutter app
Step 2: Run the AI agent
ZERORUNTIME_AUTH_TOKEN from the .env file.Step 3: Connect and interact
-
Join the meeting from the Flutter app:
- Tap the Join Meeting button.
- Allow microphone permissions when prompted.
-
Agent connection:
- Once you join, the Python agent detects your participation.
- You should see “Participant joined” in the terminal.
- The AI agent greets you and initiates the game.
-
Start playing:
- The agent guides you through a number guessing game (1–100).
- Use your microphone to interact with the AI host.
Troubleshooting
'Waiting for participant...' but no connection
'Waiting for participant...' but no connection
- Ensure both the Flutter app and the agent are running.
- Check that the room ID matches in both
lib/join_screen.dartandagent-flutter.py. - Verify your Zero Runtime token is valid.
Audio not working
Audio not working
- Check device permissions for microphone access.
Agent not responding
Agent not responding
- Verify your
ZERORUNTIME_AUTH_TOKENis set in the.envfile and is valid.
Flutter build issues
Flutter build issues
- Ensure your Flutter version is compatible.
- Try cleaning the build:
flutter clean. - Delete
pubspec.lockand runflutter pub get.