Hello, welcome to Flutter 2.5! This is a large release, ranking second in Flutter release history: 4600 questions closed, 3932 PR merged from 252 contributors and 216 reviewers. If we look back over the past year, we see that 1,337 contributors created 21,072 huge PR, of which 15,172 were merged. While the “New Features in Flutter” blog post highlights new features, our first job with Flutter is always to ensure that you have the functionality you need and achieve the highest level of quality. In fact, this release continues with many important performance and tool improvements to track performance issues in your own applications. There are also many new features, including full screen support for Android, more Material You (also known as V3) support, updated text editing to support switchable keyboard shortcuts, New support for adding dependencies in Visual Studio Code projects, new support for getting coverage information from test runs in IntelliJ/Android Studio, and a brand new application template to provide a better foundation for your real Flutter applications. This release is full of exciting new updates, so let’s get started.

Performance: iOS shader warm-up, asynchronous tasks, GC, and messaging

This release brings several performance improvements. The first PR in this list is used from the offline training run (# 25644), which (as shown by our benchmark) reduces the rasterization time for worst-case frames by 2/3 seconds and the 99th percentile frame by half. We continue to make progress in reducing iOS lag, and this is another step along that path. However, shader preheating is only one source of stalling. Previously, processing asynchronous events from the network, file systems, plug-ins, or other quarantines could interrupt the animation, which was another source of lag. The following improved scheduling strategy (# 25789In this version of the UI-isolated event loop, frame processing now takes precedence over processing other asynchronous events, eliminating this source lag in our tests. Frame lag as a result of processing asynchronous events before and afterAnother cause of stalling is that the garbage collector (GC) pauses the UI thread to reclaim memory. Previously, memory for some images was only deferred in response to GC performed by the Dart VM. As a workaround in earlier versions, the Flutter engine suggested to the Dart VM that image memory could be recycled through GC, which in theory could lead to more timely memory reclamation. Unfortunately, in practice, this leads to too many major GCS, and it is still sometimes not possible to reclaim memory fast enough to avoid low memory conditions on memory-constrained devices. In this version, unused image memory is eagerly reclaimed (# 26219,# 82883,# 84740), greatly reducing GC. Add the GC before and after the fix to urgently reclaim unused large image memoryFor example, in one of our tests, playing a 20-second animated GIF went from 400 GCS to just 4. Fewer major GCS mean that animations that involve images appearing and disappearing will lag less and consume less CPU and power. Another performance improvement for Flutter 2.5 is the delay when sending messages between Dart and Objective-C/Swift (iOS) or Dart and Java/Kotlin (Android). As usuallyAdjust thePart of the message channel. Removing unnecessary copies from the message codec can reduce latency by up to 50%, depending on the message size and device (# 25988.# 26331). IOS message latency before and afterYou caninAaron ClarkewritingtheImprove the FlutterIn thePlatform channel performanceRead more about this work in the blog post. If your target is iOS, then one final performance update: in this release, the Flutter application built on Apple Silicon M1 Mac runs on the ARM iOS emulator (#pull/85642) to run locally. This means that there is no Rosetta conversion between Intel X86_64 instructions and ARM, which improves performance during testing of your iOS application and allows you to avoid some subtle Rosetta issues (# 74970,# 79641). This is another step towards full support for Flutter for Apple Silicon. Stay tuned for more.

Dart 2.14: Formats, language features, publishing, and Linting out of the box

Of course, a Flutter is not a Flutter without the Dart language and the runtime that builds it. This version of Flutter is released with Dart 2.14.New version of DartWith new format, makecascadeClearer, the new PUB supports ignoring files, as well as new language features, including the legendary triple shift operator regression. In addition, and one of the best things about Dart 2.14, this release creates a set of standard Lint that is shared between the new Dart and Flutter projects, right out of the box. flutter createRight out of the box, there is an analysis_options.yaml file prefilled with the recommended Flutter lintsYou will not only get these Lint when you create a new Dart or Flutter project, but alsoJust a few steps, you can also add the same analysis to existing applications. For details about these Lint, new language features, and more, check outDart 2.14 release announcement.

Frame: Android full screen, Material You & Text editing shortcuts

Flutter version 2.5 includes many fixes and improvements to the framework. fromAndroidstartWe fixed a number of issues related to full screen mode”And there were nearly 100 thumbs-up signs between them. The name of the pattern itself makes it one of our favorite new features:Backward tilt, stickiness, sticky immersion, and edge to edge. This change also adds a way to listen to full-screen changes in other modes. For example, if a user interacts with an application, developers can now write code to return to full screen or perform other actions when the system UI returns. New Android edge-to-edge mode: Normal mode (left), edge-to-edge mode (middle), edge-to-edge mode with custom SystemUIOverlayStyle (right)In this release, we continue to build support for the new Material You (aka V3) specification, including updates to float action button sizes and themes (# 86441.), as well as MaterialState scrolledUnder you can use the new status of the sample code in the sample code to check the pr (# 79999). New material to your FAB size New MaterialState. ScrolledUnder state at workWhile we’re talking about scrolling, another improvement is the addition of a scroll metric notification (# 85221,# 85499), even if the user doesn’t scroll itWill also beProvides notification of scrollable areas. For example, the following shows the scrollbar appearing or disappearing properly from the ListView based on the base size: The new scroll indicator notification makes the scroll bar automatically appear and disappear without scrollingIn this case, you don’t have to write any code, but if you want to captureScrollMetricNotificationChange, you can. Special thanks to community contributorsxu-baoolinHe made great efforts and came up with a good solution. Another great contribution of the community is for ScaffoldMessenger. You may remember ScaffoldMessenger fromChatter 2.0 has made an announcementAs a more powerful way to display SnackBars at the bottom of the screen provides notifications to the user. In Flutter 2.5, you can now add a banner to the top of a scaffold that stays there until the user closes it.Your application can obtain this action ScaffoldMessenger by calling the showMaterialBanner method below:

The Material guide for banners states that your application can only display one at a time, so if your application calls showMaterialBanner multiple times, ScaffoldMessenger will maintain a queue that displays each new banner because the previous banner has been closed. Thanks to Calamity210 for making such an excellent addition to the Material support in Flutter! Building on Flutter 2.0 and its new text editing features, such as text selection pivots and the ability to stop propagation of keyboard events after processing, in this version we added the ability to make text editing keyboard shortcuts overwrite (#85381). If you want CtrL-A to perform some custom actions instead of selecting all the text, you can do so. This DefaultTextEditingShortcuts class contains each platform supported on every list of keyboard shortcuts. If you want to overwrite anything, use Flutter’s existing Shortcuts widget to remap any Shortcuts to existing or custom intents. You can place the widget anywhere in the widget tree where you want to apply an override. See some examples in the API Reference.

Plug-ins: Cameras, image selectors, and plug-ins

Another plugin that has many improvements is the camera plugin:

  • 3795 [Camera] Android – Rework – Part 1: Base classes that support android camera features
  • 3796 [Camera] Android – Rework – Part 2: Android autofocus
  • 3797 [Camera] Android – Rework Part 3: Android exposure related functions
  • 3798 [Camera] Android – Rework – Part 4: Android flash and zoom features
  • 3799 [Camera] Android – Rework – Part 5: Android FPS range, resolution, and sensor orientation features
  • 4039 [Camera] Android – Rework – Part 6: Exposure and focus features for Android
  • 4052 [Camera] Android – Rework Part 7: Android noise reduction function
  • 4054 [Camera] Android – Rework – Part 8: Support modules for final implementation
  • 4010 [Camera] does not trigger flat device orientation on iOS
  • 4158 [Camera] Fixed coordinate rotation to set focus and exposure points on iOS
  • Camera preview does not always rebuild when the direction changes
  • 3992 [camera] prevents crashes when setting unsupported FocusMode
  • 4151 [camera] introduces the CamerA_Web package

The Image_Picker plug-in also does a lot of work, focusing on the end-to-end camera experience:

  • 3898 [image_picker] Image picker repairs camera equipment
  • 3956 [image_picker] Changes the storage location captured by the camera to an internal cache on Android to meet the new Google Play storage requirements
  • 4001 [image_picker] removes redundant requests for camera permissions
  • 4019 [image_picker] Fix rotation when camera is source

This work improves the functionality and robustness of the Camera and image_Picker plug-ins for Android. Also, you’ll noticeCamera plug-inEarlier versions are available for network support# 4151). This preview provides basic support for viewing the camera preview, taking photos, using the flash, and zooming controls on the Web. It’s not currentlyApproved plug-ins, so you needExplicitly add itFor use in your web applications. The initial Android camera rewrite was done byacouttsThe contribution. The camera and image_picker work by landingBase flow, a consulting firm specializing in chatter and well-knownGo to pub.dev for your own package. Camera_web’s work is mainly carried out by US-BASED Flutter consultingVery Good VenturesTo complete. Thank you so much for your contribution to the Flutter community! Another valuable community contribution is the Flutter community organization to”Plus” plug-inIs famous for. In this version of Flutter, each corresponding plugin for the Flutter team now comes with a similar oneThe batteryAdvice:Also, since these mods are no longer actively maintained, they are no longer marked as Flutter’s favorite mods. If you have not already done so, we recommend that you use the plus versions of the following plug-ins:

Flutter DevTools: Performance, widget checker and polish

This version of Flutter includes many improvements to Flutter DevTools. First and foremost is the added support in DevTools to take advantage of engine updates (# 26205,# 26233,# 26237,# 26970,# 27074,# 26617). One set of updates enables Flutter to better associate trace events with a particular framework, which helps developers determine why the framework might be over budget. You can see this in the DevTools Frames chart, which has been rebuilt to “live”; The framework is populated in this diagram as it is rendered in your application. Select a frame from this chart to navigate to the timeline event for that frame:The Flutter engine can now also recognize shader compilation events in the timeline. Flutter DevTools uses these events to help you diagnose shader build stutter in your application.With this new feature, DevTools detects when you have lost frames due to shader compilation so you can fix the problem. To run your application as if it were the first time (before filling the shader cache, just like for any user), use flutter Run with the — Purge -persistent-cache flag. This clears the cache to ensure that you recreate the environment that the user saw during the “First run” or “Re-open” (iOS) experience. This feature is still under development, so pleasesubmitYou find theThe problem”, or any improvements we can make to help debug the shader to compile the lag. In addition, when you track CPU performance issues in your application, you may be inundated with analytical data from Dart and Flutter libraries and/or engine native code. If you want to turn either off to focus on your own code, you can use the new CPU Profiler feature (# 3236), which enables you to hide parser information from any of these sources.For any categories that you didn’t filter out, they are now color-coded (# 3310,# 3324) so that you can easily see which parts of the CPU frame diagram come from which parts of the system.Color frame diagram for identifying application, native, Dart, and Flutter code activity performance in your application is not the only factor you want to debug. This version of DevTools comes with an update to the Widget Inspector, which allows you to hover over a Widget to evaluate objects, view properties, Widget state, and more.Moreover, when you select a widget, it is automatically populated in the new widget inspector console, where you can browse the properties of the widget.You can also evaluate expressions from the console while pausing at the breakpoint. In addition to new features, Widget Inspector gets a facelift. To make DevTools a more useful destination for learning about and debugging Flutter applications, we teamed up with a Creative technology agency in FinlandCodemateThe collaboration has been updated.Flutter DevTools optimizes UX to improve ease of use In this screen capture you can see the following changes:

  • Better communicate what debug toggle buttons do — they have new ICONS, task-oriented labels, and rich tooltips that describe what they do and when to use them. Each tooltip is further linked to detailed documentation of the feature.
  • Easier to scan and locate widgets of interest – Widgets commonly used in the Flutter framework now display ICONS in the Widget tree view to the left of the inspector. They are further color-coded according to category. For example, the layout widget is shown in blue and the content widget is shown in green. In addition, each text widget now displays a preview of its content.
  • Align layout Explorer and widget tree color schemes – It is now easier to identify the same widgets from layout Explorer and widget trees. For example, the Column widget in the screenshot below is on a blue background in the layout browser and has a blue icon in the widget tree view.

We’d love to hear your thoughts on any issues raised by these updates or any other improvements we can make to make sure DevTools is working well. And those bright spots are just the beginning. For a complete list of new DevTools features for this version of Flutter, see the release notes:

  • Release notes for Flutter DevTools 2.3.2
  • Release notes for Flutter DevTools 2.4.0
  • Release notes for Flutter DevTools 2.6.0

IntelliJ/Android Studio: Integration testing, test coverage, and icon preview

The IntelliJ/Android Studio plugin for Flutter also has a number of improvements in this release, starting with the ability to run integration tests (# 5459). Integration tests are full application tests that run on the appliance, in the Integration_test directory, and use the same functionality as the testWidgets() widget unit tests.To add integration tests to your Flutter application in IntelliJ/Android Studio, pleaseFollow the instructions on flutter. Dev. To connect the tests to IntelliJ or Android Studio, add a run configuration to start the integration tests and connect the device for testing. Run configuration lets you run tests, including setting breakpoints, stepping, and so on. Additionally, Flutter’s latest IJ/AS plug-in allows you to view coverage information for both unit test and integration test runs. You can access it from the toolbar button next to the Debug button:Overlay information is displayed in red and green bars in the editor’s binding line. In this example, lines 9-13 are tested, but lines 3 and 4 are not.The latest version also includes a new ability to preview ICONS used from the pub.dev package, which is built around TrueType font files (# 5504,# 5595,# 5677,# 5704) built just like the Material and Cupertino ICONS support preview.Icon Preview in IntelliJ/Android Studio To enable icon preview, you need to tell the plug-in which packages you are using. There is a new text field in the plug-in Settings/Preferences page:Note that this applies to ICONS defined as static constants in the class, as shown in the sample code in the screen capture. It does not apply to expressions, such as lineicons.addressbook ()or lineicons.values [‘code’]. If you are the author of an icon pack that does not use this feature, create oneThe problem. Here are some more updates to Flutter’s IntelliJ/Android Studio plugin, which you can read in the release notes:

  • The Plugin for Flutter IntelliJ is released on M57
  • The Plugin for Flutter IntelliJ is released by M58
  • The Plugin for Flutter IntelliJ is released by M59
  • The Plugin for Flutter IntelliJ is released by M60

Visual Studio Code: Dependencies, Fix All, and Test Runner

The Visual Studio Code plugin for Flutter has also been improved in this release from two new commands “Dart: Add dependencies” and “Dart: Add Development dependencies” (# 3306.# 3474To begin with.Adding Dart dependencies in Visual Studio Code these commands provide similar functionalityJeroen Meijer’s Pubspec Assist plug-inHas been available for some time. These new commands are out of the box and provide a filter list of package types retrieved periodically from pub.dev. You might also be interested in the “Fix All” command that applies to Dart files (# 3445,# 3469), and can fix all with one stepdart fixSame problem.Using Flutter Fix rules to repair all the known issues in the code This can also by adding the source. The fixAll to editor. CodeActionsOnSaveVS Code set to set to in the preservation time. Or, if you want to try preview function, you can enable the dart. PreviewVsCodeTestRunner Settings and view the new Visual Studio Code to run the program running tests of the dart and Flutter test.Test your Dart and Flutter Code with the new Visual Studio Code test runner. The Visual Studio Code test runner looks slightly different from the current Dart and Flutter test runner in that it will retain results across sessions. The Visual Studio Code test runner also added a new binding line chart that shows the final status of the test, which you can click to run (or right-click to get a context menu).In the upcoming release, existing Dart and Flutter test runners will be removed in favor of the new Visual Studio Code test runner. This is just the tip of the iceberg of new features and fixes for Visual Studio Code. For all details, check out the release notes:

  • V3.26 VS Code Test Runner integration, Flutter creation Settings…
  • V3.25 Additional dependency management improvements, fix all files/save when available at……
  • V3.24 dependency tree improvements, easier to launch configuration, editor improvements
  • V3.23 Profile Mode improved, dependency tree improved, LSP improved

Tools: Exceptions, new application templates, and Pigeon 1.0

In previous versions of Flutter, you might get frustrated expecting unhandled exceptions, so you could trigger the debugger and find out where they came from, only to find that the Flutter framework didn’t let the exception pass to trigger the “expectation in the unhandled debugger” handler. In this release, the debugger can now correctly interrupt on unhandled exceptions that were previously caught by the framework (# 17007). This improves the debugging experience because your debugger can now point you directly to throwbacks in their code, rather than to random lines deep in the frame. A related new feature enables you to determine whether FutureBuilder should rethrow or swallow errors (#)84308). This should provide you with a number of additional exceptions to help you track down problems in your Flutter application. The Counter application template has been available since the creation of Flutter and has many advantages: it demonstrates many features of the Dart language, demonstrates several key Flutter concepts, and is small enough to fit into a single file even with a lot of explanatory comments. However, it does not provide a particularly good starting point for real-world Flutter applications. In this version, a new template is provided with the following command (# 83530 ): $ flutter create -t skeleton my_app The new Flutter skeleton template is workingThe skeleton template generates a two-page list view of the Flutter application (with details view) that follows community best practices. It was developed with extensive internal and external review, provides a better foundation for building production-quality applications, and supports the following capabilities:

  • Coordinate multiple widgets for ChangeNotifier
  • By default, localization is generated using ARB files
  • Include sample images and create 1x, 2X, and 3X folders for image assets
  • Organize with “feature first” folders
  • Shared preferences are supported
  • Supports chiaroscuro themes
  • Supports multi-page navigation

This new template is expected to evolve over time as Flutter best practices evolve. On the other hand, if you’re developing plug-ins rather than applications, you might be interested in Pigeon’s 1.0 release. Pigeon is a code generation tool for generating type-safe interoperable code between The Flutter and its host platform. It allows you to define a description of the plug-in API and generate framework code for Dart, Java, and Objective-C (available for Kotlin and Swift, respectively).The Sample generated Pigeon code and some of the Flutter team’s plug-ins already use Pigeon. In this release, it provides more useful error messages, adds support for generics, raw data types as parameters and return types, and multiple parameters, and is expected to be used more frequently in the future. If you want to take advantage of Pigeon in your own plug-in or add it to your application project, you can do so in thePigeon pluginFind out more.

Major changes and deprecations

Here are the major changes in Flutter 2.5:

  • Drag the scroll device by default
  • Deprecated apis were removed after V2.2
  • Import package: flutter_lints
  • The accent property of ThemeData is deprecated
  • Gesture recognizer cleanup
  • Replace with collate AnimationSheetBuilder. The display
  • Render the platform view in the Web using HTML slots
  • Migrate LogicalKeySet to SingleActivator

For a complete list of major changes since version 1.17, see flutter. Dev. As we continue to update Flutter Fix (available in your IDE and through the Dart Fix command), we have a total of 157 rules to automatically migrate code affected by these or past significant changes as well as any deprecations. As always, many thanks to the community for contributing to the test, which helped us identify these significant changes. For more information, check out our Major Change Policy. Additionally, with the release of Flutter 2.5, we will discontinue support for iOS 8, which was announced in September 2020. Ditching support for iOS 8, which had a market share of less than 1%, allowed the Flutter team to focus on the new platform for wider use. Deprecation means that these platforms work, but we will not be testing new versions or plug-ins for Flutter on these platforms. You can view a list of currently supported Flutter platforms at flutter. Dev.

summary

Finally, as always, thanks to the Flutter community around the world for making this possible. For the hundreds of developers who contributed and reviewed 1,000 PR pieces in this update, here are the results of each of your efforts. Together, we’re working to transform the application development process for developers around the world so you can deliver more, faster, and deploy to the platforms you care about from a single code base. Stay tuned for more updates from the Google Flutter team. The year is not over yet!

What’s New in Flutter 2.5