worldhopper/lib/providers/server_software_provider.dart
Felipe M. 01d39e58b3
feat: add server software type abstraction with Kavita support
Introduce a strategy pattern for server-specific operations (mark as
read/unread) with Kavita as the first concrete implementation. Generic
servers fall through to the existing PSE page-fetch fallback.

- Add ServerSoftwareType enum, service registry, and Kavita/Generic
  implementations with JWT authentication and token caching
- Add DioFactory with redirect-following interceptor for REST calls
- Extend OPDSServer model with softwareType/credentials fields and
  database migrations (v9, v10)
- Add server type selection and credential fields to add/edit screens
- Fix dispose-safety in both reader screens: capture syncProgress in
  deactivate(), add null guards, await markAsRead before deleting
  progress, and wrap detached futures in try-catch
- Respect syncProgressNotifierProvider user preference in markAsRead

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 20:39:32 +01:00

7 lines
312 B
Dart

import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:worldhopper/services/server_software/server_software_service.dart';
/// Provider for the ServerSoftwareService singleton.
final serverSoftwareServiceProvider = Provider<ServerSoftwareService>((ref) {
return ServerSoftwareService();
});