stacked icon indicating copy to clipboard operation
stacked copied to clipboard

Null check operator used on a null value Stacked_Locator for test

Open MDSADABWASIM opened this issue 5 years ago • 4 comments

I'm getting the same issue as https://github.com/FilledStacks/stacked/issues/367, but not in main app it's working fine on app side. Getting this issue on test side, while I'm trying to replicate TDD article.

Stacked version:

stacked: ^2.1.5
stacked_services: ^0.8.6
stacked_hooks: ^0.2.0
stacked_generator: ^0.4.6
Null check operator used on a null value
StackedLocator._canRegister
package:stacked/…/code_generation/stacked_locator.dart:45
StackedLocator.registerSingleton
package:stacked/…/code_generation/stacked_locator.dart:211
getAndRegisterNavigationService
test\helpers\test_helpers.dart:16
registerServices
test\helpers\test_helpers.dart:28

I'm also getting Target of URI doesn't exist: 'package:logger/logger.dart'. error on generated logger class don't know if these two issues are related.

Flutter doctor report:

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 2.0.6, on Microsoft Windows [Version 10.0.19042.662], locale en-IN)
[√] Android toolchain - develop for Android devices (Android SDK version 30.0.3)
[√] Chrome - develop for the web
[√] Android Studio
[√] VS Code (version 1.56.2)
[√] Connected device (2 available)

• No issues found!

MDSADABWASIM avatar May 18 '21 10:05 MDSADABWASIM

can you check on the latest version of the stacked 2.1.6 please

hurbes avatar May 18 '21 13:05 hurbes

Thanks @hurbes the latest version solve this weird error, however I'm still getting this error

Target of URI doesn't exist: 'package:logger/logger.dart'. error on generated logger class.

MDSADABWASIM avatar May 19 '21 03:05 MDSADABWASIM

add logger: ^1.0.0 to your dependencies if you want to use logger

hurbes avatar May 21 '21 15:05 hurbes

Thanks @hurbes it fixed the issue. I'm closing this issue.

MDSADABWASIM avatar May 22 '21 06:05 MDSADABWASIM