Refactor ForexRateAPI integration to load API key from .env file and enhance error handling

Signed-off-by: Hans Kokx <hans.d.kokx@gmail.com>
This commit is contained in:
2026-03-19 23:48:26 +01:00
parent a775a20dd2
commit e6c16967f9
8 changed files with 244 additions and 81 deletions
+3 -3
View File
@@ -23,10 +23,10 @@ Simple Flutter app to track US rental income and convert to SEK for Swedish tax
## Setup
1. Set your FX API app key in `lib/state/rent_controller.dart`:
1. Create `.env` in the project root with your FX API key:
```dart
const String forexRateApiKey = 'REPLACE_WITH_YOUR_FOREXRATE_API_KEY';
```env
EXCHANGE_RATE_API_KEY=REPLACE_WITH_YOUR_EXCHANGE_RATE_API_KEY
```
1. Install dependencies: