cleanup code a bit

This commit is contained in:
Rene Kievits
2025-10-28 01:59:41 +01:00
parent ab86f015c1
commit 59fde3457d
9 changed files with 62 additions and 56 deletions

View File

@@ -26,11 +26,11 @@ class _SettingsScreenState extends State<SettingsScreen> {
final repo = Provider.of<DeckRepository>(context, listen: false);
await repo.setApiKey(apiKey);
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(content: Text('API key saved!')),
);
if (mounted) {
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(content: Text('API key saved!')),
);
Navigator.of(context).pushReplacement(
MaterialPageRoute(builder: (_) => const HomeScreen()),
);