File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
Expand file tree Collapse file tree 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
255255If you depend on code that uses top-level functions (e.g. ` http.post ` ) or
256256calls the [ ` Client() ` ] [ clientconstructor ] constructor, then you can use
257257[ ` 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+ ```
259269
260270> [ !TIP]
261271> [ The Flutter HTTP example application] [ flutterhttpexample ] demonstrates
You can’t perform that action at this time.
0 commit comments