Google releases Flutter 3.7 and hints at the future of the app development framework, This version improves Material You support, performance and memory management

Google announced the general availability of Flutter 3.7 on Wednesday at Flutter Forward, an event for developers. The company took the opportunity to discuss the future of its cross-platform application development framework. From humble beginnings on Android and iOS, Flutter can now help you build apps for mobile, desktop, web, and more, all from a single Dart codebase. This new version of Flutter supports more Material You (Material3) widgets and menus, fixes some bugs and improves performance.

The Flutter SDK reached its 1.0 milestone on December 4, 2018. According to Tim Sneath, who leads Dart and Flutter product management, said that in May 2022, there were 500,000 apps built using Flutter, or two times more than a year ago. At Wednesday’s event, held in Nairobi, Kenya, Sneath said that number has now risen to 700,000. last May. Google estimates that Flutter has attracted 5 million developers and according to GitHub it is one of the top three open Source projects based on the number of contributors.

When others measure such things, Flutter always seems to be quite popular. Analysts say Flutter could become more so as the SDK extends new hardware platforms like RISC-V and ARM64 for Windows and tackles performance issues, making it better suited for games and other games. compute-intensive applications. Finally, he learns to adapt to the Web and other programming languages. Flutter version 3.7 further improves the framework with the addition of some great new features. Below are the highlights of Flutter 3.7:

Improved Material 3 support

Material 3 support has been significantly improved in version 3.7 with the migration of the following widgets:

  • Badge
  • Lower app bar
  • Solid buttons and solid tones
  • SegmentedButton
  • check box
  • Separator
  • menus
  • DropdownMenu
  • Drawer and navigation drawer
  • Progress indicator
  • radio buttons
  • slider
  • Snack bar
  • TabBar
  • Text fields and InputDecorator
  • Banish

To use these new features, simply activate the indicator useMaterial3 in widget ThemeData of your app. According to the team, to take full advantage of Material3 support, you’ll need a full M3 color scheme. You can provide your own, use the new theming tool, or Flutter can generate one for you from a single base color using the colorSchemeSeed from the manufacturer of ThemeData.

Menu bars and cascading menus

Flutter can now create cascading menu bars and context menus. For macOS, create a menu bar using the widget PlatformMenuBar, which defines platform-native menu bars rendered by macOS, not Flutter. And, for all platforms, you can define a Material Design menu that provides cascading menu bars (MenuBar), or standalone cascading menus triggered by another UI element (MenuAnchor).

These menus are fully customizable, and the menu items can be custom widgets, or you can use the new menu item widgets (MenuItemButton, SubmenuButton).

Impeller Renderer Overview

The team announces that the new Impeller rendering engine is ready to be tested on iOS in the stable channel. We believe Impeller’s performance will meet or exceed that of the Skia renderer for most applications, and when it comes to fidelity, Impeller implements all but a few rarely used outliers. We plan to make Impeller the default renderer on iOS in an upcoming stable release, so keep sending your feedback on Impeller on GitHub, the team said in a Flutter 3.7 features blog post.

While we’re increasingly confident that Impeller on iOS will meet the rendering needs of almost any Flutter app out there, there are still some gaps in API coverage. The small number of remaining gaps are listed on the Flutter wiki. Users may also notice minor visual differences in rendering between Skia and Impeller. These minor differences may be bugs, so feel free to report problems. Our progress on Impeller has been greatly accelerated by community contributions,” she added.

iOS version validation

When you launch an iOS app, an up-to-date settings checklist ensures your app is ready to submit to the App Store. The command flutter build ipa now validates some of these parameters and informs you if any changes need to be made to your application before it is released.

DevTools Updates

This release includes several new tool features and general test enhancements. DevTools’ memory debugging tool has undergone a complete overhaul. There are three new feature tabs, Profile, Trace and Diff, which support all previously supported memory debugging features and add more to make debugging easier. According to the Flutter team, among the new features is the ability to analyze your application’s current memory allocation by class and memory type.

It also makes it possible to find code paths that allocate memory for a set of classes at runtime, and to differentiate between memory snapshots to understand memory management between two points in time. The page Performance also includes some notable new features. A new tab Frame analysis at the top of the page Performance provides information about the selected flutter frame. These can be suggestions on how to follow the expensive parts of the flutter frame in more detail, or warnings about expensive operations detected in the flutter frame.

