Create Igel

This commit is contained in:
2025-10-21 21:42:24 +02:00
parent 9654072b1d
commit e7ac4718dc
4 changed files with 198 additions and 93 deletions
+8 -6
View File
@@ -5,15 +5,17 @@ import 'features/auth/data/token_storage.dart';
import 'shared/api_client.dart';
import 'features/igel/data/igel_repository.dart';
const kApiBase =
String.fromEnvironment('API_BASE', defaultValue: 'https://api.windesign.at/hedgehogs.php?r=');
// String.fromEnvironment('API_BASE', defaultValue: 'https://api.windesign.at/hedgehogs.php');
const kApiBase = String.fromEnvironment('API_BASE',
defaultValue: 'https://api.windesign.at/hedgehogs.php?r=');
final tokenStorageProvider =
Provider<TokenStorage>((ref) => TokenStorage(kApiBase));
final apiClientProvider = Provider<ApiClient>((ref) => ApiClient(kApiBase,
getAccessToken: () =>
ref.read(tokenStorageProvider).getValidAccessToken()));
final apiClientProvider = Provider<ApiClient>((ref) => ApiClient(
kApiBase,
getAccessToken: () =>
ref.read(tokenStorageProvider).getValidAccessToken(),
onUnauthorized: () => ref.read(tokenStorageProvider).refreshAccess(),
));
final igelRepoProvider = Provider<IgelRepository>(
(ref) => IgelRepository(ref.read(apiClientProvider)));