Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement singleton logic #22

Conversation

Craftplacer
Copy link
Collaborator

@Craftplacer Craftplacer commented Nov 4, 2024

Exiting marks the current global instance as disposed and removes the singleton, so the application can only ever have one valid and initiated instance.

packages/sane/lib/src/sane.dart Show resolved Hide resolved
packages/sane/lib/src/sane.dart Outdated Show resolved Hide resolved
@Craftplacer
Copy link
Collaborator Author

Our test runner should install SANE I think...

@Jupi007
Copy link
Collaborator

Jupi007 commented Nov 4, 2024

You're right, fixed in #25

Copy link
Collaborator

@Jupi007 Jupi007 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about if someone call init() on a disposed instance? 🤔

Copy link
Collaborator

@Jupi007 Jupi007 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@Jupi007 Jupi007 merged commit 137e087 into ubuntu-flutter-community:main Nov 4, 2024
3 checks passed
@Craftplacer Craftplacer deleted the managed-disposal-and-singleton branch November 10, 2024 14:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants