Google has released new releases of the cross-platform framework Flutter and the programming language Dart – as usual at the same time. In Flutter 3.7, the development team continues its efforts to make the full functionality of Material Design 3 available. The new version of the framework also enables developers to create their own context menus. The first alpha of Dart 3 meanwhile gives a preview of the upcoming major release of the programming language, which will be completely based on Sound Zero Safety in the future.
Flutter 2.10 already marked the start of the migration to Material 3, and since then Google has been consistently driving the changeover and transferring components to the new design language. For the new release, the Flutter team migrated a variety of widgets, including filled and filled tonal buttons, checkboxes, menus, radio buttons, and sliders. To be able to use these new functions, developers only have to set the flag useMaterial3
im ThemeData
-Set the application widget. However, to get the full potential of Material 3, Google recommends creating a full M3 color scheme. The new Theme Builder is available for this. Alternatively, you can let Flutter build a scheme based on a desired color:
MaterialApp(
theme: ThemeData(
useMaterial3: true,
colorSchemeSeed: Colors.green,
),
// …
);
Widgets that show context menus by default offer another new parameter as of Flutter 3.7: contextMenuBuilder
. This allows you to customize or expand the context menus. Next to the at TextField
usual copy commands, for example, the option to send an email can be placed when app users mark an email address:
Custom context menus in Flutter 3.7
(Image: Google)
User-defined context menus can now be set up not only for text selection, but also in other places in a Flutter app, for example to add a save button to images. See the Flutter repo on GitHub for more illustrative examples.
The Flutter 3.7 blog entry provides a complete overview of all changes and further details.
Dart 3 consistently relies on zero safety
The alpha version 3.0 of the programming language Dart gives an outlook on the next major release and its breaking changes. Null safety, which has been optional since Dart 2.12, will be enabled by default for the type system in the future. With Dart, Google speaks of Sound Zero Safety, in the sense of correct or flawless – comparable to the Sound Type System for strict type testing.
In order to make working with structured data more efficient, developers can also use records and patterns from Dart 3. In addition, options are added to class abilities with new modifiers such as base class
, sealed class
or mixin class
to control.
Building on the existing ways of accessing C modules on the Apple platforms using FFI (Foreign Function Interface), the Dart team is working on further improving the interoperability of the programming language in order to be able to call more platform-specific libraries directly from Dart . Support for iOS and macOS is to be expanded to include Swift and Objective-C, and Jetpack libraries written in Kotlin should be usable on Android, for example. In addition, the programming language should open up new target platforms – including WebAssembly (Wasm) and RISC-V.
Dart 3 Alpha is now available on the Dart Dev Channel and the Flutter Master Channel. The development team wants to complete a stable release in the course of the year. The blog post summarizes more information.
(map)