Flutter 2.5: What changes does it bring?
Tags: flutter, dart, programming, 100daysofcode
Published: 2021-09-09 07:38:45


If you’re reading this, you probably already know what Flutter is but for those who don’t, Flutter is Google’s very own UI toolkit for building beautiful, natively compiled applications for [mobile](https://flutter.dev/docs), [web](https://flutter.dev/web), [desktop](https://flutter.dev/desktop), and [embedded](https://flutter.dev/embedded) devices from a single codebase. Flutter achieves this dart using its a language known as Dart.

Less than 24 hours ago, The Flutter team released a new stable version of Flutter i-e; Flutter 2.5. Talking about the numbers, this version closes 4600 issues and is contributed by around 252 contributors and 216 reviewers with a whooping 3932 PRs merges.

The new version brings in a lot of new features with it mostly relating to Performance,better Exception Handling and much more. In this article, We’ll go through the major ones. If you’re interesting to know every change in depth, you can read Chris Sell’s Original article [here](https://medium.com/flutter/whats-new-in-flutter-2-5-6f080c3f3dc).

#Dart 2.14 :

What better way to start with the changes than Flutter’s brother in arms, Dart 🎯 . The new version of Dart brings in changes to code Formatting, making Cascading more clear. The triple shift operator also makes a comeback for better bitwise shifting. Another major change is the introduction of Lint out of the box with every Flutter Project. You don’t have to manually add Lint to your projects anymore.


#New Template App:

Since the start of mankind, We’ve been seeing the good old Counter App as the demo app whenever we make a new project. The Counter App might finally have a comepetitor 😅. With this new release, We can have a new Demo App that demonstrates a list having three items with its detail page and a way to implement the dark mode.

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tj5uwykki9r36hznvjbw.png)


#Framework Changes:


* Android FullScreen Mode:

Starting off with the change related to Android Full Screen mode. Now we can have more control over the Full Screen modes in our app. Flutter 2.5 comes with three new modes: lean back, sticky, sticky immersive, and edge to edge.
The developers have more control over how when the user interacts with the app, they can return to fullscreen or do something else.

![Android Full Screen Changes](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9588h495y37p0m125zfd.png)



* Floating Action Button (FAB) Sizes:

With the new update, Sizing the Floating Action Button(FAB) is a lot easier now.
![FAB Image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cl9n75zuo4ri6qoc5a78.png)



* Material Banner:

Another good addition to the is the Material Banner which lets the developers to add the functionality of a banner at the top of Scaffold that sticks to its place until the use dismisses it from view.

![Material Banner Image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u2d2wr92ljwx396nh7yn.gif)


Let’s see how we can have implement this behavior of Banners in our apps.

```dart

class HomePage extends StatelessWidget {
  const HomePage({Key? key}) : super(key: key);
  @override
  Widget build(BuildContext context) => Scaffold(
        appBar: AppBar(
          title: const Text('The MaterialBanner is below'),
        ),
        body: Center(
          child: ElevatedButton(
            child: const Text('Show MaterialBanner'),
            onPressed: () => ScaffoldMessenger.of(context).showMaterialBanner(
              MaterialBanner(
                content: const Text('Hello, I am a Material Banner'),
                leading: const Icon(Icons.info),
                backgroundColor: Colors.yellow,
                actions: [
                  TextButton(
                    child: const Text('Dismiss'),
                    onPressed: () => ScaffoldMessenger.of(context)
                        .hideCurrentMaterialBanner(),
                  ),
                ],
              ),
            ),
          ),
        ),
      );
}

```

More changes include the ones to theming which are now Material You based and the addition of new MaterialState.scrollUnder state that you can see below:

![image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/18ntnoi3lbv129whlck1.gif)


One more change worth talking about here is the improvement on the scroll metrics notifications which now provides notifications of scrollable areas when the UI is not being scrolled. One application of that would be the example below which shows or hides scrollbar based on underlying size of the ListView. An the best part about it that you don’t even have to write any extra code to get this behavior in your apps.

![listSize Image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/oglbsujjw1nexz23yz7b.gif)



#VSCode Improvements:

* Dependencies:

It becomes tedious to add packages from pub.dev into your project if the list is a long one.[Pubspec](https://marketplace.visualstudio.com/items?itemName=jeroen-meijer.pubspec-assist) assist made it easier to add packages but now you don’t even need it as it comes built in with the Flutter plugin for VS Code.

![VsCode Image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6jg0lbucyrzjh0safzgk.gif)


* Fix All:

We’ve been there when we refactor our code and have to manually add the dependencies for everything that is being used in our code. Worry no more! Fix All got you covered. Use the Fix All command and it fixes all the known dependencies related issues in your code like magic. 🔮

![VsCode FixAll Image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/itx404fgawm7uecm3iqs.gif)


Mind that the command can be made to run on on-save by adding sources.fixAll to the editor.codeActionsOnSave Setting in VS Code.


#IntelliJ/Android Studio Improvements:

* Integration Tests:

With the new update, changes have been made to the Flutter IntelliJ/Android Studio plugin which is now capable of running Integration Tests. Integration tests are whole-app tests that run on a device, live in the integration_test directory and use the same testWidgets() functionality from widget unit tests. To add the integration tests to the project, you can follow the guide on [flutter.dev](https://flutter.dev/docs/testing/integration-tests)

![IntelliJ Image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/snb6dqhebu4nlwv4bxp0.png)


* Icons Preview:

Another good addition to the release is the addition of preview icons. Now you can have Icon Previews in your IntelliJ/Android Studio which are based around TrueType Font Files similar to Material & Cupertino Icon previewing.

![IconPreview Image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0nsh60apj0gbfvgyxgxp.png)

To enable icon previews you need to tell the plugin which packages you are using. There is a new text field in the plugin settings/preferences page. One thing to keep in mind is that these icon previews work for static constants in the class and won’t work for expressions like LineIcons.addressBook() or LineIcons.values[‘code’].

![Font Packages Image](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/p9v85p0l9era86s19a6v.png)




![Thats all folks image](https://media3.giphy.com/media/lTpme2Po0hkqI/giphy.gif?cid=790b7611802bd4b8a7a54f34bcdce17e97b1de4c92da1e18&rid=giphy.gif&ct=g)


That’s all for now Folks! These were some of the changes that Flutter 2.5 brings. Thanks for reading this article ❤️
Clap 👏 If this article helped you.

Feel free to post any queries or corrections you think are required ✔

Do leave a feedback so I can improve on my content. Thankyou! 😃

If you’re interested, here are some of my other articles:

* [Dart Collection Types: Sets]
(https://dev.to/iizmotabar/exploring-dart-collection-types-part-2-sets-32lm)

* [Dart Collection Types: Lists](https://dev.to/iizmotabar/exploring-dart-collection-types-part-1-lists-3ocj)

* [The Beauty of Dart Strings Method](https://dev.to/iizmotabar/the-beauty-of-dart-string-methods-1nje)