diff --git a/lib/presentation/views/main_menu/create_group_view.dart b/lib/presentation/views/main_menu/create_group_view.dart index 45f5af8..3beb62a 100644 --- a/lib/presentation/views/main_menu/create_group_view.dart +++ b/lib/presentation/views/main_menu/create_group_view.dart @@ -112,6 +112,7 @@ class _CreateGroupViewState extends State { bool success = await db.playerDao.addPlayer( player: Player(name: playerName), ); + if (!context.mounted) return; if (success) { loadPlayerList(); ScaffoldMessenger.of(context).showSnackBar( @@ -120,7 +121,7 @@ class _CreateGroupViewState extends State { content: Center( child: Text( 'Successfully added player $playerName.', - style: TextStyle(color: Colors.white), + style: const TextStyle(color: Colors.white), ), ), ), @@ -132,7 +133,7 @@ class _CreateGroupViewState extends State { content: Center( child: Text( 'Could not add player $playerName.', - style: TextStyle(color: Colors.white), + style: const TextStyle(color: Colors.white), ), ), ); diff --git a/lib/presentation/widgets/custom_search_bar.dart b/lib/presentation/widgets/custom_search_bar.dart index 61a2154..8a483e5 100644 --- a/lib/presentation/widgets/custom_search_bar.dart +++ b/lib/presentation/widgets/custom_search_bar.dart @@ -42,7 +42,7 @@ class CustomSearchBar extends StatelessWidget { : Colors.grey.withValues(alpha: 0.2), ), ), - SizedBox(width: 5), + const SizedBox(width: 5), ] : null, backgroundColor: WidgetStateProperty.all(CustomTheme.boxColor),