-
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Disable screenshots when encryption is enabled
Close #17
- Loading branch information
1 parent
85e80ac
commit 3044ece
Showing
9 changed files
with
152 additions
and
6 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
// Copyright (C) 2024 Yaroslav Pronin <[email protected]> | ||
// | ||
// This file is part of Blink Comparison. | ||
// | ||
// Blink Comparison is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// Blink Comparison is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with Blink Comparison. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
import 'package:flutter_windowmanager_plus/flutter_windowmanager_plus.dart'; | ||
import 'package:injectable/injectable.dart'; | ||
|
||
abstract class WindowManager { | ||
/// Allow/disallow screenshots | ||
Future<bool> setSecureFlag(bool enable); | ||
} | ||
|
||
@Singleton(as: WindowManager) | ||
class WindowManagerImpl implements WindowManager { | ||
@override | ||
Future<bool> setSecureFlag(bool enable) async { | ||
if (enable) { | ||
return FlutterWindowManagerPlus.addFlags( | ||
FlutterWindowManagerPlus.FLAG_SECURE, | ||
); | ||
} else { | ||
return FlutterWindowManagerPlus.clearFlags( | ||
FlutterWindowManagerPlus.FLAG_SECURE, | ||
); | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
// Copyright (C) 2024 Yaroslav Pronin <[email protected]> | ||
// | ||
// This file is part of Blink Comparison. | ||
// | ||
// Blink Comparison is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// Blink Comparison is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU General Public License | ||
// along with Blink Comparison. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
import 'package:blink_comparison/core/window_manager.dart'; | ||
import 'package:mocktail/mocktail.dart'; | ||
|
||
class MockWindowManager extends Mock implements WindowManager {} |
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