flutter-dart-code-review
하는 일
이것은 Flutter와 Dart 코드를 검토하는 가이드입니다. 코드가 잘 정리되었는지, 좋은 프로그래밍 관행을 쓰는지, 흔한 오류를 피하는지 확인합니다. 사용하는 상태 관리 라이브러리와는 무관합니다.
사용하는 경우
- ✓다른 사람의 코드를 검토할 때.
- ✓기능을 마무리하기 전에 검토할 때.
- ✓Flutter/Dart의 모범 사례를 배울 때.
스킬 링크
https://github.com/affaan-m/ECC/blob/main/pi/core/skills/flutter-dart-code-review/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“이 Flutter 코드를 검토하고, 구성과 잠재 오류에 대한 모범 사례에 집중해 주세요.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
가이드는 프로젝트 구조, Dart 언어의 올바른 사용, 위젯(화면의 시각적 부분)을 만드는 모범 사례, 상태(변하는 데이터)가 어떻게 관리되는지 점검합니다. 코드가 효율적이고, 접근성이 있으며, 안전한지 확인합니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Flutter/Dart Code Review Best Practices
Comprehensive, library-agnostic checklist for reviewing Flutter/Dart applications. These principles apply regardless of which state management solution, routing library, or DI framework is used.
1. General Project Health
- Project follows consistent folder structure (feature-first or layer-first)
- Proper separation of concerns: UI, business logic, data layers
- No business logic in widgets; widgets are purely presentational
-
pubspec.yamlis clean — no unused dependencies, versions pinned appropriately -
analysis_options.yamlincludes a strict lint set with strict analyzer settings enabled - No
print()statements in production code — usedart:developerlog()or a logging package - Generated files (
.g.dart,.freezed.dart,.gr.dart) are up-to-date or in.gitignore - Platform-specific code isolated behind abstractions
2. Dart Language Pitfalls
- Implicit dynamic: Missing type annotations leading to
dynamic— enablestrict-casts,strict-inference,strict-raw-types - Null safety misuse: Excessive
!(bang operator) instead of proper null checks or Dart 3 pattern matching (if (value case var v?)) - Type promotion failures: Using
this.fieldwhere local variable promotion would work - Catching too broadly:
catch (e)withoutonclause; always specify exception types - Catching
Error:Errorsubtypes indicate bugs and should not be caught - Unused
async: Functions markedasyncthat neverawait— unnecessary overhead -
lateoveruse:lateused where nullable or constructor initialization would be safer; defers errors to runtime - String concatenation in loops: Use
StringBufferinstead of+for iterative string building - Mutable state in
constcontexts: Fields inconstconstructor classes should not be mutable - Ignoring
Futurereturn values: Useawaitor explicitly callunawaited()to signal intent -
varwherefinalworks: Preferfinalfor locals andconstfor compile-time constants - Relative imports: Use
package:imports for consistency - Mutable collections exposed: Public APIs should return unmodifiable views, not raw
List/Map - Missing Dart 3 pattern matching: Prefer switch expressions and
if-caseover verboseischecks and manual casting - Throwaway classes for multiple returns: Use Dart 3 records
(String, int)instead of single-use DTOs -
print()in production code: Usedart:developerlog()or the project's logging package;print()has no log levels and cannot be filtered
3. Widget Best Practices
Widget decomposition:
- No single widget with a
build()method exceeding ~80-100 lines - Widgets split by encapsulation AND by how they change (rebuild boundaries)
- Private
_build*()helper methods that return widgets are extracted to separate widget classes (enables element reuse, const propagation, and framework optimizations) - Stateless widgets preferred over Stateful where no mutable local state is needed
- Extracted widgets are in separate files when reusable
Const usage:
-
constconstructors used wherever possible — prevents unnecessary rebuilds -
constliterals for collections that don't change (const [],const {}) - Constructor is declared
constwhen all fields are final
Key usage:
-
ValueKeyused in lists/grids to preserve state across reorders -
GlobalKeyused sparingly — only when accessing state across the tree is truly needed -
UniqueKeyavoided inbuild()— it forces rebuild every frame -
ObjectKeyused when identity is based on a data object rather than a single value
Theming & design system:
- Colors come from
Theme.of(context).colorScheme— no hardcodedColors.redor hex values - Text styles come from
Theme.of(context).textTheme— no inlineTextStylewith raw font sizes - Dark mode compatibility verified — no assumptions about light background
- Spacing and sizing use consistent design tokens or constants, not magic numbers
Build method complexity:
- No network calls, file I/O, or heavy computation in
build() - No
Future.then()orasyncwork inbuild() - No subscription creation (
.listen()) inbuild()
…
자주 묻는 질문
'라이브러리에 얽매이지 않는다'는 무슨 뜻인가요?
Flutter 프로젝트에서 어떤 상태 관리 라이브러리(BLoC, Riverpod, Provider 등)를 쓰든 이 팁이 적용된다는 뜻입니다.
최종 코드에서 print()를 쓰지 않는 이유는 무엇인가요?
print()는 앱 로그를 어지럽히고 심각도 수준이 없어서 중요한 메시지를 찾기 어렵게 만듭니다. 전용 로깅 도구를 쓰는 편이 낫습니다.
'위젯'이란 무엇인가요?
Flutter에서 사용자 인터페이스를 구성하는 기본 블록입니다. 텍스트, 버튼, 레이아웃 같은 시각 요소를 나타냅니다.
상세 정보
작성자의 원본 설명
Library-agnostic Flutter/Dart code review checklist covering widget best practices, state management patterns (BLoC, Riverpod, Provider, GetX, MobX, Signals), Dart idioms, performance, accessibility, security, and clean architecture. Use when reviewing Flutter or Dart code, whatever state management library the project uses.
repo: affaan-m/ECC
인기도
- GitHub 스타
- 280k
- 순위
- #180
- 라이선스
- MIT
- 업데이트
- 2026. 10. 15.
댓글
- …
이 저장소의 다른 스킬
accessibility
280k에이전트가 모든 사람이 쓸 수 있는 인터페이스를 만들도록 돕습니다. 시각 장애나 운동 장애가 있는 사람도 쓸 수 있게 합니다.
agent-architecture-audit
280k에이전트가 모든 것이 올바르게 작동하는지 점검하도록 돕습니다. AI 시스템의 문제를 찾아 고쳐서 기대대로 작동하게 합니다.
agent-eval
280k에이전트가 서로 다른 AI 코딩 도구를 비교하도록 돕습니다. 특정 작업에서 어느 도구가 더 빠르고, 저렴하고, 믿을 만한지 측정합니다.
agent-harness-construction
280k에이전트가 작업을 더 잘 이해하도록 돕습니다. 에이전트가 쓰는 도구와 지시문을 최적화해 성공 가능성을 높입니다.
비슷한 스킬
flutter-animating-apps
101kFlutter 앱에 애니메이션 효과와 전환을 추가하도록 돕습니다. iOS와 Android 앱에서 움직임과 시각 디자인을 만드는 데 유용합니다.
agent-spec-mobile-react-native
81kReact Native로 iPhone과 Android용 모바일 앱을 만들도록 돕습니다. 화면, 내비게이션, 네이티브 모듈을 포함합니다.
orientation
75k에이전트가 세로와 가로 방향 모두에서 사이트가 작동하도록 도와, 방향 잠금과 기기를 돌리라는 메시지를 없애 누구나 콘텐츠에 접근하게 합니다.