1- # Do not remove or rename entries in this file, only add new ones
2- # See https://github.com/flutter/flutter/issues/128635 for more context.
3-
4- # This is dynamic in a monorepo
5- bin /internal /engine.version
6-
7- # Miscellaneous
8- * .class
9- * .lock
10- * .log
11- * .pyc
12- * .swp
13- .DS_Store
14- .atom /
15- .buildlog /
16- .history
17- .svn /
18-
19- # IntelliJ related
20- * .iml
21- * .ipr
22- * .iws
23- .idea /
1+ # ==============================================================================
2+ # Flutter & Dart Common .gitignore
3+ # ==============================================================================
4+ #
5+ # This file is organized in two sections:
6+ # 1. Common Rules: Always applied for both Flutter apps and libraries.
7+ # 2. Specific Rules: Sensitive or optional rules that are active by default.
8+ #
9+ # By default, this configuration is conservative:
10+ # Sensitive/generated files are ignored unless you deliberately modify the file.
11+ # ==============================================================================
12+
13+ # ##############################################################################
14+ # 1. Common Rules for Flutter Applications and Libraries
15+ # ##############################################################################
16+
17+ # # Flutter & Dart Generated Files & Caches
18+ # Build artifacts and generated files (do not commit these)
19+ build /
20+ coverage /
21+ .dart_tool /
22+ .fvm /
2423
25- # Visual Studio Code related
26- .classpath
27- .project
28- .settings /
29- .vscode /*
30- .ccls-cache
24+ # Plugin-related generated files
25+ .flutter-plugins
26+ .flutter-plugins-dependencies
3127
32- # Flutter repo-specific
33- /bin /cache /
34- /bin /internal /bootstrap.bat
35- /bin /internal /bootstrap.sh
36- /bin /mingit /
37- /dev /benchmarks /mega_gallery /
38- /dev /bots /.recipe_deps
39- /dev /bots /android_tools /
40- /dev /devicelab /ABresults * .json
41- /dev /docs /doc /
42- /dev /docs /api_docs.zip
43- /dev /docs /flutter.docs.zip
44- /dev /docs /lib /
45- /dev /docs /pubspec.yaml
46- /dev /integration_tests /** /xcuserdata
47- /dev /integration_tests /** /Pods
48- /packages /flutter /coverage /
49- version
50- analysis_benchmark.json
28+ # Generated plugin registrant for Flutter web and other platforms
29+ lib /generated_plugin_registrant.dart
5130
52- # packages file containing multi-root paths
53- .packages.generated
31+ # Documentation generated by dartdoc
32+ doc / api /
5433
55- # Flutter/Dart/Pub related
56- ** /doc /api /
57- .dart_tool /
58- .flutter-plugins
59- .flutter-plugins-dependencies
60- ** /generated_plugin_registrant.dart
61- .packages
62- .pub-preload-cache /
34+ # Dependency cache directories
6335.pub-cache /
6436.pub /
65- build /
66- flutter_ * .png
67- linked_ * .ds
68- unlinked.ds
69- unlinked_spec.ds
7037
71- # Android related
38+ # # Platform-Specific Build Artifacts
39+
40+ # ## Android
41+ # Gradle wrapper and build system files
7242** /android /** /gradle-wrapper.jar
73- .gradle /
43+ ** / android / .gradle /
7444** /android /captures /
7545** /android /gradlew
7646** /android /gradlew.bat
47+
48+ # Local configuration files (do not commit these)
7749** /android /local.properties
78- ** /android /** /GeneratedPluginRegistrant.java
7950** /android /key.properties
51+
52+ # Auto-generated plugin registrant
53+ ** /android /** /GeneratedPluginRegistrant.java
54+
55+ # Keystore files (if present)
8056* .jks
8157
82- # iOS/XCode related
58+ # Android Studio build outputs
59+ /android /app /debug
60+ /android /app /profile
61+ /android /app /release
62+
63+ # ## iOS & Xcode
64+ # Xcode and iOS build artifacts
8365** /ios /** /* .mode1v3
8466** /ios /** /* .mode2v3
8567** /ios /** /* .moved-aside
@@ -94,8 +76,10 @@ unlinked_spec.ds
9476** /ios /** /Pods /
9577** /ios /** /.symlinks /
9678** /ios /** /profile
97- ** /ios /** /xcuserdata
79+ ** /ios /** /xcuserdata /
9880** /ios /.generated /
81+
82+ # Flutter iOS-specific build files
9983** /ios /Flutter /.last_build_id
10084** /ios /Flutter /App.framework
10185** /ios /Flutter /Flutter.framework
@@ -109,44 +93,120 @@ unlinked_spec.ds
10993** /ios /ServiceDefinitions.json
11094** /ios /Runner /GeneratedPluginRegistrant. *
11195
112- # macOS
113- ** /Flutter /ephemeral /
114- ** /Pods /
96+ # Exceptions: Retain default Xcode configuration files
97+ ! ** /ios /** /default.mode1v3
98+ ! ** /ios /** /default.mode2v3
99+ ! ** /ios /** /default.pbxuser
100+ ! ** /ios /** /default.perspectivev3
101+
102+ # ## macOS
103+ # macOS build and generated files
115104** /macos /Flutter /GeneratedPluginRegistrant.swift
116105** /macos /Flutter /ephemeral
117106** /xcuserdata /
118107
119- # Windows
108+ # ## Windows
109+ # Windows build and generated files
120110** /windows /flutter /ephemeral /
121111** /windows /flutter /generated_plugin_registrant.cc
122112** /windows /flutter /generated_plugin_registrant.h
123113** /windows /flutter /generated_plugins.cmake
124114
125- # Linux
115+ # ## Linux
116+ # Linux build and generated files
126117** /linux /flutter /ephemeral /
127118** /linux /flutter /generated_plugin_registrant.cc
128119** /linux /flutter /generated_plugin_registrant.h
129120** /linux /flutter /generated_plugins.cmake
130121
131- # Coverage
132- coverage /
133-
134- # Symbols
135- app. * .symbols
122+ # # IDEs and Editor Settings
123+ # IntelliJ IDEA and Android Studio project files
124+ * .iml
125+ * .ipr
126+ * .iws
127+ .idea /
136128
137- # Exceptions to above rules.
138- ! ** /ios /** /default.mode1v3
139- ! ** /ios /** /default.mode2v3
140- ! ** /ios /** /default.pbxuser
141- ! ** /ios /** /default.perspectivev3
142- ! /packages /flutter_tools /test /data /dart_dependencies_test /** /.packages
143- ! /dev /ci /** /Gemfile.lock
129+ # Eclipse, VS Code, and related settings
130+ .classpath
131+ .project
132+ .settings /
133+ .vscode /*
144134! .vscode /settings.json
135+ .ccls-cache
136+
137+ # Other editors
138+ .atom /
139+
140+ # # Miscellaneous System Files & Temporary Files
141+ .DS_Store
142+ .buildlog /
143+ .history
144+ .svn /
145+ * .pyc
146+ * .swp
147+
148+ # # Web & JavaScript Generated Files
149+ * .dart.js
150+ * .info.json
151+ * .js
152+ * .js_
153+ * .js.deps
154+ * .js.map
155+
156+ # # Environment Variable Files
157+ .env *
158+
159+ # # Symbolication and Obfuscation Files
160+ app. * .symbols
161+ app. * .map.json
162+
163+ # ##############################################################################
164+ # 2. Specific Rules (Active by Default)
165+ # ##############################################################################
166+ #
167+ # These rules target files and directories that might contain sensitive data
168+ # or are used in specific contexts (e.g. Flutter framework repos, libraries).
169+ # If you need to commit any of these files (for example, in a Flutter app),
170+ # manually comment out the corresponding rule.
171+ #
172+
173+ # ------------------------------------------------------------------------------
174+ # Dependency Management: Pubspec Lock File
175+ # ------------------------------------------------------------------------------
176+ # For Flutter applications it is recommended to commit pubspec.lock.
177+ # For libraries, ignoring pubspec.lock avoids unintentional publishing.
178+ # By default, this rule is active (conservative). Comment it out if you want to commit pubspec.lock.
179+ pubspec.lock
180+
181+ # ------------------------------------------------------------------------------
182+ # Firebase Configuration Files
183+ # ------------------------------------------------------------------------------
184+ # The .firebase folder may contain sensitive Firebase credentials.
185+ # Ignoring it by default prevents accidental commits. Comment out if you need to include it.
186+ .firebase /
187+
188+ # ------------------------------------------------------------------------------
189+ # Flutter Repository–Specific Files (Monorepos/Framework Repos)
190+ # ------------------------------------------------------------------------------
191+ # These files are part of the Flutter framework repository.
192+ # If you are not working on the Flutter framework itself, these should remain ignored.
193+ bin /internal /engine.version
194+ /bin /cache /
195+ /bin /internal /bootstrap. *
196+ /bin /mingit /
197+ dev /benchmarks /mega_gallery /
198+ dev /bots /
199+ dev /devicelab /
200+ dev /docs /
201+ dev /integration_tests /
202+ packages /flutter /coverage /
203+ version
204+ analysis_benchmark.json
205+ .packages.generated
145206
146- # Monorepo
147- .cipd
148- .gclient
149- .gclient_entries
150- .python-version
151- .gclient_previous_custom_vars
152- .gclient_previous_sync_commits
207+ # ------------------------------------------------------------------------------
208+ # Additional Local Environment or Custom Use Cases
209+ # ------------------------------------------------------------------------------
210+ # If you have local editor configuration files or other custom setups that
211+ # you prefer not to share, they are ignored by default.
212+ .vscode /
0 commit comments