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:
@@ -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).',
|
||||
),
|
||||
],
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user