@@ -92,26 +92,74 @@ Two specific points to expand on:
92
92
93
93
### Setting up
94
94
95
- 1 . Follow the [ Flutter installation guide] ( https://docs.flutter.dev/get-started/install )
96
- for your platform of choice.
97
- 2 . Switch to the latest version of Flutter by running ` flutter channel main `
98
- and ` flutter upgrade ` (see [ Flutter version] ( #flutter-version ) below).
99
- 3 . Ensure Flutter is correctly configured by running ` flutter doctor ` .
100
- 4 . Start the app with ` flutter run ` , or from your IDE.
95
+ 1 . Setup the pinned version of flutter.
96
+ (See [ Flutter version] ( #flutter-version ) for details on what this
97
+ step does and read it if you want to use your own version of
98
+ flutter.)
99
+
100
+ 1.1. Make sure you have initialized submodule by doing (do
101
+ not do ` --depth=1 ` as flutter relies on tags to know its version):
102
+
103
+ ```sh
104
+ # Update and initialize submodule
105
+ git submodule update --init
106
+ # Run setup-vendor-flutter
107
+ ./tools/setup-vendor-flutter
108
+ ```
109
+
110
+ 1.2. Install [direnv][direnv], and set up its hook:
111
+
112
+ ```sh
113
+ # For MacOS users, you can use Homebrew:
114
+ brew install direnv
115
+
116
+ # For Linux users, direnv is typically distributed as a package,
117
+ # so you can use apt-get (see direnv website for distro-specific
118
+ # instructions if this doesn't work):
119
+ sudo apt install direnv
120
+
121
+ # After installation, make sure to run this in the zulip-flutter
122
+ # directory to allow the .envrc file.
123
+ direnv allow
124
+ ```
125
+ 2 . Ensure Flutter is correctly configured by running ` flutter doctor ` .
126
+ 3 . Start the app with ` flutter run ` , or from your IDE.
127
+ If you're using VSCode, you're set.
128
+ If you're using Android Studio, please read the next step.
129
+
130
+ 3.1 For Android Studio users only (unless you are using your own
131
+ custom version of flutter):
132
+
133
+ After you first open, the project, go to:
134
+ ` Settings -> Languages & Frameworks -> Flutter `
135
+ Under ` Flutter SDK Path ` , enter ` <REPO_DIR>/vendor/flutter ` (where
136
+ ` <REPO_DIR> ` is the location of the checkout of the repo).
101
137
102
138
103
139
### Flutter version
104
140
105
- While in the beta phase, we use the latest Flutter from Flutter's
106
- main branch. Use ` flutter channel main ` and ` flutter upgrade ` .
141
+ We pin to a particular version of flutter SDK via git submodules in
142
+ [ vendor/flutter/] ( vendor/flutter/ ) .
143
+ If your local checkout of this repository does not have this submodule
144
+ checked out at the same commit, the build may fail.
107
145
108
- We don't pin a specific version, because Flutter itself doesn't offer
109
- a way to do so. So far that hasn't been a problem. When it becomes one,
110
- we'll figure it out; there are several tools for this in the Flutter
111
- community. See [ issue # 15 ] [ ] .
146
+ However, if you want to manage your own flutter SDK version you can
147
+ opt out of this behavior by either of:
148
+ - Skip installing direnv or don't do ` direnv allow ` .
149
+ - Comment out the lines in ` .envrc ` .
112
150
113
- [ issue #15 ] : https://github.com/zulip/zulip-flutter/issues/15
151
+ Do note that if you do this, you need to manually make sure that the
152
+ flutter SDK version matches or is compatible with the version
153
+ indicated by the submodule commit SHA.
114
154
155
+ Otherwise, the build can fail as we have not tested the current code
156
+ with that particular flutter SDK version.
157
+
158
+ If you want manage your own flutter SDK version, follow the [ Flutter
159
+ installation guide] ( https://docs.flutter.dev/get-started/install ) for
160
+ your platform of choice.
161
+
162
+ [ direnv ] : https://direnv.net/
115
163
116
164
### Tests
117
165
@@ -242,13 +290,16 @@ that's a good prompt to do this. We also do this when there's a
242
290
new PR merged that we particularly want to take.
243
291
244
292
To update the version bounds:
293
+ * First, make sure you're on the ` main ` channel, run:
294
+ ` flutter channel main ` .
245
295
* Use ` flutter upgrade ` to upgrade your local Flutter and Dart.
246
296
* Update the lower bounds at ` environment ` in ` pubspec.yaml `
247
297
to the new versions, as seen in ` flutter --version ` .
248
298
* Run ` flutter pub get ` , which will update ` pubspec.lock ` .
249
299
* Make a quick check that things work: ` tools/check ` ,
250
300
and do a quick smoke-test of the app.
251
- * Commit and push the changes in ` pubspec.yaml ` and ` pubspec.lock ` .
301
+ * Commit and push the changes in the submodule ` vendor/flutter ` ,
302
+ ` pubspec.yaml ` and ` pubspec.lock ` .
252
303
253
304
254
305
### Upgrading dependencies
0 commit comments