This project demonstrates how to leverage Vertex AI's text generation capabilities within a Flutter app to create unique Monopoly properties based on user-provided themes.
This Flutter app is meant to work in conjunction with the Functions repo, which actually makes the call to the Vertex APIs. https://github.com/cjwhitsitt/aiopoly-functions
- Creative Content Generation: Utilizes Vertex AI's Gemini Pro model to generate original Monopoly property names and descriptions tailored to specific themes.
- Serverless Backend: Employs Firebase Functions to streamline the interaction between the Flutter app and Vertex AI.
- Theme-Based Customization: Allows users to input their desired themes, resulting in personalized game experiences.
- Visual Organization: Presents the generated properties in a clear and user-friendly format, categorized by color groups.
- Flutter: Multi-platform mobile app development framework for building natively compiled apps for iOS, Android, web, and desktop from a single codebase.
- Firebase Functions: A serverless platform for building and hosting backend services with automatic scaling and high availability.
- Vertex AI: A Google Cloud platform offering a suite of machine learning services, including text generation capabilities with various models.
-
Setup the Functions project
https://github.com/cjwhitsitt/aiopoly-functions
This will also setup the Google Cloud and Firebase project needed for this sample.
-
Install Flutterfire
dart pub global activate flutterfire_cli
-
Clone the repository:
git clone https://github.com/cjwhitsitt/aiopoly-flutter cd aiopoly-flutter -
Configure Firebase
flutterfire configure # Choose your Firebase project then your desired platforms -
Connect to Functions
If using deployed Functions and not a local emulator, comment out this line:
Future<void> main() async { WidgetsFlutterBinding.ensureInitialized(); await Firebase.initializeApp( options: DefaultFirebaseOptions.currentPlatform, ); Service.useEmulators(); // comment out this line if using deployed Functions runApp(const MyApp()); }
-
Run the app:
flutter run
- Enter a theme of your choice in the app's input field.
- The app will send the theme to the Firebase Function.
- The Function will call the Gemini Pro model in Vertex AI to generate properties based on the theme.
- The generated properties will be displayed in the app, organized by color groups.