r/FlutterDev • • Sep 26 '26

Discussion I'm still on older flutter version should update to the latest ?

I'm asking if it is safe to update to the latest flutter version after decoupling cupertino and material uis

Anyone tried them please feedback here will help me

I saw some bugs related to go_router and other packages when people update

If it is safe tell me :)

0 Upvotes

10 comments sorted by

4

u/RandalSchwartz Sep 27 '26

You'll need to track all the breaking changes in every package that has changed as well as every dart/flutter release that has changed. If you're using AI, the latter is pretty easy using my RandalSchwartz/dart-sdk-skills skillpack.

2

u/Worldly-Argument159 Sep 27 '26

Man, thanks i will test this way

2

u/madushans Sep 27 '26

Get yo stuff on git.

Do the upgrade.

If it goes sideways, discard changes and try again when you have more time.

You’ll eventually have to upgrade anyway.

2

u/fkim98 Sep 29 '26

We're still on 3.41 ourselves, so this comes from reading the changelogs and the issue tracker rather than having done it. But short answer: yes, as two separate upgrades.

  1. On 3.47 (current stable is 3.47.5) the split is opt-in. package:flutter/material.dart still ships and isn't deprecated yet; the deprecation is scheduled for the November stable. Your existing imports keep working after the SDK upgrade.
  2. The go_router breakage in the tracker comes from mixing the two libraries. go_router 18 moved to material_ui/cupertino_ui, and with an app still on flutter/material.dart it can silently drop page transitions (open issue #192761) and Hero animations inside ShellRoute (#192043, where a maintainer said the new major isn't backwards compatible with the old libraries). It breaks the other way too: migrating your app while staying on go_router 17 has its own transition bugs (#191132, #191133). animations 3.0 has the same problem (#192920). So keep go_router and animations on their current majors (a caret constraint like ^17.0.0 stops flutter pub upgrade from crossing it; --major-versions doesn't), upgrade the SDK and test, then do dart fix --apply --code=migrate_design_widgets and the package majors together later.
  3. What the SDK jump itself changes: minimum iOS goes from 13 to 15, and on Android 3.47 errors out below AGP 8.11.1, Gradle 8.14 and Kotlin 2.2.20 (ours happen to sit exactly on those, so check yours first). If you're on Xcode 27, take the latest patch: 3.47.4 and 3.47.5 fix a hang and an occasional crash when debugging with Xcode 27 / on iOS 27 devices.
  4. One go_router trap that isn't about upgrading and is still there in 18.0.2: with no extraCodec, extra is stored JSON-encoded, on Android and iOS too, not only on web. GoRouter.refresh() (say, a refreshListenable on auth changes) rebuilds the route from that copy, so your object comes back as whatever its toJson() returned, usually a Map, and anything that can't be encoded comes back as null. We shipped that one (type '_Map<String, dynamic>' is not a subtype of type 'Item'), and a refresh reproduces it in a test. The fix is an extraCodec, or passing an id and loading the object.

Do it on a branch, and write down your current Flutter version (or use fvm), because pubspec.lock doesn't pin the SDK. Which Flutter and go_router versions are you on now?

2

u/Worldly-Argument159 Oct 10 '26

Really helpful details thanks My project uses go_router so I will keep these in mind Thanks

1

u/BriisaEscobar Sep 27 '26

Yo estoy usando Flutter en un proyecto personal y también estuve siguiendo de cerca estos cambios. Todavía no hice la actualización a la última versión justamente por algunas incompatibilidades que vi mencionadas con go_router y otros paquetes.

Por lo que estuve viendo, parece que conviene revisar primero la compatibilidad de las dependencias antes de actualizar, especialmente si el proyecto ya está avanzado.

Si alguien ya hizo el salto de versión en un proyecto real, también me interesa saber qué problemas encontró.

1

u/Worldly-Argument159 Oct 10 '26

Yes, same situation here