Skip to content
This repository has been archived by the owner on Jun 28, 2023. It is now read-only.

Commit

Permalink
優化:重新載入程式後顯示提視窗
Browse files Browse the repository at this point in the history
  • Loading branch information
SiongSng committed Sep 18, 2021
1 parent 0a12b3c commit e6c9e07
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lang/zh_tw.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
"settings.advanced.max.log": "遊戲日誌紀錄最大行數",
"settings.advanced.channel.stable": "穩定版",
"settings.advanced.channel.dev": "開發版",
"settings.advanced.channel.debug":"開發人員除錯版",
"settings.advanced.channel.debug": "開發人員除錯版",
"edit.instance.title": "編輯安裝檔",
"edit.instance.homepage.instance.name": "安裝檔名稱: ",
"edit.instance.homepage.instance.enter": "請輸入安裝檔名稱",
Expand Down Expand Up @@ -191,5 +191,7 @@
"modpack.from.curseforge": "從 CurseForge 下載模組包",
"modpack.from.ftb": "從 FTB 下載模組包",
"modpack.import": "從本機檔案導入",
"modpack.all_version": "全版本"
"modpack.all_version": "全版本",
"uttily.reload.hot": "熱重載應用程式完成",
"uttily.reload": "重新載入應用程式完成"
}
12 changes: 12 additions & 0 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,23 @@ class LauncherHome extends StatelessWidget {
onInvoke: (HotReloadIntent intent) {
logger.send("Hot Reload");
Phoenix.rebirth(navigator.context);
showDialog(
context: navigator.context,
builder: (context) => AlertDialog(
title: Text(i18n.format('uttily.reload.hot')),
actions: [OkClose()],
));
}),
RestartIntent: CallbackAction<RestartIntent>(
onInvoke: (RestartIntent intent) {
logger.send("Reload");
runApp(LauncherHome());
showDialog(
context: navigator.context,
builder: (context) => AlertDialog(
title: Text(i18n.format('uttily.reload')),
actions: [OkClose()],
));
}),
},
);
Expand Down

0 comments on commit e6c9e07

Please sign in to comment.