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
+5 -1
View File
@@ -91,6 +91,10 @@ class _SettingsScreenState extends State<SettingsScreen> {
content: Text('Backfill finished for last year.'),
),
);
} else {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text(controller.errorMessage!)),
);
}
},
icon: const Icon(Icons.history),
@@ -112,7 +116,7 @@ class _SettingsScreenState extends State<SettingsScreen> {
),
const SizedBox(height: 16),
const Text(
'ForexRateAPI key is configured in code constant forexRateApiKey.',
'ExchangeratesAPI key is loaded from .env (EXCHANGE_RATE_API_KEY).',
),
],
),