-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change-Id: Id30d5f2af097d7216eda906dc52d9d3aa68a9a9b
- Loading branch information
Showing
13 changed files
with
1,014 additions
and
664 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/ui/flutter_app/lib/game_page/services/import_export/export_service.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// SPDX-License-Identifier: GPL-3.0-or-later | ||
// Copyright (C) 2019-2025 The Sanmill developers (see AUTHORS file) | ||
|
||
// export_service.dart | ||
|
||
part of '../mill.dart'; | ||
|
||
class ExportService { | ||
const ExportService._(); | ||
|
||
/// Exports the game to the device's clipboard. | ||
static Future<void> exportGame(BuildContext context) async { | ||
await Clipboard.setData( | ||
ClipboardData(text: GameController().gameRecorder.moveHistoryText), | ||
); | ||
|
||
if (!context.mounted) { | ||
return; | ||
} | ||
|
||
rootScaffoldMessengerKey.currentState! | ||
.showSnackBarClear(S.of(context).moveHistoryCopied); | ||
|
||
Navigator.pop(context); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/ui/flutter_app/lib/game_page/services/import_export/import_exceptions.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// SPDX-License-Identifier: GPL-3.0-or-later | ||
// Copyright (C) 2019-2025 The Sanmill developers (see AUTHORS file) | ||
|
||
// import_exceptions.dart | ||
|
||
part of '../mill.dart'; | ||
|
||
/// Custom response to throw when importing the game history. | ||
abstract class ImportResponse {} | ||
|
||
class ImportFormatException extends FormatException { | ||
const ImportFormatException([String? source, int? offset]) | ||
: super("Cannot import ", source, offset); | ||
} |
Oops, something went wrong.