FetchJsonFunction typedef

FetchJsonFunction = Future<String> Function(String url, {Duration? timeout})

Functional type for fetching JSON from a URL. Returns the response body as a string, or throws on network/HTTP errors. Used to allow injecting a mock in tests without implementing HttpClientResponse.

Implementation

typedef FetchJsonFunction = Future<String> Function(
  String url, {
  Duration? timeout,
});