mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2026-02-23 08:34:39 +01:00
opt.: snippet confirmation (#363)
This commit is contained in:
@@ -60,7 +60,9 @@ class _HomePageState extends State<HomePage>
|
||||
@override
|
||||
void didChangeDependencies() {
|
||||
super.didChangeDependencies();
|
||||
l10n = AppLocalizations.of(context)!;
|
||||
context.setLibL10n();
|
||||
final appL10n = AppLocalizations.of(context);
|
||||
if (appL10n != null) l10n = appL10n;
|
||||
_isLandscape.value =
|
||||
MediaQuery.of(context).orientation == Orientation.landscape;
|
||||
}
|
||||
|
||||
@@ -127,7 +127,22 @@ void _onTapMoreBtns(
|
||||
if (snippets == null || snippets.isEmpty) return;
|
||||
final snippet = snippets.firstOrNull;
|
||||
if (snippet == null) return;
|
||||
AppRoutes.ssh(spi: spi, initCmd: snippet.fmtWith(spi)).checkGo(
|
||||
final fmted = snippet.fmtWith(spi);
|
||||
final sure = await context.showRoundDialog<bool>(
|
||||
title: l10n.attention,
|
||||
child: SingleChildScrollView(
|
||||
child: SimpleMarkdown(data: '```shell\n$fmted\n```'),
|
||||
),
|
||||
actions: [
|
||||
CountDownBtn(
|
||||
onTap: () => context.pop(true),
|
||||
text: l10n.run,
|
||||
afterColor: Colors.red,
|
||||
),
|
||||
],
|
||||
);
|
||||
if (sure != true) return;
|
||||
AppRoutes.ssh(spi: spi, initCmd: fmted).checkGo(
|
||||
context: context,
|
||||
check: () => _checkClient(context, spi.id),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user