opt.: replace first with firstOrNull

This commit is contained in:
lollipopkit
2024-03-06 15:33:00 +08:00
parent fc00b4b961
commit 602ef60bf0
7 changed files with 11 additions and 9 deletions

View File

@@ -135,8 +135,8 @@ void _onTapMoreBtns(
name: (e) => e.name,
);
if (snippets == null || snippets.isEmpty) return;
final snippet = snippets.first;
final snippet = snippets.firstOrNull;
if (snippet == null) return;
AppRoute.ssh(spi: spi, initCmd: snippet.fmtWith(spi)).checkGo(
context: context,
check: () => _checkClient(context, spi.id),