runable
This commit is contained in:
23
lib/core/providers/core_providers.dart
Normal file
23
lib/core/providers/core_providers.dart
Normal file
@@ -0,0 +1,23 @@
|
||||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||
import '../network/dio_client.dart';
|
||||
import '../storage/secure_storage.dart';
|
||||
|
||||
part 'core_providers.g.dart';
|
||||
|
||||
/// Provider for DioClient (singleton)
|
||||
///
|
||||
/// This is the global HTTP client used across the entire app.
|
||||
/// It's configured with interceptors, timeout settings, and auth token injection.
|
||||
@Riverpod(keepAlive: true)
|
||||
DioClient dioClient(Ref ref) {
|
||||
return DioClient();
|
||||
}
|
||||
|
||||
/// Provider for SecureStorage (singleton)
|
||||
///
|
||||
/// This is the global secure storage used for storing sensitive data like tokens.
|
||||
/// Uses platform-specific secure storage (Keychain on iOS, EncryptedSharedPreferences on Android).
|
||||
@Riverpod(keepAlive: true)
|
||||
SecureStorage secureStorage(Ref ref) {
|
||||
return SecureStorage();
|
||||
}
|
||||
Reference in New Issue
Block a user