Skip to content

Commit

Permalink
Merge pull request #26 from Musaddiq625/development
Browse files Browse the repository at this point in the history
doc: Added deprecated tag and updated README with the latest code
  • Loading branch information
fonkamloic authored Jul 15, 2024
2 parents 522b413 + 6c312a5 commit cb7cdc6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ If you want to prevent user from taking screenshot or recording of your app. You

```dart
class _MyHomePageState extends State<MyHomePage> with WidgetsBindingObserver {
final _noScreenshot = NoScreenshot();
final _noScreenshot = NoScreenshot.instance;
AppLifecycleState? _notification;
@override
Expand Down
3 changes: 3 additions & 0 deletions lib/no_screenshot.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ class NoScreenshot implements NoScreenshotPlatform {
final _instancePlatform = NoScreenshotPlatform.instance;
NoScreenshot._();

@Deprecated("Using this may cause issue\nUse instance directly\ne.g: 'NoScreenshot.instance.screenshotOff()'")
NoScreenshot();

/// Made `NoScreenshot` class a singleton
static NoScreenshot get instance => NoScreenshot._();

Expand Down

0 comments on commit cb7cdc6

Please sign in to comment.