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 /
24
23
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
31
27
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
51
30
52
- # packages file containing multi-root paths
53
- .packages.generated
31
+ # Documentation generated by dartdoc
32
+ doc / api /
54
33
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
63
35
.pub-cache /
64
36
.pub /
65
- build /
66
- flutter_ * .png
67
- linked_ * .ds
68
- unlinked.ds
69
- unlinked_spec.ds
70
37
71
- # Android related
38
+ # # Platform-Specific Build Artifacts
39
+
40
+ # ## Android
41
+ # Gradle wrapper and build system files
72
42
** /android /** /gradle-wrapper.jar
73
- .gradle /
43
+ ** / android / .gradle /
74
44
** /android /captures /
75
45
** /android /gradlew
76
46
** /android /gradlew.bat
47
+
48
+ # Local configuration files (do not commit these)
77
49
** /android /local.properties
78
- ** /android /** /GeneratedPluginRegistrant.java
79
50
** /android /key.properties
51
+
52
+ # Auto-generated plugin registrant
53
+ ** /android /** /GeneratedPluginRegistrant.java
54
+
55
+ # Keystore files (if present)
80
56
* .jks
81
57
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
83
65
** /ios /** /* .mode1v3
84
66
** /ios /** /* .mode2v3
85
67
** /ios /** /* .moved-aside
@@ -94,8 +76,10 @@ unlinked_spec.ds
94
76
** /ios /** /Pods /
95
77
** /ios /** /.symlinks /
96
78
** /ios /** /profile
97
- ** /ios /** /xcuserdata
79
+ ** /ios /** /xcuserdata /
98
80
** /ios /.generated /
81
+
82
+ # Flutter iOS-specific build files
99
83
** /ios /Flutter /.last_build_id
100
84
** /ios /Flutter /App.framework
101
85
** /ios /Flutter /Flutter.framework
@@ -109,44 +93,120 @@ unlinked_spec.ds
109
93
** /ios /ServiceDefinitions.json
110
94
** /ios /Runner /GeneratedPluginRegistrant. *
111
95
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
115
104
** /macos /Flutter /GeneratedPluginRegistrant.swift
116
105
** /macos /Flutter /ephemeral
117
106
** /xcuserdata /
118
107
119
- # Windows
108
+ # ## Windows
109
+ # Windows build and generated files
120
110
** /windows /flutter /ephemeral /
121
111
** /windows /flutter /generated_plugin_registrant.cc
122
112
** /windows /flutter /generated_plugin_registrant.h
123
113
** /windows /flutter /generated_plugins.cmake
124
114
125
- # Linux
115
+ # ## Linux
116
+ # Linux build and generated files
126
117
** /linux /flutter /ephemeral /
127
118
** /linux /flutter /generated_plugin_registrant.cc
128
119
** /linux /flutter /generated_plugin_registrant.h
129
120
** /linux /flutter /generated_plugins.cmake
130
121
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 /
136
128
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 /*
144
134
! .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
145
206
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