Hi how this problem solvedenter image description here
I added the widget "dropdown_formfield: ^0.1.4" to my project and it showed this error How can I fix this problem please help. This package : https://pub.dev/packages/dropdown_formfield
Hi how this problem solvedenter image description here
I added the widget "dropdown_formfield: ^0.1.4" to my project and it showed this error How can I fix this problem please help. This package : https://pub.dev/packages/dropdown_formfield
You must update your flutter/dart version like this (in your pubspec.yaml):
environment:
sdk: ">=2.18.0"
Be prepared to make changes on your project/code due null safety
Or seek to find a lower version of that "dropdown_formfield" that can be supported by your actual flutter/dart version.
Try upgrading your constraint on cupertino_icons: flutter pub add cupertino_icons:^1.0.6
write
any keyword
instead of ^0.1.4
I tried to add this package https://pub.dev/packages/slimy_card but I faced this
Because ptc_flutter depends on slimy_card any which doesn't support null safety, version solving failed.
The lower bound of "sdk: '>=2.1.0 <3.0.0'" must be 2.12.0 or higher to enable null safety. For details, see https://dart.dev/null-safety
Faced the same problem running a test code as part of udemy course from GitHub repo mi_card_flutter
As you can see, my flutter version is 3.16.9
flutter --version
Flutter 3.16.9 • channel stable • https://github.com/flutter/flutter.git
And my dart version is 3.2.6
dart --version
Dart SDK version: 3.2.6 (stable) (Wed Jan 24 13:41:58 2024 +0000) on "macos_x64"
What I noticed is this code was updated 3 years ago and my Flutter and Dart versions were new. So I have made couple of updates.
Update below in the pubspec.yaml
environment:
sdk: '>=3.2.6 <4.0.0'
After this, when I pulled dependencies using Get Depenencies on main.dart in Android Studio, saw below errors
The current Dart SDK version is 3.2.6.
Because mi_card depends on cupertino_icons >=0.1.1 <1.0.1 which doesn't support null safety, version solving failed.
The lower bound of "sdk: '<2.0.0 or >=2.0.0-dev.28.0 <3.0.0'" must be 2.12.0 or higher to enable null safety.
For details, see https://dart.dev/null-safety
You can try the following suggestion to make the pubspec resolve:
* Try upgrading your constraint on cupertino_icons: flutter pub add cupertino_icons:^1.0.6
As you can see in the error its suggesting to use the 1.0.6 version.
So change which I had to do this to upgrade the version of cupertino_icons dependency from 0.1.2 to below
cupertino_icons: ^1.0.6
And it worked perfectly fine.
© 2022 - 2024 — McMap. All rights reserved.