According to the team, these are just a few highlights, but this release contains several bugfixes and improvements beyond the features mentioned here, including important bugfixes for the Inspector, Network Profiler, and Profiler of CPUs.

Custom context menus

You can now create custom context menus anywhere in a Flutter application. You can also use them to customize the built-in context menus. For example, you can add a “Send Email” button to the default text selection toolbar that appears when the user has selected an email address. View Parameter contextMenuBuilderwhich has been added to existing widgets that show a context menu by default, like TextField. You can return any widget from contextMenuBuilderincluding modifying the default context menu adapted to the platform.

This new feature also works outside of text selection. You can, for example, create an “Image” widget that displays a “Save” button on right click or long press. Use ContextMenuController to display the current platform’s default context menu, or a custom menu, anywhere in your application.

Scrolling improvements

Several scroll-related updates have been incorporated into this version: improved and refined interactions with the trackpad, new widgets such as Scrollbars and DraggableScrollableSheet, and improved handling of text selection in scrolling contexts. In particular, macOS applications will now benefit from greater fidelity thanks to the addition of new scrolling physics to match that of the desktop platform. The new widgets AnimatedGrid and SliverAnimatedGrid animate the elements added (or removed) from a list.

Finally, the team fixed a regression in the constructor of several scrollable widgets, such as [CListView[/C]. When NNBD migrating from Flutter framework, itemBuilderwhich allows users to provide widgets on demand, has been migrated to IndexedWidgetBuilder. It meant that itemBuilder couldn’t go back null, which (in the past) could be used to indicate that the end of the list had been reached. This functionality has been restored with NullableIndexedWidgetBuilder.

Removing macOS 10.11 10.13

As previously announced, Flutter no longer supports macOS versions 10.11 and 10.12. Since that announcement, further analysis revealed that removing support for 10.13 would have limited additional impact and would help the team significantly simplify the codebase. This means that apps built with Flutter’s stable SDKs from this release will no longer work on these builds, and the minimum macOS version supported by Flutter is 10.14 Mojave.

As a result, since all versions of iOS and macOS supported by Flutter include support for Metal, the OpenGL backend has been removed from the iOS and macOS embedders. Removing these backends reduced the compressed size of the Flutter engine by around 100 KB.

Other changes and improvements

Google is also working on new ways to help Flutter apps integrate with the underlying operating system or platform. For Android and iOS, the Flutter team is reinventing the way platform-native plugins are created. Instead of having to use platform channels to pass messages to native code, Flutter for iOS developers will soon be able to use the FFI from Dart to directly call Objective-C and Swift code. Similarly, Flutter on Android will be able to use NYI to call Kotlin code.

For Flutter web apps, a new JavaScript library makes it easy to call your app’s Dart code from the external page’s JavaScript code. Similarly, you can now embed a Flutter view into a page through a HTML-div standard. You can see both of these in a fun demo page. Elsewhere in Flutter news, Google has made progress in compiling Dart apps with WebAssembly. According to the team, this was no small feat, since WebAssembly did not initially support garbage-collecting languages, such as Dart.

Eventually, this should result in a significant improvement in Flutter’s web performance. In addition to compiling to WebAssembly, the Dart team has also begun offering full support for the RISC-V architecture, with the ultimate goal of making Flutter applications run on RISC-V. Another big announcement on Wednesday is that Google is moving ahead with plans to release version 3.0 of the Dart programming language on which Flutter apps are built. The alpha version of Dart 3 is already available for the first tests, with a strong emphasis on the requirement of solid and zero security.

Source: Flutter 3.7

And you?

What do you think of the new features introduced by Flutter 3.7?

See as well

Google’s Flutter 3 adds support for macOS and Linux desktop apps, framework comes with deeper integrations with Firebase

Ubuntu makes Flutter a default choice for future desktop applications, Canonical wants to bet on the future of the free and open Source UI development framework offered by Google

Google’s Flutter: 2 Million Developers, Rise in Enterprise Usage, Revealed New Framework Update Process

The article is in French

Tags: Google releases Flutter hints future app development framework version improves Material support performance memory management