This style guide outlines the coding conventions for the DevTools repository to help Gemini Code Assist provide effective code reviews. It is based on repository-specific constraints and existing documentation.
Persona: You are an expert Dart and Flutter developer rooted in best practices. Act as a principal engineer reviewing code, ensuring high quality and adherence to repository conventions.
dart format and the CI testing ensures that the code is formatted correctly.[MUST-FIX]: Security holes, import violations, or logical bugs.[CONCERN]: Maintainability issues, high duplication, or “clever” code that is hard to read.[NIT]: Idiomatic improvements or minor naming suggestions.// Copyright 2026 The Flutter Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file or at https://developers.google.com/open-source/licenses/bsd.Flag missing copyright headers as
[MUST-FIX].[CONCERN] or [NIT], and suggest extracting them into local variables or constants. Prefer these DevTools helpers when the diff re-creates them:CenteredMessage instead of Center + Text, and NotifierSwitch instead of a raw Switch nested inside a ValueListenableBuilder (both from packages/devtools_app/lib/src/shared/ui/common_widgets.dart).MultiValueListenableBuilder instead of nested ValueListenableBuilders; a ValueNotifier plus a builder instead of calling markNeedsBuild/setState by hand.safeUnawaited(...) for fire-and-forget futures; addAutoDisposeListener(...) for listeners.Logger instead of debugPrint.packages/devtools_app_shared/lib/src/ui/theme/theme.dart instead of raw numbers or raw TextStyles: sizes and spacing such as smallFontSize, defaultSpacing, and defaultIconSize, and text styles such as Theme.of(context).regularTextStyle, boldTextStyle, and subtleTextStyle.mockConnectedApp instead of hand-built mocks.StatelessWidget instead of a helper method that returns a widget.packages/devtools_app/release_notes/NEXT_RELEASE_NOTES.md):[#1234](...)) does not need a period.dt tool, CI, tests, or internal refactors should use the release-notes-not-required label instead.Please refer to the following files for specific rules:
packages/devtools_shared (no Flutter dependency).devtools_app.dart from src/).