Create Igel
This commit is contained in:
+8
-6
@@ -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)));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user