refactor: replace dio with package:http

This commit is contained in:
edde746
2026-04-08 00:43:08 +02:00
parent 8e7431e7e5
commit 15b22f75a8
21 changed files with 839 additions and 552 deletions
+5 -5
View File
@@ -1,14 +1,14 @@
import 'package:dio/dio.dart';
import '../i18n/strings.g.dart';
import 'app_logger.dart';
import 'plex_http_exception.dart';
/// Shared helpers for translating network errors into user-friendly messages.
String mapDioErrorToMessage(DioException error, {required String context}) {
String mapHttpErrorToMessage(PlexHttpException error, {required String context}) {
switch (error.type) {
case DioExceptionType.connectionTimeout:
case DioExceptionType.receiveTimeout:
case PlexHttpErrorType.connectionTimeout:
case PlexHttpErrorType.receiveTimeout:
return t.errors.connectionTimeout(context: context);
case DioExceptionType.connectionError:
case PlexHttpErrorType.connectionError:
return t.errors.connectionFailed;
default:
appLogger.e('Error loading $context', error: error);