fixed cide analizer warnings

This commit is contained in:
Sergey Penkovsky
2021-04-29 10:02:32 +03:00
parent 5ea3744961
commit 0e37d7f222
9 changed files with 95 additions and 97 deletions

View File

@@ -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;

View File

@@ -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!;
}

View File

@@ -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))) {