Conducted by: Alex Nyambura - Flutter Developer
By the end of this session, you will:
- Build a complete AI-powered Flutter app
- Integrate Google Gemini API for content generation
- Deploy your app using Firebase App Distribution
git clone https://github.com/lxmwaniky/freestail.git
cd freestail
flutter pub get
cp example.env .env
Important: Edit the .env
file and add your Gemini API key (we'll get this together):
GEMINI_API_KEY=your_api_key_here
- Go to Google AI Studio
- Sign in with your Google account
- Click "Get API Key"
- Create a new project or select an existing one
- Copy your API key
- Paste it in your
.env
file
Security Note: Never commit your API key to version control. Always use environment variables for sensitive data.
// POST request to Gemini API
final response = await http.post(
Uri.parse('${AppConstants.geminiApiUrl}?key=$_apiKey'),
headers: {'Content-Type': 'application/json'},
body: jsonEncode(request.toJson()),
);
- Genre-specific style guides
- Context-aware instructions
- Kenyan music culture integration
- Loading states
- Error handling
- Response processing
flutter run
- Select a genre - Try Gengetone or Amapiano
- Add 3-6 words - For example: love, sunset, dance
- Generate freestyle and see the AI in action
- Remix to different genres
- Copy lyrics to share with others
Android: android/app/build.gradle.kts
android {
namespace = "com.yourname.freestail" // Change this to your package name
...
}
Android: android/app/src/main/AndroidManifest.xml
<application
android:label="Your App Name" // Change this to your preferred name
...>
iOS: ios/Runner.xcodeproj/project.pbxproj
PRODUCT_BUNDLE_IDENTIFIER = com.yourname.freestail;
# Install Firebase CLI (optional for this method)
npm install -g firebase-tools
# Login to Firebase (optional)
firebase login
- Go to Firebase Console
- Click "Create a project"
- Enter your project name (e.g., "freestail-workshop")
- Follow the setup steps
- Once created, click "Add app" → Android
- Enter your package name:
com.yourname.freestail
- Download
google-services.json
and place it inandroid/app/
# Build APK for distribution
flutter build apk --release
- In your Firebase project, go to App Distribution (left sidebar)
- Click "Get started"
- Click "Upload your app's binary"
- Drag and drop your APK:
build/app/outputs/flutter-apk/app-release.apk
- Add tester email addresses
- Add release notes: "Workshop build - AI freestyle generator"
- Click "Distribute"
- Testers will receive email invitations to download your app!
- AI Integration - Google Gemini API calls and implementation
- HTTP Requests - POST requests with authentication
- JSON Handling - Parsing API responses effectively
- Environment Variables - Secure API key management
- App Distribution - Firebase deployment workflow
- AI APIs are powerful when integrated thoughtfully into user experiences
- Security practices are non-negotiable when working with API keys
- Modern Flutter development involves proper state management and clean architecture
- Testing and deployment are crucial parts of the development cycle
X (Twitter): @lxmwaniky
LinkedIn: Alex Nyambura
Website: lxmwaniky.vercel.app
Email: lxmwaniky@gmail.com
You've successfully built an AI-powered Flutter app from scratch. This is just the beginning of what you can create with AI integration in mobile development.
- Tweet your screenshots with hashtags: #FlutterAI #Gemini #BuildWithAI
- Share on LinkedIn and describe your learning experience
- Deploy to Firebase App Distribution for real users to test
- Add this project to your portfolio to showcase your AI development skills
Continue building amazing things with Flutter and AI integration. The possibilities are endless.