🚨 Fix web compile with the native http client
This commit is contained in:
12
lib/providers/adapters/sn_network_native.dart
Normal file
12
lib/providers/adapters/sn_network_native.dart
Normal file
@ -0,0 +1,12 @@
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:dio/dio.dart';
|
||||
import 'package:native_dio_adapter/native_dio_adapter.dart';
|
||||
|
||||
Dio addClientAdapter(Dio client) {
|
||||
if (Platform.isAndroid || Platform.isIOS || Platform.isMacOS) {
|
||||
// Switch to native implementation if possible
|
||||
client.httpClientAdapter = NativeAdapter();
|
||||
}
|
||||
return client;
|
||||
}
|
Reference in New Issue
Block a user