What’s new in Flutter 3.16

By Akash
on 28-12-2023 11:29 AM

Welcome back to the quarterly Flutter stable release, this time for Flutter 3.16. This release sets Material 3 as the new default theme, brings a preview of Impeller to Android, allows adding extensions for DevTools, and much more! It also coincides with significant updates to the Flutter Casual Games Toolkit!
In only three months since our last release, we’ve had 928 pull requests merged by 145 community members with 40 community members authoring their first commit to Flutter!Keep reading to learn about all the new additions and improvements the Flutter community has contributed to this latest release!

As of the 3.10 release (May 2023) the Material library has been updated to match the latest Material Design spec. Changes include new components and component themes, and updated component visuals. Prior to the 3.16 release, the changes were “opt-in” with the useMaterial3 theme flag. As of this release, useMaterial3 is true by default. (#130764)
You can still opt out of the M3 version of the Material library by specifying useMaterial3: false in your MaterialApp theme, but Material 2 will eventually be deprecated and removed. Also, some of the widgets couldn’t merely be updated, but needed a whole new implementation. For this reason, your UI might look a little strange when you see it running as Material 3. To fix this, manually migrate to the new widgets, such as NavigationBar. For more details, check out the Material 3 umbrella issue on GitHub.A demo application allows you to try all of the components. The demo supports toggling useMaterial3 so that you can compare the changes.

The appearance of Material 3 components are primarily determined by the values for [ThemeData.colorScheme] and [ThemeData.textTheme]. The preferred way to create a Material 3 color scheme is with ColorScheme.fromSeed(), which creates dark and light schemes that are both aesthetically pleasing and compliant with the contrast requirements for accessibility. You can also create a color scheme from the dominant colors in an image with ColorScheme.fromImageProvider. To further customize the appearance of Material 3 components, add component themes to your ThemeData, such as ThemeData.segmentedButtonTheme or ThemeData.snackBarTheme. Non-null component theme properties override the defaults specified in the component’s API documentation.
Improvements to Material 3 motion includes the addition of Easing and Durations classes. Material 2 curves have been renamed to include the word “legacy” and will eventually be deprecated and removed. (#129942)
On native iOS, users can now select text and initiate a share menu that provides several standard services. In this release, we’ve added the look up, search, and share options.