It’s been refined to offer a consistent and performant experience when going from running a Flutter app natively on mobile devices to running it in a browser. The compilation target, previously very experimental and tricky to use to render your app (with WebAssembly and Skia) is now called CanvasKit. With the release of Flutter 2.0, there have been many improvements to it, especially when it comes to performance. Flutter Web Changesįlutter for the web was already in a quite usable form, but there were performance and usability issues which meant it never felt as polished as mobile Flutter. You can see an example of the use of a regular Material scrollbar a bit further down this article in the desktop app example. Meanwhile, you can just wrap any scrollable view with the scrollbar widget of your choice and create a ScrollController to add as the controller for both the scrollbar and the scrollable widget (in case you’ve never used a ScrollController, you use exactly like a TextEditingController for a TextField).
![flutter desktop flutter desktop](https://miro.medium.com/max/5760/1*0jt2zEXdmGi0v3ztkgdhNA.png)
It also looks like at some point Flutter will automatically show suitable scrollbars when the content of the app is scrollable. Now there is a built-in Scrollbar which can fit right into your app, looking exactly how a scrollbar should look in the specific platform: with or without a track, with the possibility of scrolling by clicking on the track, for example, which is huge if you want your users to feel right at home from the start when using your Flutter app. General Usability Changes For Bigger DevicesĪccording to the announcement, many changes have been made to Flutter to provide better support for devices that aren’t mobile devices.įor example, an obvious example of something that was needed for web and desktop apps and until now had to be done using third-party packages or by implementing it yourself is a scrollbar. Let’s look at some of the technical changes to Flutter which got onto the stable channel with version 2.0 and build a very simple example desktop app with Flutter before we draw some conclusions on what specific project types we could and couldn’t use Flutter for as of now. You can take a look at Google’s Flutter 2 announcement to get a more complete picture. They also released a Flutter version of Ubuntu’s Yaru theme, which we will use later in the article to build a Flutter desktop app that looks perfectly at home in the Ubuntu desktop, also using some more of the new Flutter features. the world’s biggest car manufacturer, Toyota, will now be building the infotainment system on their cars using Flutter.Īnother interesting announcement - this one showing how fast Flutter is improving as a cross-platform SDK - is Canonical’s announcement that, in addition to developing their new Ubuntu installer using Flutter, they will also be using Flutter as their default option to build desktop apps. There were also actual examples of how large companies are already working on Flutter apps to replace their existing apps with ones that perform better and allow developers to be more productive. In the announcement, Google didn’t just give a hint of what the future of Flutter will be like. In fact, it is currently enabled in release candidate-like form as an early release beta snapshot in the stable channel.
![flutter desktop flutter desktop](https://miro.medium.com/max/2000/1*34MU2Xc0PU9F7g_tKsbDzg.png)
![flutter desktop flutter desktop](https://www.concettolabs.com/blog/wp-content/uploads/2019/05/flutter-desktop-app.png)
The change that is central to understanding why Flutter 2.0 matters is that web development is now officially part of the stable channel and desktop support will follow soon on the stable channel as well. This release is really a proper 2.0 release, with many changes promising to make Flutter really ready for going beyond mobile app development. On the 3rd of March, Google held the Flutter Engage event, where Fluter 2.0 was launched. The first article was a general introduction to web and desktop development, and focused on building responsive UI the second article was about the challenges you might face when trying to develop a Flutter app that runs on multiple platforms.īack then, Flutter support for non-mobile platforms wasn’t considered stable and production-ready by the Flutter team, but things have changed now. Last year, I wrote two articles here on Smashing Magazine about using Flutter on web and desktop platforms. With Flutter 2, non-mobile Flutter development is starting to become more viable.
#Flutter desktop code
Flutter has been transitioning from a cross-platform mobile development SDK for Android/iOS into a tool that allows you to run the same code natively in a browser on Windows, Linux and macOS.