BOSC
Major Improvements With Flutter 1.20

Major Improvements With Flutter 1.20 Release

In this article, we will talk about the new Flutter 1.20 and the new dart release v2.9. along with it, we will also see all the latest features and improvements.

Major Improvements With Flutter 1.20 are as listed below:

  • AutoFill Support
  • InteractiveViewer Widget
  • Mouse Cursor Support
  • Material Widget Updates
  • New Responsive License Page
  • 3029 Merged PRs, 5485 Issues closed &359 contributors
  • DevTools embedded in VSCode
  • Auto import change in VSCode
  • 90K flutter apps on Playstore
  • Tree Shaking of Icons fonts
  • Sound Null Saftey
  • Dart 2.9 released
  • Pigeon Package
  • Tooling MetaData
  • New pubspec format
  • Performance Improvement

We will try to cover every possible feature in this article. So let’s get started with our first update Autofill Support.

  • Autofill Support

The first update has been done with Autofill Support. Autofill is one of the requested features by many people. Users can take a look at Autofill Part 1 so now from the Flutter 1.20 onwards, all users will get support for Autofill. This request from git has already been merged so you will get support for auto-filling. It’s a pretty basic state according to my guess. By all users will be able to use it and there will be more updates on it.

Autofill is one of the things which probably most of the user would want that’s why it has been added to this Flutter 1.20 release.

The second thing we will discuss is InteractiveViewer Widget

  • InteractiveViewer Widget

InteractiveViewer Widget will help the user to pan and zooming things. Kindly check out the API documentation to understand how to integrate InteractiveViewer Widget into your own app.

If you are more curious about how the InteractiveViewer was designed and developed, you can see a presentation by the author for Chicago Flutter on YouTube.

When you run this program users will get FlutterLogo in a Center. Users can Zoom into FlutterLogo, Drag, and Drop it all these things can be achieved by using InteractiveViewer Widget.

  • MouseCursor Support

MouseCursor Support is one of the most upvoted features for the desktop. Several commonly used widgets will display the cursors you expect by default, or you can specify another from the list of supported cursors.

MouseCursor Support

MouseCursor Support

  • Material Widget Updates

Flutter recently updated the Slider Widget and RangeSlider Widget to the latest Material guidelines. The new sliders were designed with better accessibility in mind: The tracks are taller, the thumbs have shadows, and the value indicators have a new shape and improved text scaling support.

Both the Slider Widget and RangeSlider Widget consist of five parts:

  • Value indicators that show labels for thumb values
  • A track that the thumbs slide across
  • Thumbs that indicate the position of the value
  • Overlays that display when the thumbs are pressed
  • Tick marks on the track when the slider is discrete
  • New Responsive Licenses page

Google, with community contributor TonicArtos, has updated new responsive licenses page to match material guidelines by making it easier to look at and making navigation easier that is designed making it efficient for desktops, tablets, and phones.

Another update this release is the new responsive licenses page available from the AboutDialog.

Responsive Licenses page

Responsive Licenses page

  • 3029 Merged PRs, 5485 Issues closed &359 contributors

Flutter’s openness and amazing community contributors that this release includes 3,029 merged PRs and 5,485 closed issues from 359 contributors from around the world, including 270 contributors from the Flutter community at large. In fact, this marks the largest number of contributors we’ve ever had for a Flutter release. Our team couldn’t create Flutter without a broad team of community contributors, so thank you!
Each new release of Flutter brings with it increased usage and momentum. In fact, in April, we reported that the number of Flutter apps in the Google Play Store had reached 50,000, with a peak rate of 10,000 new apps/month. Now, just over three months later, there are more than 90,000 Flutter apps in Google Play. And finally, Flutter isn’t Flutter without Dart, so it’s great to see that the IEEE has reported that Dart has moved up 4 slots since last year to be #12 in the top 50 languages that they track.

  • DevTools embedded in VSCode

Google has added a brand new Visual Studio Code extension that brings Dart DevTools straight into the Visual Studio Code coding workspace. This could be enabled with the dart.previewEmbeddedDevTools setting.

Dart-DevTools-in-Visual-Studio-Code
          Dart-DevTools-in-Visual-Studio-Code
Dart-DevTools-in-Visual-Studio-Code-768x442-1
Dart-DevTools-in-Visual-Studio-Code-768×442
  • Auto import change in VSCode

There is one more thing that has happened they have improved the support for auto import. Basically, what used to happen when the user moves files from one folder to another folder the file gets moved but the import doesn’t change.

  • 90K flutter apps on Playstore

