Flutter 3.19: Embracing Gemini Pro with Google's AI Dart SDK

post-thumb



Last year, during the Google DevFest campaign, I had the privilege of unveiling the original version of my Aroma Project. It was an opportunity to showcase the seamless integration of Google’s Makersuite and PaLM API into any Flutter application. For those intrigued by that initial exploration, my reflections and insights were captured in a detailed blog post, which can be revisited here. That application is a journey : a captivating exploration into the rich narratives and intricate flavors of coffee, augmented by the latest advancements in artificial intelligence.

21-flutter-319-gemini-pro-1

1. Gemini Google AI Dart SDK beta release

With the release of Flutter 3.19, I am thrilled to share a significant milestone : The Google AI Dart SDK has been released to beta. This enables dart developers to build generative AI features into their Dart or Flutter app, powered by Gemini, Google’s latest family of AI models. For me, this transition underscores Dart’s emerging significance in AI development, offering a glimpse into the future of intelligent applications.

21-flutter-319-gemini-pro-2

2. The Evolution of AI Integration

2.1 From Makersuite to Google AI Studio

The journey began with Makersuite, leveraging the PaLM API, and has now transitioned to embracing the capabilities of Gemini Pro through Google AI Studio, formerly known as Makersuite. This evolution represents not just a change in technology but a leap forward in the ability to create nuanced and sophisticated AI interactions within the Aroma app.

21-flutter-319-gemini-pro-3

2.2 Technical Migration

The technical migration journey of the Aroma Project to Flutter 3.19 and Gemini Pro, detailed in my migration branch, showcases a methodical approach to upgrading and enhancing the application:

  • I started by adding the AiUtil class to replace the deprecated PaLMUtil, marking the shift towards utilizing Google’s Generative AI for text generation.

  • Dependencies were then updated, including a crucial update to the google_generative_ai package, ensuring compatibility with the latest AI advancements.

  • Additionally, I was pleased to contribute to the Google Generative AI Dart SDK by identifying and fixing a small bug in the generation configuration. My pull request has been merged, which you can see here.

  • The app’s README.md was refined to reflect the usage of Google AI Studio and Gemini Pro, further aligning our documentation with the project’s current technological stack. Below are selected screenshots illustrating the application’s enriched interaction capabilities post-migration and the prompts in Google AI Studio :

21-flutter-319-gemini-pro-1 21-flutter-319-gemini-pro-1 21-flutter-319-gemini-pro-1 21-flutter-319-gemini-pro-1

To further your understanding and exploration of the technologies and practices I’ve embraced in the Aroma Project, the following resources offer a lot of information:

  • Flutter 3.19 Documentation: Dive into the latest features and updates of Flutter 3.19 here.
  • Google Generative AI SDK for Dart: Explore the capabilities and documentation of the SDK here.
  • Aroma Project GitHub Repository: For a comprehensive view of the project’s source code and migration journey, visit my GitHub repository here.
  • Google AI Studio: Learn more about prompt engineering and AI model integration with Google AI Studio here.