A Flutter mobile application for bus ticketing with speech recognition and AI-powered natural language processing.
- User authentication with Firebase
- Bus ticket booking
- Payment processing
- Speech recognition in Sinhala
- AI-powered text extraction and translation using Google Gemini
- Ticket history tracking
The app includes a powerful speech recognition feature that:
- Listens to user speech in Sinhala
- Transcribes the speech to text
- Uses Google Gemini to extract relevant information (destination city and seat count)
- Automatically populates the booking form fields
- Create a Firebase project
- Add Android and iOS apps to your Firebase project
- Download and place the configuration files (google-services.json and GoogleService-Info.plist)
- Enable Authentication, Firestore, and Storage services
- Sign up for a Google Gemini API key at https://aistudio.google.com/
- Open
lib/utils/config.dartand replace the placeholder value with your actual API key:
static const String geminiApiKey = 'YOUR_ACTUAL_GEMINI_API_KEY';flutter pub getflutter runIf you encounter errors like:
Error processing with Gemini: GeminiException ... status code of 400
Try the following:
- Check your API key: Make sure you have a valid Gemini API key in
lib/utils/config.dart - Enable the API: Ensure you've enabled the Gemini API in your Google Cloud/AI Studio project
- API Key Permissions: Verify your API key has the necessary permissions to use Gemini
- Clean and rebuild: Run
flutter cleanfollowed byflutter pub getand try again - Check Network: Ensure your device has internet connectivity
For speech recognition to work properly, make sure your device has the appropriate permissions enabled for microphone access.
- Select a bus number
- Tap the microphone button and speak in Sinhala
- Example: "මට කොළඹට යන්න ඕනෙ, ආසන තුනක් වෙන් කරන්න" (I want to go to Colombo, reserve three seats)
- The app will automatically populate the destination and seat count fields
- Select a pickup location
- Complete the booking process