This blog post has been created with the intention of converting the project from Flutter version 1.22 to 3.24. It has also been updated to reflect the latest information and changes related to upgrading Flutter versions. It is also helpful if you want to upgrade Flutter from 2.0 to 3.24. Before discussing the steps to update a Flutter project, let us explain why upgrading from Flutter 1.0 to 3.24 or Flutter 2.0 to 3.24 is essential.
For any developer or application owner, it is essential to upgrade Flutter to its latest version for the following reasons:
Firstly, Flutter is an ever-evolving framework and its latest version offers improved performance, security, and features.
Secondly, upgrading the Flutter version will allow developers to take advantage of the latest features, such as improved animations, better UI/UX design, enhanced accessibility features, and more. This will help make the project more attractive and engaging for users.
Thirdly, upgrading the Flutter version will help ensure the project remains compatible with other platforms, such as iOS and Android. This is especially important for projects that are cross-platform compatible.
Finally, upgrading the Flutter version will ensure that the project remains up-to-date with industry trends and competitive with other projects. This will help ensure that the project is successful and remains relevant in the future.
Overall, upgrading the Flutter version of an old project in 2024 is a great idea that will help ensure the project remains competitive, attractive, and up-to-date. Also, when you upgrade Flutter to the latest version, your project can be prepared to support macOS and Linux as well. Therefore, the technology now supports six platforms.
Learn about some of the options for animating in Flutter.
flutter upgrade
fvm install stable
--------OR--------
fvm install 3.24.2
/// Latest version is recommended
pubspec.yaml
sdk: ">=3.3.0"
This will enable the Dart 3 SDK in your project, and after that, you can use all the new features of Dart 3, such as records, new class modifiers, exhaustiveness checking, if-case patterns, etc.
flutter pub get
Version Lens – (VS code) | Flutter pub version checker – (Android studio) |
flutter pub get
command and fix the errors until you reach exit code 0
android/app/src/main/kotlin/**/**/MainActivity.kt
override fun configureFlutterEngine(@NonNull flutterEngine: FlutterEngine) {
GeneratedPluginRegistrant.registerWith(flutterEngine);
}
Do not remove method-channel code if you are using it for accessing platform-side code.
Learn about unleashing the power of Dart’s extension methods in Flutter to boost productivity.
build.gradle
due to package updates in pubspec.yaml
.Gradle
Version. For this, you need the following changes
distributionUrl
at gradle-wrapper.properties
(Check the latest version here)com.android.tools.build:gradle
in project-level build.gradle
(Check the latest version here)jcenter()
to mavenCentral()
inside repositories {}
at project-level build.gradle
. (You can find it at 2 places)ext.kotlin_version
inside the project-level build.gradle
(Check the latest version here)"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
Note: You can find suggestions in Android Studio for the Flutter update process. So, if you wish to upgrade to a specific version of Flutter not mentioned in this post, refer to Android Studio’s guides.
pod repo update
pod update Firebase/FirebaseCore
pod update Firebase/FirebaseAuth
pod update Firebase/FirebaseCrashlytics
flutter_facebook_auth
then run the command pod update FBSDKLoginKit
Note: You have these commands in the error logs when you run and encounter these types of errors.
Are you ready to take your app to the next level with the latest Flutter upgrade? At Aubergine Solutions, we specialize in elevating your application’s performance through our expert Flutter development services. Our team ensures a smooth transition to the newest Flutter version, enhancing your app with advanced features and a seamless user experience. Contact us today.