|
| 1 | +--- |
| 2 | +title: Create with AI |
| 3 | +description: > |
| 4 | + Learn how to use AI to build Flutter apps, from powerful SDKs that integrate |
| 5 | + AI features directly into your app to tools that accelerate your development |
| 6 | + workflow. |
| 7 | +--- |
| 8 | + |
| 9 | +This guide covers how you can leverage AI tools to build AI-powered features for |
| 10 | +your Flutter apps and streamline your Flutter and Dart development. |
| 11 | + |
| 12 | +## Build AI-powered experiences with Flutter |
| 13 | + |
| 14 | +Using AI in your Flutter app unlocks new user experiences that allow your app |
| 15 | +to support natural language understanding and content generation. |
| 16 | + |
| 17 | +To get started building AI-powered experiences in Flutter, check out these |
| 18 | +resources: |
| 19 | + |
| 20 | +* [Firebase AI Logic][] - The official Firebase SDK for using generative AI |
| 21 | + features directly in Flutter. Compatible with the Gemini Developer API or |
| 22 | + Vertex AI. To get started, check out the |
| 23 | + [official documentation][firebase-ai-logic-docs]. |
| 24 | +* [Flutter AI Toolkit][] - A sample app with pre-built widgets to help you build |
| 25 | + AI-powered features in Flutter |
| 26 | + |
| 27 | +--- |
| 28 | + |
| 29 | +## AI development tools |
| 30 | + |
| 31 | +AI can not only be a feature in your app, but also a powerful assistant in your |
| 32 | +development workflow. Tools like Gemini Code Assist and the Gemini CLI can help |
| 33 | +you write code faster, understand complex concepts, and reduce boilerplate. |
| 34 | + |
| 35 | +### Gemini Code Assist |
| 36 | + |
| 37 | +[Gemini Code Assist][] is an AI-powered collaborator available in Visual Studio Code |
| 38 | +and JetBrains IDEs (including Android Studio). It has a deep understanding of |
| 39 | +your project's codebase and can help you with: |
| 40 | + |
| 41 | +* **Code completion and generation**: It suggests and generates entire blocks of |
| 42 | + code based on the context of what you're writing. |
| 43 | +* **In-editor chat**: You can ask questions about your code, Flutter concepts, |
| 44 | + or best practices directly within your IDE. |
| 45 | +* **Debugging and explanation**: If you encounter an error, you can ask Gemini |
| 46 | + Code Assist to explain it and suggest a fix, and |
| 47 | + [Dart and Flutter MCP Server][dart-mcp-flutter-docs] |
| 48 | + |
| 49 | + |
| 50 | +### Gemini CLI |
| 51 | + |
| 52 | +The [Gemini CLI][] is a command-line AI workflow tool. It allows you to interact |
| 53 | +with Gemini models for a variety of tasks without leaving your development |
| 54 | +environment. You can use it to: |
| 55 | + |
| 56 | +* Quickly scaffold a new Flutter widget, Dart function, or a complete app. |
| 57 | +* Use MCP server tools, such as the Dart and Flutter MCP server |
| 58 | +* Automate tasks like committing and pushing changes to a Git repository |
| 59 | + |
| 60 | +To get started, visit the [Gemini CLI][] website, or try this |
| 61 | +[Gemini CLI codelab][]. |
| 62 | + |
| 63 | +--- |
| 64 | + |
| 65 | +## Dart and Flutter MCP Server |
| 66 | + |
| 67 | +To provide assistance during Flutter development, AI tools such as |
| 68 | +Gemini Code Assist and Gemini CLI need to communicate with Dart |
| 69 | +and Flutter's developer tools. The Dart and |
| 70 | +Flutter MCP (model context protocol) Server facilitates this |
| 71 | +communication. The model context protocol is a specification that |
| 72 | +outlines how development tools can share the context of a user's code |
| 73 | +with an AI model, which allows the AI to better understand and interact |
| 74 | +with the code. |
| 75 | + |
| 76 | +The Dart and Flutter MCP server provides a growing list of tools to analyze |
| 77 | +and fix errors, hot reload, get the selected widget, and more. This bridges |
| 78 | +the gap between the AI's natural language understanding, and |
| 79 | +Dart and Flutter's suite of developer tools. |
| 80 | + |
| 81 | +To get started, check out the official documentation for the [Dart and Flutter MCP server][dart-mcp-dart-docs] |
| 82 | +on dart.dev and the [Dart and Flutter MCP repository][dart-mcp-github]. |
| 83 | + |
| 84 | +--- |
| 85 | + |
| 86 | +[Gemini Code Assist]: https://codeassist.google/ |
| 87 | +[Gemini CLI]: {{site.github}}/google-gemini/gemini-cli |
| 88 | +[Gemini CLI codelab]: https://codelabs.developers.google.com/gemini-cli-hands-on |
| 89 | +[Firebase AI Logic]: {{site.firebase}}/docs/ai-logic |
| 90 | +[firebase-ai-logic-docs]: {{site.firebase}}/docs/ai-logic/get-started |
| 91 | +[How to build agentic apps with Flutter and Firebase AI Logic]: {{site.yt.watch}}/watch?v=xo271p-Fl_4 |
| 92 | +[Flutter AI Toolkit]: {{site.url}}/ai-toolkit |
| 93 | +[dart-mcp-dart-docs]: {{site.dart-site}}/tools/mcp-server |
| 94 | +[dart-mcp-github]: {{site.github}}/dart-lang/ai/tree/main/pkgs/dart_mcp_server |
| 95 | +[dart-mcp-flutter-docs]: #dart-and-flutter-mcp-server |
0 commit comments