Type Mismatch Error: Assigning Nullable String to Non-Nullable String
The error is caused by the code trying to assign a value that can be null (String?) to a variable that cannot be null (String).
Bug: Launching lib/main.dart on Chrome in debug mode... Waiting for connection from debug service on Chrome... ../../.pub-cache/hosted/pub.dev/flutter_modular-6.1.0+1/lib/src/presenter/navigation/modular_route_information_parser.dart:49:42: Error: A value of type 'String?' can't be assigned to a variable of type 'String' because 'String?' is nullable and 'String' isn't. path = [null].contains(location) ? '' : location; Failed to compile application.
[✓] Flutter (Channel stable, 3.10.6, on macOS 13.5 22G74 darwin-arm64, locale pt-BR) [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 14.2) [✓] Chrome - develop for the web [✓] Android Studio (version 2022.3) [✓] IntelliJ IDEA Ultimate Edition (version 2023.2) [✓] IntelliJ IDEA Community Edition (version 2023.2) [✓] VS Code (version 1.81.1) [✓] Connected device (2 available) [✓] Network resources
flutter_modular: ^6.1.0+1
File: modular_route_information_parser.dart Change this : path = [null].contains(location) ? '' : location; To this : path = [null].contains(location) ? '' : location ?? '';
@jacobaraujo7
Same error
error: ../../../.pub-cache/hosted/pub.dev/flutter_modular-6.1.0+1/lib/src/presenter/navigation/modular_route_information_parser.dart:49:42: Error: A value of type 'String?' can't be assigned to a variable of type 'String' because 'String?' is nullable and 'String' isn't. path = [null].contains(location) ? '' : location;
Stuck in this....