From e102b15022d73d04e265b468cc57171b88e36c9e Mon Sep 17 00:00:00 2001 From: Sergey Penkovsky Date: Thu, 22 Apr 2021 15:22:09 +0300 Subject: [PATCH] added documents --- lib/experimental/di.dart | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/lib/experimental/di.dart b/lib/experimental/di.dart index 533dda5..3f8578c 100644 --- a/lib/experimental/di.dart +++ b/lib/experimental/di.dart @@ -1 +1,26 @@ -class DartDi {} +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; + } + } +}