Files
cherrypick/lib/experimental/di.dart
Sergey Penkovsky e102b15022 added documents
2021-04-26 10:47:16 +03:00

27 lines
574 B
Dart

import 'package:dart_di/experimental/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;
}
}
}