File tree 1 file changed +11
-1
lines changed 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -255,7 +255,17 @@ In Flutter, you can use a one of many
255
255
If you depend on code that uses top-level functions (e.g. ` http.post ` ) or
256
256
calls the [ ` Client() ` ] [ clientconstructor ] constructor, then you can use
257
257
[ ` runWithClient ` ] ( runwithclient ) to ensure that the correct
258
- [ ` Client ` ] [ client ] is used.
258
+ ` Client ` is used.
259
+
260
+ You can ensure that only the ` Client ` that you have explicitly configured is
261
+ used by defining ` no_default_http_client=true ` in the environment. This will
262
+ also allow the default ` Client ` implementation to be removed, resulting in
263
+ a reduced application size.
264
+
265
+ ``` terminal
266
+ $ flutter build appbundle --dart-define=no_default_http_client=true ...
267
+ $ dart compile exe --define=no_default_http_client=true ...
268
+ ```
259
269
260
270
> [ !TIP]
261
271
> [ The Flutter HTTP example application] [ flutterhttpexample ] demonstrates
You can’t perform that action at this time.
0 commit comments