mirror of
https://github.com/pese-git/cherrypick.git
synced 2026-01-24 05:25:19 +00:00
fixed cide analizer warnings
This commit is contained in:
@@ -20,8 +20,8 @@ class Binding<T> {
|
||||
late Mode _mode;
|
||||
late Type _key;
|
||||
late String _name;
|
||||
T? _instance = null;
|
||||
T? Function()? _provider = null;
|
||||
T? _instance;
|
||||
T? Function()? _provider;
|
||||
late bool _isSingeltone = false;
|
||||
late bool _isNamed = false;
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
|
||||
import 'package:cherrypick/scope.dart';
|
||||
|
||||
Scope? _rootScope = null;
|
||||
Scope? _rootScope;
|
||||
|
||||
class CherryPick {
|
||||
/// RU: Метод открывает главный [Scope].
|
||||
@@ -21,9 +21,7 @@ class CherryPick {
|
||||
///
|
||||
/// return
|
||||
static Scope openRootScope() {
|
||||
if (_rootScope == null) {
|
||||
_rootScope = Scope(null);
|
||||
}
|
||||
_rootScope ??= Scope(null);
|
||||
return _rootScope!;
|
||||
}
|
||||
|
||||
|
||||
@@ -103,8 +103,8 @@ class Scope {
|
||||
T? tryResolve<T>({String? named}) {
|
||||
// 1 Поиск зависимости по всем модулям текущего скоупа
|
||||
if (_modulesList.isNotEmpty) {
|
||||
for (Module module in _modulesList) {
|
||||
for (Binding binding in module.bindingSet) {
|
||||
for (var module in _modulesList) {
|
||||
for (var binding in module.bindingSet) {
|
||||
if (binding.key == T &&
|
||||
((!binding.isNamed && named == null) ||
|
||||
(binding.isNamed && named == binding.name))) {
|
||||
|
||||
Reference in New Issue
Block a user