I'm currently working on my first app. When I try to import
'package:flutter_google_maps/location_service.dart';
I'm given this message:
[myapp] flutter pub add flutter_google_maps The current Dart SDK version is 3.0.6.
Because myapp depends on flutter_google_maps any which doesn't support null safety, version solving failed.
The lower bound of "sdk: '>=2.6.0 <3.0.0'" must be 2.12.0 or higher to enable null safety. For details, see https://dart.dev/null-safety exit code 65
Can anyone explain this issue to me as if I were a child? I think I know that the dart version is incorrect, but how do I change the dart version? When I try to run which dart
and which flutter
, my computer is unfamiliar with it.
I tried to change the SDK version in the pubspec.yaml to sdk: '>=2.12.0 <3.0.0', but it didn't change anything.