After upgrading flutter with flutter upgrade
to 3.10
All my (previously working) Futures stopped working. Every single future is underlined with red saying "Future isn't a type".
What can I do to fix this? Clearly Future hasn't been removed.
After upgrading flutter with flutter upgrade
to 3.10
All my (previously working) Futures stopped working. Every single future is underlined with red saying "Future isn't a type".
What can I do to fix this? Clearly Future hasn't been removed.
I had the same problem, what helped me to solve it was:
Note:
I am using Android Studio.
I am using FVM to manage SDK versions
my update was from 3.3.5 to 3.13.2 (Flutter SDK) - (2.18.2 to 3.1.0 (Dart))
I hope it helps someone
This was happing to me too after upgrade to 3.10.
I am using VS Code. After opening with Android Studio, I was able to build it without any problem.
Going back to VS Code, and it starts to work again. 😃
fvm
for version 3.10.6
–
Diversification I had the same problem, what helped me to solve it was:
Note:
I am using Android Studio.
I am using FVM to manage SDK versions
my update was from 3.3.5 to 3.13.2 (Flutter SDK) - (2.18.2 to 3.1.0 (Dart))
I hope it helps someone
add "import 'dart:async';" in your code and change "future" to "FutureOr"
Once you upgrade to Flutter 3.10, make sure you change the Flutter SDK environment version in pubspec.yaml file
Change From:
environment:
sdk: 'existing_version'
To:
environment:
sdk: '>=3.0.3 <4.0.0' //TODO: Change Version
After this run,
flutter pub get
flutter pub upgrade
I’m using FVM to switch from SDK 2.10.5 to 3.24.2, but I get this error:
Future isn't a type. Try correcting the name to match an existing type.
Initially, I tried importing dependencies and updating the SDK environment in pubspec.yaml
in VSCode, but nothing worked. Then, I opened the same project in Android Studio Koala (the newer version), and it ran successfully without any code changes.
command I used in Android Studio(already select sdk using fvm):
fvm flutter pub get
and
fvm flutter run
So, I can assume this issue might be caused by the IDE or Flutter/Dart settings in the IDE(both IDEs have the same SDK path and the same versions of Flutter and Dart installed).
Flutter clean Flutter pub get
I think that will work for You
© 2022 - 2024 — McMap. All rights reserved.
flutter pub get
in terminal – Jarodjarosite