Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions firebase.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@
{ "source": "/ai-best-practices", "destination": "/ai/best-practices", "type": 301 },
{ "source": "/ai-best-practices/:rest*", "destination": "/ai/best-practices/:rest*", "type": 301 },
{ "source": "/ai-toolkit", "destination": "/ai/ai-toolkit", "type": 301 },
{ "source": "/ai-toolkit/:rest*", "destination": "/ai/ai-toolkit/:rest*", "type": 301 },
{ "source": "/ai/flutter-ext-for-gemini", "destination": "/ai/gemini-cli-extension", "type": 301 },
{ "source": "/ai/best-practices/tool-calls-aka-function-calls", "destination": "/ai/best-practices/tool-calls", "type": 301 },
{ "source": "/ai/antigravity", "destination": "/ai/coding-assistants", "type": 301 },
{ "source": "/ai/gemini-code-assist", "destination": "/ai/coding-assistants", "type": 301 },
{ "source": "/ai/firebase-ai-logic", "destination": "https://firebase.google.com/docs/ai-logic/get-started?platform=flutter", "type": 301 },
Comment thread
lamek marked this conversation as resolved.
{ "source": "/android-release", "destination": "/deployment/android", "type": 301 },
{ "source": "/animations", "destination": "/ui/animations", "type": 301 },
{ "source": "/animations/:rest*", "destination": "/ui/animations/:rest*", "type": 301 },
Expand Down
3 changes: 2 additions & 1 deletion site/lib/src/components/common/button.dart
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ class Button extends StatelessComponent {
enum ButtonStyle {
filled,
outlined,
text;
text
;
Comment thread
lamek marked this conversation as resolved.
Outdated

String get cssClass => switch (this) {
ButtonStyle.filled => 'filled-button',
Expand Down
3 changes: 2 additions & 1 deletion site/lib/src/components/common/client/feedback.dart
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ enum _FeedbackState {
unhelpful(
'Thank you for your feedback! '
'Please let us know what we can do to improve.',
);
)
;

const _FeedbackState(this.introduction);

Expand Down
3 changes: 2 additions & 1 deletion site/lib/src/components/common/wrapped_code_block.dart
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ enum CodeBlockTag {
passesStaticAnalysis('static analysis: success', parentClass: 'passes-sa'),
failsStaticAnalysis('static analysis: failure', parentClass: 'fails-sa'),
runtimeSuccess('runtime: success', parentClass: 'runtime-success'),
runtimeFailure('runtime: failure', parentClass: 'runtime-fail');
runtimeFailure('runtime: failure', parentClass: 'runtime-fail')
;

const CodeBlockTag(this.spanContent, {required this.parentClass});

Expand Down
5 changes: 5 additions & 0 deletions site/lib/src/components/layout/header.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,11 @@ class DashHeader extends StatelessComponent {
label: 'Learn',
isActive: activeEntry == ActiveNavEntry.learn,
),
_NavItem(
href: '/ai/create-with-ai',
label: 'AI',
isActive: activeEntry == ActiveNavEntry.ai,
),
const _NavItem(
href: 'https://api.flutter.dev',
label: 'Reference',
Expand Down
6 changes: 6 additions & 0 deletions site/lib/src/components/layout/sidenav.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ final class DashSideNav extends StatelessComponent {
iconId: 'play_lesson',
active: activeEntry == ActiveNavEntry.learn,
),
_TopNavItem(
href: '/ai/create-with-ai',
label: 'AI',
iconId: 'auto_awesome',
active: activeEntry == ActiveNavEntry.ai,
),
const _TopNavItem(
href: 'https://api.flutter.dev',
label: 'Reference',
Expand Down
3 changes: 2 additions & 1 deletion site/lib/src/components/layout/theme_switcher.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ final class ThemeSwitcher extends StatefulComponent {
enum _Theme {
light('Light', 'Switch to the light theme.', 'light_mode'),
dark('Dark', 'Switch to the dark theme.', 'dark_mode'),
auto('Automatic', 'Match theme to device theme.', 'night_sight_auto');
auto('Automatic', 'Match theme to device theme.', 'night_sight_auto')
;

final String label;
final String description;
Expand Down
3 changes: 2 additions & 1 deletion site/lib/src/highlight/token_renderer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ enum FontWeight {
w600(600),
w700(700),
w800(800),
w900(900);
w900(900)
;

final int weight;

Expand Down
5 changes: 5 additions & 0 deletions site/lib/src/layouts/dash_layout.dart
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,12 @@ ga('send', 'pageview');
final bodyClass = pageData['bodyClass'] as String?;
final pageUrl = page.url.startsWith('/') ? page.url : '/${page.url}';

final pageSidenav = pageData['sidenav'] as String? ?? defaultSidenav;
final sideNavEntries = switch (page.data['sidenav']) {
_ when pageSidenav == 'ai' => switch (page.data['ai']) {
final List<Object?> sidenavData => navEntriesFromData(sidenavData),
_ => null,
},
final List<Object?> sidenavData => navEntriesFromData(sidenavData),
_ => null,
};
Comment thread
lamek marked this conversation as resolved.
Outdated
Expand Down
3 changes: 2 additions & 1 deletion site/lib/src/markdown/alert_syntax.dart
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,8 @@ enum _AlertType {
),
secondary(
cssClass: 'alert-secondary',
);
)
;

/// The CSS class to add to `aside` element
final String cssClass;
Expand Down
6 changes: 4 additions & 2 deletions site/lib/src/models/learning_resource_model.dart
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ enum LearningResourceType {
tutorial('Tutorial', ['codelab', 'tutorial']),
sampleCode('Sample code', ['quickstart', 'demo', 'sample', 'sample code']),
workshop('Workshop', ['workshop', 'video']),
recipe('Recipe', ['recipe', 'how to', 'cookbook']);
recipe('Recipe', ['recipe', 'how to', 'cookbook'])
;

const LearningResourceType(this.label, this.tags);

Expand Down Expand Up @@ -99,7 +100,8 @@ enum LearningResourceTag {
]),
testing('Testing', ['testing', 'tests', 'test', 'perf', 'performance']),
web('Web', ['web', 'wasm']),
widgets('Widgets', ['widgets', 'layout']);
widgets('Widgets', ['widgets', 'layout'])
;

const LearningResourceTag(this.label, this.tags);

Expand Down
3 changes: 2 additions & 1 deletion site/lib/src/pages/glossary.dart
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ enum ResourceType {
video,
code,
diagnostic,
external;
external
;

/// The ID of the material symbol icon associated with each resource type.
String get icon => switch (this) {
Expand Down
3 changes: 2 additions & 1 deletion site/lib/src/util.dart
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ enum OperatingSystem {
windows('Windows'),
macos('macOS'),
linux('Linux'),
chromeos('ChromeOS');
chromeos('ChromeOS')
;

const OperatingSystem(this.label);
final String label;
Expand Down
4 changes: 4 additions & 0 deletions site/lib/src/utils/active_nav.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@ ActiveNavEntry activeNavEntry(String pageUrlPath) {
return ActiveNavEntry.learn;
}

if (pageUrlPath.startsWith('/ai')) {
return ActiveNavEntry.ai;
}
return ActiveNavEntry.home;
}

enum ActiveNavEntry {
home,
learn,
ai,
// reference,
}
1 change: 1 addition & 0 deletions src/content/ai/ai-rules.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: AI rules for Flutter and Dart
sidenav: ai
shortTitle: AI rules
description: >-
Learn how to add AI rules to tools that accelerate your
Expand Down
1 change: 1 addition & 0 deletions src/content/ai/ai-toolkit/chat-client-sample.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: Chat client sample
sidenav: ai
description: >
Learn about the chat client sample included in the AI Toolkit.
prev:
Expand Down
1 change: 1 addition & 0 deletions src/content/ai/ai-toolkit/custom-llm-providers.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: Custom LLM providers
sidenav: ai
description: >
How to integrate with other Flutter features.
prev:
Expand Down
1 change: 1 addition & 0 deletions src/content/ai/ai-toolkit/feature-integration.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: Feature integration
sidenav: ai
description: >
How to integrate with other Flutter features.
prev:
Expand Down
1 change: 1 addition & 0 deletions src/content/ai/ai-toolkit/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: Flutter AI Toolkit
sidenav: ai
shortTitle: AI Toolkit
description: >
Learn how to add the AI Toolkit chatbot
Expand Down
1 change: 1 addition & 0 deletions src/content/ai/ai-toolkit/user-experience.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: User experience
sidenav: ai
description: >
How the user will experience the AI Toolkit in your app.
prev:
Expand Down
1 change: 1 addition & 0 deletions src/content/ai/best-practices/developer-experience.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: Developer experience
sidenav: ai
description: >
Learn how to use spec-driven development and Gemini to plan, code, and
iterate on high-quality Flutter applications.
Expand Down
1 change: 1 addition & 0 deletions src/content/ai/best-practices/index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: Flutter AI best practices
sidenav: ai
shortTitle: AI best practices
breadcrumb: Best practices
description: >
Expand Down
1 change: 1 addition & 0 deletions src/content/ai/best-practices/mode-of-interaction.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: Mode of interaction
sidenav: ai
description: >
Learn to balance LLM capabilities with traditional code and implement
guardrails to manage nondeterministic AI behavior.
Expand Down
1 change: 1 addition & 0 deletions src/content/ai/best-practices/prompting.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: Prompting
sidenav: ai
description: >
Learn how to build and optimize generative AI prompts in Flutter using system
instructions, dynamic parameters, and versioning techniques.
Expand Down
1 change: 1 addition & 0 deletions src/content/ai/best-practices/structure-output.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: Structure & output
sidenav: ai
description: >
Learn how to use structured input and output schemas to receive reliable,
parsable JSON data from an LLM.
Expand Down
1 change: 1 addition & 0 deletions src/content/ai/best-practices/tool-calls.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
---
title: Tool calls (aka function calls)
sidenav: ai
shortTitle: Tool calls
description: >
Learn how to implement tool calling, manage agentic loops, and incorporate
Expand Down
48 changes: 48 additions & 0 deletions src/content/ai/coding-assistants.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
title: AI Coding Assistants
sidenav: ai
description: >
Learn how to use AI-powered coding assistants like Antigravity and Gemini CLI
to accelerate your Flutter development.
---

AI tools are not only features in your app,
but can also be powerful assistants in your development workflow.

Tools like Antigravity and Gemini CLI can help you write code faster,
understand complex concepts, and reduce boilerplate.

## Antigravity

[Antigravity](https://antigravity.google/) is an in-IDE AI agent that can read and write code, run terminal commands, and help you build complex features. Some of its capabilities include:

* **Agentic capabilities**: Unlike chat-based assistants, Antigravity can proactively edit files and run terminal commands to complete tasks.
* **Complex reasoning**: It can plan and execute multi-step workflows which makes it suitable for larger refactors or feature implementations.
* **Verification**: It can run tests and verify its own changes to ensure correctness.

<YouTubeEmbed
id="YY2w2JEX2xk"
title="Flutter + Antigravity in 10 minutes">
</YouTubeEmbed>

## Gemini CLI

The [Gemini CLI](https://geminicli.com/) is a command-line AI workflow tool. It allows you to interact with Gemini models for a variety of tasks without leaving your development environment. You can use it to:

* Quickly scaffold a new Flutter widget, Dart function, or a complete app.
* Use MCP server tools, such as the Dart and Flutter MCP server.
* Automate tasks like committing and pushing changes to a Git repository.

To get started, visit the [Gemini CLI](https://geminicli.com/) website, or try this [Gemini CLI codelab](https://codelabs.developers.google.com/gemini-cli-hands-on).

## Flutter extension for Gemini CLI

The [Flutter extension for Gemini CLI]({{site.github}}/gemini-cli-extensions/flutter) combines the [Dart and Flutter MCP server]({{site.dart-site}}/tools/mcp-server) with rules and commands. It uses the default set of [AI rules for Flutter and Dart](/ai/ai-rules), adds commands like `/create-app` and `/modify` to make structured changes to your app, and automatically configures the [Dart and Flutter MCP server]({{site.dart-site}}/tools/mcp-server).

You can install it by running the following command:

```bash
gemini extensions install https://github.com/gemini-cli-extensions/flutter
```

To learn more, check out [Flutter extension for Gemini CLI](/ai/gemini-cli-extension).
Loading