We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Client
1 parent 8c325b9 commit 4d8e7efCopy full SHA for 4d8e7ef
pkgs/flutter_http_example/lib/main.dart
@@ -15,6 +15,14 @@ import 'http_client_factory.dart'
15
16
void main() {
17
runApp(Provider<Client>(
18
+ // `Provider` calls its `create` argument once when a `Client` is
19
+ // first requested (through `BuildContext.read<Client>()`) and uses that
20
+ // same instance for all future requests.
21
+ //
22
+ // Reusing the same `Client` may:
23
+ // - reduce memory usage
24
+ // - allow caching of fetched URLs
25
+ // - allow connections to be persisted
26
create: (_) => http_factory.httpClient(),
27
child: const BookSearchApp(),
28
dispose: (_, client) => client.close()));
0 commit comments