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 Craftplacer force-pushed the managed-disposal-and-singleton branch from b298abd to 66f9f2a Compare November 4, 2024 09:11
@Craftplacer Craftplacer requested a review from Jupi007 November 4, 2024 09:14
@Craftplacer Craftplacer force-pushed the managed-disposal-and-singleton branch from ef3617d to c785668 Compare November 4, 2024 10:10
@Craftplacer Craftplacer requested a review from Jupi007 November 4, 2024 10:10
@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

@Craftplacer Craftplacer force-pushed the managed-disposal-and-singleton branch from c785668 to 4482fc4 Compare November 4, 2024 10:41
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