flutter: Support exporting game
This commit is contained in:
parent
6d8af3cfcf
commit
61e3da9034
|
@ -212,6 +212,10 @@
|
|||
"@importGame": {
|
||||
"description": "Import game"
|
||||
},
|
||||
"exportGame": "Spiel exportieren",
|
||||
"@exportGame": {
|
||||
"description": "Export game"
|
||||
},
|
||||
"gameImported": "Spiel aus der Zwischenablage importiert.",
|
||||
"@gameImported": {
|
||||
"description": "Game imported from clipboard."
|
||||
|
|
|
@ -212,6 +212,10 @@
|
|||
"@importGame": {
|
||||
"description": "Import game"
|
||||
},
|
||||
"exportGame": "Export game",
|
||||
"@exportGame": {
|
||||
"description": "Export game"
|
||||
},
|
||||
"gameImported": "Game imported from clipboard.",
|
||||
"@gameImported": {
|
||||
"description": "Game imported from clipboard."
|
||||
|
|
|
@ -212,6 +212,10 @@
|
|||
"@importGame": {
|
||||
"description": "Import game"
|
||||
},
|
||||
"exportGame": "صادرات بازی",
|
||||
"@exportGame": {
|
||||
"description": "Export game"
|
||||
},
|
||||
"gameImported": "بازی از کلیپ بورد وارد شده است.",
|
||||
"@gameImported": {
|
||||
"description": "Game imported from clipboard."
|
||||
|
|
|
@ -52,7 +52,8 @@
|
|||
"thinking": "对方思考中...",
|
||||
"newGame": "开始新局",
|
||||
"startNewGame": "开始新局",
|
||||
"importGame": "导入棋谱",
|
||||
"importGame": "导入棋局",
|
||||
"exportGame": "导出棋局",
|
||||
"gameImported": "棋谱已从剪贴板导入",
|
||||
"startRecording": "开始录制",
|
||||
"recording": "录制中...",
|
||||
|
|
|
@ -571,6 +571,16 @@ class _GamePageState extends State<GamePage>
|
|||
showTip(S.of(context).gameImported);
|
||||
}
|
||||
|
||||
onExportGameButtonPressed() async {
|
||||
Navigator.of(context).pop();
|
||||
|
||||
final moveHistoryText = Game.instance.position.moveHistoryText;
|
||||
|
||||
Clipboard.setData(ClipboardData(text: moveHistoryText)).then((_) {
|
||||
showSnackBar(S.of(context).moveHistoryCopied);
|
||||
});
|
||||
}
|
||||
|
||||
/*
|
||||
onStartRecordingButtonPressed() async {
|
||||
Navigator.of(context).pop();
|
||||
|
@ -686,6 +696,15 @@ class _GamePageState extends State<GamePage>
|
|||
),
|
||||
onPressed: onImportGameButtonPressed,
|
||||
),
|
||||
SizedBox(height: AppTheme.sizedBoxHeight),
|
||||
SimpleDialogOption(
|
||||
child: Text(
|
||||
S.of(context).exportGame,
|
||||
style: AppTheme.simpleDialogOptionTextStyle,
|
||||
textAlign: TextAlign.center,
|
||||
),
|
||||
onPressed: onExportGameButtonPressed,
|
||||
),
|
||||
/*
|
||||
SizedBox(height: AppTheme.sizedBoxHeight),
|
||||
Config.experimentsEnabled
|
||||
|
|
Loading…
Reference in New Issue