Introduction to Flutter and Desktop Apps

CL
Concetto Labs
  • Date Published
  • Categories Blog
  • Reading Time 4-Minute Read

Would you like to build Flutter desktop apps and enjoy plugins that are available in the future? Hire a Flutter desktop app developer now.

Flutter is Google’s UI toolkit that builds beautiful and compiled applications for the mobile, desktop, web from a single codebase. One can build Flutter desktop apps to retrieve your repositories and other pull requests. One can develop and use plugins to interact with native API and use code generation to build safe libraries for GitHub’s APIs. The desktop embedding for flutter was mainly developed for Windows, Linux, and macOS using early-stage desktop plugins.

Flutter is an ambitious project where Google has mainly focus on creating an independent platform for iOS and Android. It’s working great and is ready for production use and in creating an impressive front-end web framework.



How To Enable Web and Desktop Development?

If you’re looking to enable web development, you first need to be on flutter’s beta channel. Some of the ways are listed below:
Install Flutter directly on the beta channel and download the appropriate latest beta version from the SDK archive.
If you have Flutter installed then switch to beta channel using $flutter channel beta and perform the switch.

Update the Flutter version using $flutter upgrade

Later you can run
$flutter config –enable-web

Talking about Flutter desktop apps, then desktop support is more experimental than other platforms. As it lacks tools for Linux and windows with making plugin development a major pain and fact that APIs used for intended for proof of concept. It’s unlike development that uses tried and tested dart2js compiler for release builds.

Previously it doesn’t support Windows and Linux native desktop apps. But now it supports desktop development from where we can switch to the master release channel for the beta version. Run the following code for Linux, Windows, or macOS.

$flutter config –enable -<OS_NAME) – desktop

How To Run and Build Flutter Web Apps?

Flutter web support isn’t bad as it reflects in the ease of development for any web platform. Let’s see how to run this…

$flutter devices

Running into the chrome can cause flutter to show entry by using flutter run on a compatible when you’re connected device shows up. Flutter starting with the webserver on localhost:<RANDOM_PORT>, will allow you to access Flutter with a web app from any browser. If our chrome doesn’t show up any set, then use a CHROME_EXECUTABLE environment variable to show a path for Chrome executable file.

Configure Flutter With Desktop

  • Initialize a flutter project using VSCode or
  • Flutter create ‘Your New Project Name.’
  • Take example directory for the previous step

Folders

  • Copy windows folder for windows
  • Copy Linux folder -> Linux users
  • macOS folder for mac

In main.dart file in a new project you have to add below lines:

Final Step, in your pubspec.yaml under the environment section
flutter: ‘>=1.10.2-pre.54’
flutter added in the environment

How To Run and Build Flutter Desktop Apps

If you want to enable Flutter desktop support then run a Flutter app natively on your development workstation with Flutter run -d <OS_Name>, with replacing <OS_Name> using the same value to enable desktop support. You can also build binaries using build directory and flutter build <OS_NAME>

It’s best if you had a directory that contains Flutter to build the platform. When you’re creating a new project, you need to create an existing project with flutter create.
One can also use LINUX and WINDOWS APIs to regenerate those platforms if the apps stop working after a flutter update.

What Are the Requirements To Start a Flutter Desktop App?

Build desktop apps using Flutter and an update flutter SDK environment with desktop support enable:

  • Download Flutter for your OS from the website
  • Switch to master channel using $flutter channel master
  • Upgrade Flutter using $ flutter upgrade

Now, enable the support using the target environment

  • macOS: $ flutter config — enable -macOS-desktop
  • Linux: $ flutter config – enable-Linux-desktop
  • Windows: $ flutter config – enable-windows-desktop

Also read: Flutter: A Portable UI Framework For Mobile, Web, Embedded, And Desktop

Wrap Up

Flutter desktop can embed under active development. One can continue to improve it over the coming months and years by developing excellent UI development. Build the desktop application and enjoy plugins that are available in the coming future with deeper OS integration. You can hire a Flutter developer or flutter development company to create awesome apps and target your macOS, Windows, and Linux. Allow us to serve you best as we are one of the best Flutter desktop app developers that’ll create apps for App stores, web, Google Play, and desktop using the latest framework.