{"slug": "dart-3-12", "title": "Dart 3.12", "summary": "Google announced Dart 3.12 at Google I/O 2026, introducing private named parameters and experimental primary constructors to reduce boilerplate and improve developer productivity. The update also includes Agentic Hot Reload and integration with Genkit for building AI-ready applications.", "body_md": "# Announcing Dart 3.12\n\nSupercharging developer productivity at Google I/O 2026\n\nThis year at Google I/O 2026, the Flutter and Dart teams are celebrating a powerful theme: Everywhere, everyday, built by everyone, for everyone.\n\nDart 3.12 brings this theme to life. We are making the language more approachable and productive. Concise new primitives like private named parameters, alongside experimental support for primary constructors, make everyday coding cleaner. But we didn't stop at the syntax level. New features like Agentic Hot Reload and the addition of Genkit to the Dart ecosystem ensure you can build high-performance, AI-ready, and agentic apps that reach users anywhere. This is true whether you code alone or pair-program with an AI agent.\n\nSo [update Dart](https://dart.dev/get-dart) or run [ flutter upgrade](https://docs.flutter.dev/install/upgrade)\nand follow along to explore the new features in Dart 3.12. But remember, a more powerful Dart is only half the story. When you're ready to see how these features translate into beautiful UI, check out the\n\n[What's new in Flutter](https://blog.flutter.dev/whats-new-in-flutter-3-44-b0cc1ad3c527)blog post.\n\n## Language updates\n\n[#](#language-updates)\n\n### Private named parameters\n\n[#](#private-named-parameters)\n\nDart's initializing formals, using the `this.`\n\nconstructor syntax, are incredibly convenient. They map a constructor parameter directly to a class field. This removes the need to write repetitive code.\n\nBut there was a catch. Initializing formals struggled when combining named parameters with private fields. Before Dart 3.12, the language didn't allow a named parameter to start with an underscore:\n\n```\nclass Hummingbird {\n  final String _petName;\n  final int _wingbeatsPerSecond;\n​\n  // Compile error! Can't have private named parameter. :(\n  Hummingbird({required this._petName, required this._wingbeatsPerSecond});\n}\n```\n\nInstead, you had to write an explicit initializer list:\n\n```\nclass Hummingbird {\n  final String _petName;\n  final int _wingbeatsPerSecond;\n​\n  Hummingbird({required String petName, required int wingbeatsPerSecond})\n    : _petName = petName,\n      _wingbeatsPerSecond = wingbeatsPerSecond;\n}\n```\n\nThis was tedious. All the initializer list is doing is removing the `_`\n\n. It added unnecessary boilerplate to simple classes.\n\nIn Dart 3.12, the language can do that for you. Dart now lets you write private named initializing formals:\n\n```\nclass Hummingbird {\n  final String _petName;\n  final int _wingbeatsPerSecond;\n​\n  // OK with \"Private Named Parameters\"! :D\n  Hummingbird({required this._petName, required this._wingbeatsPerSecond});\n}\n```\n\nThis code behaves exactly like the previous example. The initialized fields are private, but constructor parameters and the argument names written at the call site have the corresponding public names:\n\n```\nvoid main() {\n  print(Hummingbird(petName: 'Dash', wingbeatsPerSecond: 75));\n}\n```\n\n**Learn more**: [Private named parameters documentation](https://dart.dev/language/constructors#private-named-parameters)\n\n### Primary constructors (experimental phase)\n\n[#](#primary-constructors)\n\nWe are excited to offer an early look at one of the most requested syntax features in Dart. Primary constructors represent a major step forward for class conciseness. They eliminate the need to repeat field names and types across your class body and parameter lists.\n\nNormally, even a simple two-field class requires multiple lines of repetitive boilerplate:\n\n```\nclass Point {\n  final int x;\n  final int y;\n  Point(this.x, this.y);\n}\n```\n\nPrimary constructors change this completely. You can now replace boilerplate with a single line of code by declaring parameters directly within the class header.\n\n```\nclass Point(final int x, final int y);\n```\n\nThe feature goes further. It introduces a shorter syntax for declaring constructors inside the class body using the\n`new`\n\nor `factory`\n\nkeywords. It also allows classes with empty bodies to end with a simple semicolon:\n\n```\nclass Pet {\n  String name;\n​\n  new() : name = 'Fluffy';\n  new withName(this.name);\n}\n​\nclass Dog extends Pet;\n```\n\nPrimary constructors are launching as an experimental preview in Dart 3.12. Because this is a foundational shift in how Dart classes are defined, your real-world feedback is crucial. You can enable the feature using the\n`primary-constructors`\n\n[flag](https://dart.dev/tools/experiment-flags) when running your project:\n\n```\ndart run --enable-experiment=primary-constructors bin/main.dart\n```\n\nIf you encounter any issues or have feedback on the design, please file an issue on the [Dart SDK repository](https://github.com/dart-lang/sdk)\n(and feel free to cc `@kallentu`\n\n). We look forward to hearing your thoughts!\n\n**Learn more**: [Primary constructors documentation](https://dart.dev/language/primary-constructors)\n\n## Ecosystem updates\n\n[#](#ecosystem-updates)\n\n### Genkit Dart preview\n\n[#](#genkit-dart)\n\nWe're excited to announce the preview launch of Genkit Dart, an open-source framework for building full-stack, AI-powered agentic Dart and Flutter apps on any platform. It provides everything you need for AI apps out of the box:\n\n-\n**Model-agnostic API:** Supports Google, Anthropic, OpenAI, and OpenAI-compatible models. -\n**Type safety:** Combines Dart's strong type system with the`schematic`\n\npackage for strongly typed data generation and flows. -\n**Run anywhere:** Write AI logic once and run it in a backend service or directly inside your Flutter app. -\n**Developer UI:** Includes a local web UI to test prompts, view traces, and debug workflows. -\n**Core AI primitives:** Built-in support for structured output, tool calling, and multi-step flows.\n\nCall multiple models in just a few lines of code:\n\n```\nimport 'package:genkit/genkit.dart';\nimport 'package:genkit_google_genai/genkit_google_genai.dart';\nimport 'package:genkit_anthropic/genkit_anthropic.dart';\n​\nvoid main() async {\n  final ai = Genkit(plugins: [googleAI(), anthropic()]);\n​\n  // Call a Gemini model from Google.\n  final geminiResponse = await ai.generate(\n    model: googleAI.gemini('gemini-flash-latest'),\n    prompt: 'Hello from Gemini',\n  );\n​\n  // Call a Claude model from Anthropic.\n  final claudeResponse = await ai.generate(\n    model: anthropic.model('claude-opus-4.6'),\n    prompt: 'Hello from Claude',\n  );\n}\n```\n\nChat with the Genkit team on [Discord](https://discord.gg/qXt5zzQKpc) and report any issues on\n[GitHub](https://github.com/genkit-ai/genkit-dart).\n\n**Learn more**: [Get started with Genkit for Dart](https://genkit.dev/docs/dart/get-started/)\n\n### Cloud Functions for Firebase and experimental Dart support\n\n[#](#cloud-functions)\n\nWe are also thrilled to highlight the recent announcement of experimental support for Dart in Cloud Functions for Firebase. For years, extending a Flutter app to the cloud meant context-switching into other backend languages and duplicating data structures.\n\nNow, you can build a truly unified, full-stack Dart application. By leveraging the \"Shared Package\" pattern, you can share your data models, validation rules, and business logic directly between your frontend and backend—completely eliminating the \"Double-Doc Tax.\"\n\nThanks to Dart's Ahead-of-Time (AOT) compilation, your serverless functions benefit from incredibly fast cold starts, giving you instant scaling and performance without the hassle of Dockerfiles or container configuration.\n\n**Learn more**: [Dart and Firebase blog post](https://dart.dev/blog/flutter-missing-link-why-full-stack-dart-changes-everything).\n\n## Tooling updates\n\n[#](#tooling-updates)\n\n### Agentic Hot Reload\n\n[#](#agentic-hot-reload)\n\nWe've heard from our community that you want AI coding agents to work seamlessly when using Dart and Flutter. That is why we are launching Agentic Hot Reload for Dart and Flutter apps, a new feature designed to keep you and your coding agent in flow. By using the Dart MCP server, your coding agent can now automatically hot reload, eliminating the friction of having to manually find and copy Dart Tooling Daemon (DTD) connection URIs.\n\nBehind the scenes, the Dart Tooling Daemon automatically exposes the connection details through a CLI command run by the MCP server, allowing your coding agent to instantly discover and connect to your running app in your workspace.\n\nWith zero configuration, this integration streamlines your daily workflows. You can simply prompt your coding agent to fix a bug, change a UI widget, or diagnose a crash. The agent will autonomously modify your code, fetch live runtime diagnostics, and hot reload the app in real time.\n\n### Analysis server performance diagnostics\n\n[#](#analysis-server-performance-diagnostics)\n\nTo build the best tools for everyone, we want to understand Dart Analysis Server (DAS) performance exactly as you experience it on your machine. To make this possible, we have introduced the new\n`dart info record-performance`\n\ncommand.\n\nDevelopers experiencing slow analysis times or unresponsive completion can use this command to capture execution traces and CPU profiling data from active DAS processes on their machines. Including these traces when you file issues on GitHub gives our team the exact real-world data needed to diagnose and solve complex performance bottlenecks. By sharing your traces, you directly help us make Dart faster and more reliable for every developer.\n\n## Pub updates\n\n[#](#pub-updates)\n\n### Native Git LFS support in `pub`\n\n[#](#git-lfs-support)\n\nUsing packages with large files is now simpler than ever. As of Dart 3.12, `dart pub`\n\nnatively supports git dependencies with Git Large File Storage (LFS).\n\nYou don't need any custom configurations in your `pubspec.yaml`\n\nfile. As long as `git lfs`\n\nis installed on your machine, the pub client handles everything automatically:\n\n```\ndependencies:\n  kittens:\n    git: https://github.com/munificent/kittens.git\n```\n\nThis is a major improvement for teams versioning large media assets, data models, or binaries directly inside their git repositories.\n\n## Wrap up\n\n[#](#wrap-up)\n\nDart 3.12 represents a major milestone in removing developer friction. From concise syntax additions to seamless agentic AI workflows and a stronger AI ecosystem, this release is built to support you. Every feature is designed to make your everyday development clean and efficient.\n\nWe are excited to see what you build with these new capabilities. We hope you [update Dart](https://dart.dev/get-dart)\nor [upgrade Flutter](https://docs.flutter.dev/install/upgrade) today to try out these updates. If you are testing our experimental features like primary constructors, please share your feedback. Together, we will keep building a language that brings developer joy to everyone, everyday, and everywhere.\n\n**Learn more**: [Dart SDK changelog](https://github.com/dart-lang/sdk/blob/main/CHANGELOG.md#3120)", "url": "https://wpnews.pro/news/dart-3-12", "canonical_source": "https://dart.dev/blog/announcing-dart-3-12", "published_at": "2026-07-30 14:43:23+00:00", "updated_at": "2026-07-30 14:52:13.159932+00:00", "lang": "en", "topics": ["developer-tools"], "entities": ["Google", "Dart", "Flutter", "Genkit"], "alternates": {"html": "https://wpnews.pro/news/dart-3-12", "markdown": "https://wpnews.pro/news/dart-3-12.md", "text": "https://wpnews.pro/news/dart-3-12.txt", "jsonld": "https://wpnews.pro/news/dart-3-12.jsonld"}}