mirror of
https://github.com/pese-git/cherrypick.git
synced 2026-01-23 21:13:35 +00:00
refactored di library.
This commit is contained in:
26
lib/di.dart
Normal file
26
lib/di.dart
Normal file
@@ -0,0 +1,26 @@
|
||||
import 'package:dart_di/scope.dart';
|
||||
|
||||
Scope? _rootScope = null;
|
||||
|
||||
class DartDi {
|
||||
/// RU: Метод открывает главный [Scope].
|
||||
/// ENG: The method opens the main [Scope].
|
||||
///
|
||||
/// return
|
||||
static Scope openRootScope() {
|
||||
if (_rootScope == null) {
|
||||
_rootScope = Scope(null);
|
||||
}
|
||||
return _rootScope!;
|
||||
}
|
||||
|
||||
/// RU: Метод закрывает главный [Scope].
|
||||
/// ENG: The method close the main [Scope].
|
||||
///
|
||||
///
|
||||
static void closeRootScope() {
|
||||
if (_rootScope != null) {
|
||||
_rootScope = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user