Each new release of Flutter brings with it increased usage and momentum. In fact, in April, we reported that the number of Flutter apps in the Google Play Store had reached 50,000, with a peak rate of 10,000 new apps/month. Now, just over three months later, there are more than 90,000 Flutter apps in Google Play.

  • Tree Shaking of Icons fonts

As an example of the former, this release fixes a tooling performance issue with icon font tree shaking and makes font tree shaking the default behavior when building your non-web apps. Icon font tree shaking removes the icons that you’re not using in your app, thus reducing the size. Using this against the Flutter Gallery app, we found that it reduced the app size by 100kb. Now you get this behavior by default in your mobile apps when you’re doing a release build. It’s currently restricted to TrueType Fonts, but that restriction will be lifted in future releases. Another performance improvement we’ve made in this release reduces jank in the initial display of your animation using a warm-up phase.

  • Sound Null Safety

Dart’s null safety is sound. This means that Dart is 100% sure that the files list, and the elements in it, cannot be null in the above example. When Dart analyzes your code and determines that a variable is non-nullable, that variable is always non-nullable: if you inspect your running code in the debugger, you’ll see that non-nullability is retained at runtime. By contrast, some other implementations are unsound, and in many cases still need to perform runtime null checks. Dart shares sound null safety with Swift, but not very many other programming languages.
The soundness of Dart’s null safety has another welcome implication: it means your programs can be smaller and faster. Because Dart is really sure that files are never null, Dart can optimize. For example, the Dart ahead-of-time (AOT) compiler can produce smaller and faster native code, because it doesn’t need to add checks for nulls when it knows that a variable isn’t null.

  • Dart 2.9 released

This release of Flutter is built on the 2.9 release of Dart. This features a new state-based, two-pass UTF-8 decoder with decoding primitives optimized in the Dart VM, partially taking advantage of SIMD instructions. UTF-8 is by far the most widely used character encoding method on the internet, and being able to decode it quickly is critical when receiving large network responses. In our UTF-8 decoding benchmarks, we have seen improvements across the board from nearly 200% for English texts to 400% for Chinese texts on low-end ARM devices.

  • Pigeon Package

A new command-line tool called Pigeon has been added to address the need to make communication safer and easier between Flutter and the host platform for plugins and Add-to-App. Pigeons use Dart syntax to generate a type-safe messaging code on top of platform channels without adding additional runtime dependencies. It supports Objective-C, Java, Kotlin, Swift for now.

These are some of the most common and popular flutter updates with developers. Some more updates in this version include a new pubspec.yaml format required for publishing plugins, updates to network tracking, Updating import statements on file rename, Typesafe platform channels for platform interop, and many more. It also includes tooling metadata for every tool builder.

  • Tooling MetaData

One more update to mention is for people building Flutter tooling. We’ve created a new project on GitHub to capture and publish metadata about the Flutter framework itself. It provides machine-readable data files for the following:
1. A catalog of all of the current Flutter widgets (395 widgets!)
2. A mapping of Flutter framework color names to color values, for both the Material and Cupertino color sets
3. Icon metadata for Material and Cupertino icons, including icon names and preview icons.

This is the same metadata that we use for the Android Studio / IntelliJ and VS Code extensions ourselves; we thought you might find it useful when building your own tools.

  • New pubspec format

New pubspec.yaml format required for publishing plugins
Of course, Flutter isn’t just the widgets; it’s also the tooling and this release comes with too many updates to mention. However, here are some of the highlights.

First and foremost, a public service announcement: if you’re a Flutter plugin author, then the legacy pubspec.yaml format is no longer supported for publishing plugins. If you try, you’ll get the following error message when executing pub publish:

Legacy pubspec format error message upon plugin publication
The old format did not support specifying which platforms your plugins support, and has been deprecated since Flutter 1.12. The new pubspec.yaml format is now required for publishing new or updated plugins.

  • Performance Improvement

A shader is a piece of code that runs on a GPU (graphics processing unit). When a shader is first used, it needs to be compiled on the device. The compilation could cost up to a few hundred milliseconds whereas a smooth frame needs to be drawn within 16 milliseconds for a 60 fps (frame-per-second) display. Therefore, a compilation could cause tens of frames to be missed, and drop the fps from 60 to 6. This is compilation jank. After the compilation is complete, the animation should be smooth.

If the animations on your mobile app appear to be janky, but only on the first run, you can warm up the shader captured in the Skia Shader Language (SkSL) for a significant improvement.

Jank Improvements in Flutter
      Jank Improvements in Flutter

Thanks for reading!!!
Do let us know your valuable/feedback to serve you better.