Files
cherrypick/lib/di.dart

27 lines
561 B
Dart
Raw Normal View History

2021-04-26 09:43:57 +03:00
import 'package:dart_di/scope.dart';
2021-04-22 15:22:09 +03:00
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;
}
}
}