Mobile Development 11 min read

Flutter Upgrade Process to Version 3.24

This article explains the step-by-step process for upgrading Flutter to version 3.24, covering preparation, environment configuration, known pitfalls, API changes, new features, and code adjustments to ensure a smooth migration for mobile developers.

Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Rare Earth Juejin Tech Community
Flutter Upgrade Process to Version 3.24

Introduction

Flutter releases updates frequently; developers usually do not upgrade immediately but observe performance, plugin compatibility, bugs, deprecated APIs, and new widgets before deciding to upgrade.

The stable channel now offers Flutter 3.24 and Dart 3.5, which bring significant rendering engine and memory‑management optimizations, resulting in smoother app performance and several bug fixes.

The author recommends versions 3.16, 3.19, and 3.24 and will discuss the upgrade path from 3.19 to 3.24, highlighting pitfalls and fixes.

1. Upgrade Process

If you want to replace the current version, simply run flutter upgrade . To manage multiple Flutter versions, download the desired version from the official website and configure the corresponding environment variables.

The author uses the latter method and has configured several Flutter versions locally.

After configuration, verify the environment variables and run flutter --version to confirm.

Remember to set the Flutter version for the project in Android Studio; otherwise the change will have no effect.

2. Changes

Convenient ModalRoute APIs Originally, handling focus navigation on the web required custom logic, which caused page rebuilds on mobile when using ModalRoute for route parameters. Flutter 3.24 fixes this issue. New helper methods simplify accessing route settings: final arguments = ModalRoute.settingsOf(context)?.arguments; If you still need the classic observer pattern, you can obtain the ModalRoute object directly: final route = ModalRoute.of(context); if (route != null && route is PageRoute) { routeObserver.subscribe(this, route); // subscribe to RouteObserver } WidgetsBinding.instance.addObserver(this); // add WidgetsBinding observer For cases where page rebuilds still occur, you can modify the source in ModalRoute or use the visibility_detector package as an alternative.

Material You enhancements The default Material You style may feel incomplete in some Chinese development environments; additional tweaks such as AppBar scroll visualisation are often required.

API deprecations and errors Several APIs have been removed or changed, causing compilation errors. Notable additions include new callbacks in WidgetsBindingObserver and adjustments to ThemeData fields. // New callbacks in 3.24.0 @override void didChangeViewFocus(ViewFocusEvent event) {} @override void handleCancelBackGesture() {} @override void handleCommitBackGesture() {} @override bool handleStartBackGesture(PredictiveBackEvent backEvent) { return false; } @override void handleUpdateBackGestureProgress(PredictiveBackEvent backEvent) {} Implementing empty bodies or adapting to the new ThemeData properties resolves most issues.

Build failures due to plugin dependencies When targeting Windows, some plugins require an updated win32 version (e.g., 5.5.4) to be compatible with Flutter 3.24. # Force win32 version for Flutter 3.24.0 win32: 5.5.4 Android Gradle plugin declarations have also changed; the old apply plugin syntax is deprecated in favor of the newer plugins { id "..." } block. plugins { id "com.android.application" id "kotlin-android" id "kotlin-kapt" id "dev.flutter.flutter-gradle-plugin" } plugins { id "dev.flutter.flutter-plugin-loader" version "1.0.0" id "com.android.application" version "7.1.2" apply false id "org.jetbrains.kotlin.android" version "1.8.0" apply false } If you still use the legacy apply plugin syntax, update your .gradle files accordingly. apply plugin: 'com.android.application' apply plugin: 'kotlin-android' apply plugin: 'kotlin-kapt' apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

3. New Features

New Sliver components Flutter 3.24 introduces additional Sliver widgets that enable dynamic app‑bar behaviors such as floating, pinned, and resizable headers, giving developers more flexibility for complex UI interactions. Thin floating title Pinned title bar SliverResizingHeader These components can replace the traditional AppBar when combined with other widgets.

TreeView widget A new TreeView widget supports scrolling in all directions and works together with TreeSliver for hierarchical list presentations.

Built‑in carousel widget Flutter now provides a simple carousel widget for basic use cases, reducing the need for third‑party packages.

Performance optimizations for the rendering engine Various under‑the‑hood improvements continue to enhance frame rates and memory usage.

Swift package support on iOS Flutter plugins can now depend on Swift packages, leveraging the growing Swift ecosystem and simplifying integration with Xcode and Swift Package Manager.

PreferencesDataStore as the default for SharedPreferences SharedPreferences now uses PreferencesDataStore internally, but the public API remains unchanged.

Improvements to inspector and linking tools General usability enhancements make debugging and navigation more efficient.

Conclusion

The article covered the new features and bug fixes in Flutter 3.24 and highlighted important considerations for a smooth upgrade.

Overall, the upgrade is stable; the author has been using it for a while without needing to revert.

If you found this guide helpful, please like and share; your support is valuable.

Ok, that’s the end of this edition.

DartFluttermobile developmentupgradeFlutter 3.24Version 3.24
Rare Earth Juejin Tech Community
Written by

Rare Earth Juejin Tech Community

Juejin, a tech community that helps developers grow.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.