refactored di library.

This commit is contained in:
Sergey Penkovsky
2021-04-26 09:43:57 +03:00
parent 9032abe21a
commit e726e3bf30
23 changed files with 71 additions and 1215 deletions

26
lib/di.dart Normal file
View 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;
}
}
}