Flutter 2.5 — What’s new

Nitalimittal
CitrusLeaf
Published in
5 min readSep 15, 2021

A few days back Google announced the release of Flutter 2.5 and Dart 2.14. This release contains the highest number of bug fixes and new features in the history of any earlier Flutter releases. It closed 4600 issues from 252 contributors with 216 reviewers!

Flutter 2.5 continues to improve performance for animations and shaders to continue enhancing user and developer experience. It includes iOS performance improvements, Android full-screen support, Material You support, new dependencies for Visual Studio Code, more widgets, and a whole new template for Material You design. This release is full of new and exciting updates, let us have a look below.

  • Android Full-screen support
    Many issues related to full-screen mode and its features are fixed. This adds a way to listen to full-screen changes in other modes. Now when the system UI is back, developers can handle the redirection to full-screen mode or do anything else required. The recently added full-screen modes are named:
  • Lean back — System overlays are displayed by tapping anywhere on the screen.
  • Sticky — System overlays are displayed by swiping on the edge of the screen.
  • Sticky immersive — Displays system overlays similarly as that of sticky but it allows the framework to handle the swipe.
  • Edge to edge — This mode displays the application elements behind the translucent system overlays.
  • Material You
    This release comes with Material You specification support. This means Flutter now supports Google’s Material Design theme which is to be present in the upcoming Android 12. Below are the new additions done as a part of this-
  • Updated floating action buttons and themes.
  • Improvised scroll metric notifications. This means there can be notifications for scrollable areas even when the user is not scrolling. Developers can capture notifications without writing any extra code.
  • Addition of Material Banner support to the ScaffoldMessenger. In Flutter 2.5, you can now add a banner to the top of your scaffold that stays in place until the user dismisses it. These banners are queued when called multiple times.
  • Enhancing Flutter’s text-editing features, now developers can make text-editing keyboard overridable. This allows them to remap keyboard shortcuts to do new tasks.

We recently completed an app based on Material design. Read more about it here.

  • Better Plugins
    A good volume of improvements is made on the camera plugin. This includes base class supporting Android camera features, auto-focus, exposure-related, flash, and zoom features for Android.
    The Flutter image picker plugin also got updated. It got compliant with the Google Play Store “scoped storage” requirement for apps on Android 11 and up. It became mandatory in May and is meant to provide better protection for app and user data on external storage by restricting an app’s access to the app-specific directory on external storage.
  • Flutter DevTools
    This release contains improvisations on Flutter DevTools. Updates have been made to take advantage of engine updates. Now developers can easily determine the frame which gets over budget by associating trace events with specific frames.
    Flutter DevTools can diagnose when the frames are lost to the shader compilation by identifying events in the timeline. The new CPU Profiler feature provides better and color-coded access to the CPU profiler information.
    DevTools also came with an update to the Widget Inspector allowing users to hover over a widget to evaluate the object, view properties, widget state, and so on. Now on selecting the widget, it will automatically populate the new Widget Inspector Console, an easy way to explore the widget’s properties. Widget inspector has been upgraded to support better communication, easy access to widgets of interest, and color scheme alignment of the widget tree and the layout explorer.
  • iOS improvements
    Along the lines of Flutter 2.2, this update also improves the iOS performance of Flutter for animations and shaders. Especially in iOS, asynchronous events such as accessing the network, filesystem, plugins, and other events could interrupt animations.
    Garbage collection improvements for reclaiming memory in the Flutter engine allow it to happen less often during animation cycles. Coupled with updates to Dart, low-memory situations can be avoided and animation glitches can be smoothened.
    For example, during testing, 20-second animated GIFs went from needing over 400 garbage collection events to just four. Garbage collection consumes a great deal of computation and power and thus causes a lot of performance issues.
  • IDE Plugin
    This release comes with the updated code for Visual Studio Code and Android Studio plugins.
  • Android Studio — The updated Android Studio plugin for Flutter allows developers to run integration tests on the complete project. Developers can also generate full coverage reports for unit and integration tests.
    In addition, it includes the ability to preview TrueType icons used from packages from pub.dev built. It works only for static constants and has to explicitly define the packages used to the IDE. Nonetheless, it is a good feature to have.
  • Visual Studio Code — The updated plugin comes with two new dart commands — “Dart: Add dependency” and “Dart: Add dev dependency”. These commands provide a list of packages periodically fetched from pub.dev and are filtered as typed. There’s also now a Fix All command for automatically formatting and fixing lint issues in the current file.
    There is a new Visual Studio test runner for previewing test status. It came with a new button to preview the last state of the test and can also be clicked to run the test.
  • Dart 2.14
    The new Dart release includes a lot of improvements to formatting making cascade more clear, pub support for ignoring files, and new language features. Developers can now update the .pubignore file to add the list of files they do not wish to upload to pubs.dev when publishing. In addition, in this release, a standard set of lints are created which are shared between new Dart and Flutter projects.

Flutter has always been our choice since its early days. Flutter community helps developers with quick solutions to issues. It has completely changed the way cross platform apps are developed. With Flutter web and its consistent updates, Flutter will usher a new era of application development with practical cross-platform support from Web to Mobile.

This article first appeared on CitrusLeaf Blog.

--

--