blob: cb36597c23ec864d8239f5cf4a98e29a8ca2e9d4 [file] [log] [blame]
// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'dart:io';
import 'package:cronet_http/cronet_http.dart';
import 'package:cupertino_http/cupertino_http.dart';
import 'package:http/http.dart';
Client httpClient() {
if (Platform.isAndroid) {
return CronetClient.defaultCronetEngine();
}
if (Platform.isIOS || Platform.isMacOS) {
return CupertinoClient.defaultSessionConfiguration();
}
return Client(); // Return the default client.
}