diff --git a/packages/koin/lib/src/context/context_handler.dart b/packages/koin/lib/src/context/context_handler.dart index ec41372..590c2a5 100644 --- a/packages/koin/lib/src/context/context_handler.dart +++ b/packages/koin/lib/src/context/context_handler.dart @@ -19,9 +19,8 @@ import '../koin_application.dart'; import '../koin_dart.dart'; import 'context.dart'; -/// +//ignore: avoid_classes_with_only_static_members /// Help hold any implementation of KoinContext -/// class KoinContextHandler { static KoinContext? _context; diff --git a/packages/koin/lib/src/definition/definition.dart b/packages/koin/lib/src/definition/definition.dart index f7be47c..afb046d 100644 --- a/packages/koin/lib/src/definition/definition.dart +++ b/packages/koin/lib/src/definition/definition.dart @@ -5,6 +5,7 @@ typedef ProviderCreate = T Function(Scope scope); typedef ProviderCreateParam = T Function(Scope scope, A param); +// ignore: one_member_abstracts abstract class ProviderCreateBase { T create(Parameter? parameter, Scope scope); } diff --git a/packages/koin/lib/src/instance/instance_factory.dart b/packages/koin/lib/src/instance/instance_factory.dart index 642934c..f7c58d1 100644 --- a/packages/koin/lib/src/instance/instance_factory.dart +++ b/packages/koin/lib/src/instance/instance_factory.dart @@ -44,9 +44,9 @@ abstract class InstanceFactory { /// T createState(InstanceContext context) { try { - final parameters = context.parameter; + final parameter = context.parameter; koin.loggerObserver.onCreate(this); - return beanDefinition.definition.create(parameters, context.scope); + return beanDefinition.definition.create(parameter, context.scope); } catch (erro) { koin.logger.error(''' Instance creation error : could not create instance for $beanDefinition: ${erro.toString()}'''); diff --git a/packages/koin/lib/src/scope/scope.dart b/packages/koin/lib/src/scope/scope.dart index 5891a92..5a5733f 100644 --- a/packages/koin/lib/src/scope/scope.dart +++ b/packages/koin/lib/src/scope/scope.dart @@ -30,6 +30,7 @@ import '../logger.dart'; import '../qualifier.dart'; import 'scope_definition.dart'; +// ignore: one_member_abstracts abstract class ScopeCallback { void onScopeClose(); } diff --git a/packages/koin/test/core/error_check_test.dart b/packages/koin/test/core/error_check_test.dart index 2aea5a7..5ee30d4 100644 --- a/packages/koin/test/core/error_check_test.dart +++ b/packages/koin/test/core/error_check_test.dart @@ -41,6 +41,7 @@ void main() { }); // TODO + // Analyze a way to treat /* test('cycle error', () { var app = koinApplication((app) { diff --git a/packages/koin/test/core/parameters_injection_test.dart b/packages/koin/test/core/parameters_injection_test.dart index f575efc..736fc14 100644 --- a/packages/koin/test/core/parameters_injection_test.dart +++ b/packages/koin/test/core/parameters_injection_test.dart @@ -96,18 +96,13 @@ void main() { expect(b.id, 43); }); - // TODO - // Analyze if it is really necessary. test('shoud trow a exception when not pass parameters - getWithParams', () { var app = koinApplication((app) { app.module( Module()..singleWithParam((s, id) => MySingle(id))); }); - final mySingle = app.koin.get(); - expect(() => app.koin.get(), throwsA(isA())); - print(mySingle); - }, skip: true); + }); } diff --git a/packages/koin_flutter/lib/src/scope_observer.dart b/packages/koin_flutter/lib/src/scope_observer.dart index 6d2023d..f15440d 100644 --- a/packages/koin_flutter/lib/src/scope_observer.dart +++ b/packages/koin_flutter/lib/src/scope_observer.dart @@ -1,6 +1,7 @@ import 'package:flutter/widgets.dart'; import 'package:koin/internals.dart'; +// ignore: avoid_classes_with_only_static_members class FlutterKoinScopeObserver { static ScopeWidgetObersever scopeWidgetObserver = ScopeWidgetObersever(); } diff --git a/packages/koin_flutter/test/widget_extension_test.dart b/packages/koin_flutter/test/widget_extension_test.dart index 6bffc8d..5026aae 100644 --- a/packages/koin_flutter/test/widget_extension_test.dart +++ b/packages/koin_flutter/test/widget_extension_test.dart @@ -86,12 +86,12 @@ void main() { // Create the Finders. final componentSingleIdFinder = find.text('1'); - //final componentBSingleFinder = find.text('10'); + final componentBSingleFinder = find.text('10'); final componentIdFactoryFinder = find.text('60'); final componentScopedFinder = find.text('30'); expect(componentSingleIdFinder, findsNWidgets(1)); - //expect(componentBSingleFinder, findsOneWidget); + expect(componentBSingleFinder, findsOneWidget); expect(componentIdFactoryFinder, findsOneWidget); expect(componentScopedFinder, findsOneWidget); }); diff --git a/packages/koin_flutter/test/widgets/widget_extension/pages.dart b/packages/koin_flutter/test/widgets/widget_extension/pages.dart index a91e5e1..7f95fb4 100644 --- a/packages/koin_flutter/test/widgets/widget_extension/pages.dart +++ b/packages/koin_flutter/test/widgets/widget_extension/pages.dart @@ -59,8 +59,7 @@ class _HomePageWithParamsState extends State body: Column( children: [ Text("${componentSingle.id.toString()}"), - // TODO - // Text("${componentBSingle.id.toString()}"), + Text("${componentBSingle.testId().toString()}"), Text("${componentScoped.id.toString()}"), Text("${componentFactory.id.toString()}"), ], diff --git a/packages/koin_test/example/test/koin_test_example_test.dart b/packages/koin_test/example/test/koin_test_example_test.dart index 63ca1e1..f737930 100644 --- a/packages/koin_test/example/test/koin_test_example_test.dart +++ b/packages/koin_test/example/test/koin_test_example_test.dart @@ -53,7 +53,7 @@ void main() { testModule('shoud be a valid module', customModule, checkParameters: checkParametersOf({ - ComponentC: ComponentCParam('Fisrt', "Last"), + ComponentC: ComponentCParam('Fisrt', 'Last'), })); test('shoud be a invalid module', () { diff --git a/packages/koin_test/lib/src/error/error.dart b/packages/koin_test/lib/src/error/error.dart index f6ea95b..cbf4c0a 100644 --- a/packages/koin_test/lib/src/error/error.dart +++ b/packages/koin_test/lib/src/error/error.dart @@ -32,6 +32,6 @@ abstract class BrokenDefinitionException implements Exception { @override String toString() { - return '${runtimeType}: $msg'; + return '$runtimeType: $msg'; } }