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

isfinal docs #330

Merged
merged 4 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

## [7.6.1] - 31.08.2023

* added `isFinal` scope parameter which fixes https://github.com/fluttercommunity/get_it/issues/326
* version bump of dependencies and updates readme

## [7.6.0] - 09.05.2023
Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,10 @@ Another example could be a shopping basket where you want to ensure that not a c
/// is still valid while it is executed
/// [init] optional function to register Objects immediately after the new scope is
/// pushed. This ensures that [onScopeChanged] will be called after their registration
/// if [isFinal] is set to true, you can't register any new objects in this scope after
/// this call. In Other words you have to register the objects for this scope inside
/// [init] if you set [isFinal] to true. This is useful if you want to ensure that
/// no new objects are registered in this scope by accident which could lead to race conditions
void pushNewScope({void Function(GetIt getIt)? init,String scopeName, ScopeDisposeFunc dispose});

/// Disposes all factories/Singletons that have been registered in this scope
Expand Down
3 changes: 3 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ include: package:lint/analysis_options_package.yaml
linter:
rules:
- always_declare_return_types
- unawaited_futures
- discarded_futures

# ------ Disable individual rules ----- #
# --- #
# Turn off what you don't like. #
Expand Down
4 changes: 4 additions & 0 deletions lib/get_it.dart
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,10 @@ abstract class GetIt {
/// is still valid while it is executed
/// [init] optional function to register Objects immediately after the new scope is
/// pushed. This ensures that [onScopeChanged] will be called after their registration
/// if [isFinal] is set to true, you can't register any new objects in this scope after
/// this call. In Other words you have to register the objects for this scope inside
/// [init] if you set [isFinal] to true. This is useful if you want to ensure that
/// no new objects are registered in this scope by accident which could lead to race conditions
void pushNewScope({
void Function(GetIt getIt)? init,
String? scopeName,
Expand Down
Loading