How to add web/desktop support for existing flutter app in OpenSUSE


Have flutter project in hand which is built for Android and iOS, now want to built desktop and web counter part?

Make sure that you have enabled, web, desk features. To ensure this run the following

Flutter devices

If not please go through the web/desk support post.

How to enable Flutter Web support in Ubuntu Linux - How to enable Flutter Web development in Ubuntu Linux
How to enable Flutter Desktop support in Ubuntu Linux - How to setup Flutter Desktop development environment on Ubuntu

Here is the solution

Make sure you had an active internet connection.

Cd to your project folder and in the console enter these commands

For few second it will add tools for desktop and web features.

Flutter create . 

Run the flutter command

Flutter run -d chrome

Flutter will goes through building process and will bring you a local host id.

For desk top try to run

Flutter run -d windows/linux/mac 

How to add web/desktop support for existing flutter app in Ubuntu


Have flutter project in hand which is built for Android and iOS, now want to built desktop and web counter part?

Make sure that you have enabled, web, desk features. To ensure this run the following

Flutter devices

If not please go through the web/desk support post.

How to enable Flutter Web support in Ubuntu Linux - How to enable Flutter Web development in Ubuntu Linux
How to enable Flutter Desktop support in Ubuntu Linux - How to setup Flutter Desktop development environment on Ubuntu

Here is the solution

Make sure you had an active internet connection.

Cd to your project folder and in the console enter these commands

For few second it will add tools for desktop and web features.

Flutter create . 

Run the flutter command

Flutter run -d chrome

Flutter will goes through building process and will bring you a local host id.

For desk top try to run

Flutter run -d windows/linux/mac 

How to fix flutter windows app exception plugins requires symlink support ?


Flutter may throw an exception builder the native platform app in Windows 10, due to the falsely configured developer settings.

Error : Exception: Building with plugins requires symlink support.

In order to fix this error go to (Windows 10)

  • Start – Type Settings
  • Update & Security
  • For developers
  • Enable install app from any source .

Now try to run the app again

lutter run -d windows

It should work

How to add web/desktop support for existing flutter app


Have flutter project in hand which is built for Android and iOS, now want to built desktop and web counter part?

Make sure that you have enabled, web, desk features. To ensure this run the following

Flutter devices

If not please go through the web/desk support post.

How to enable Flutter Web support in openSUSE Linux - How to enable Flutter Web development in openSUSE Linux
How to enable Flutter Desktop support in Windows 10 - How to enable Flutter for developing Windows desktop applications
How to enable Flutter Desktop support in openSUSE Linux - How to setup Flutter Desktop development environment on openSUSE or on any Linux

Here is the solution

Make sure you had an active internet connection.

Cd to your project folder and in the console enter these commands

For few second it will add tools for desktop and web features.

Flutter create . 

Run the flutter command

Flutter run -d chrome

Flutter will goes through building process and will bring you a local host id.

For desk top try to run

Flutter run -d windows/linux/mac 

Enable Flutter Web support on Windows


Flutter can be used to create web applications, which is possible by enabling the feature. Before that I would like recommend the basic flutter setup on Windows post.

Flutter setup for Windows

Flutter become popular cross platform development tool. Let’s Install Flutter in Windows. As a open source project, we can install the flutter SDK from GitHub.

The prerequisites

The minimum requirement for Flutter for Windows is Windows 10 or later . In order to clone the repository we have to use git. Also recommend to have Visual Code /Atom for editing the code.

Download and install the Git tool for windows

Clone the repository

Get the latest stable version from GitHub repository or alternatively can download from flutter site

git clone https://github.com/flutter/flutter.git -b stable --depth 1

Use the -b option to clone the stable version

Set the path variable

You also need to update the path variables

  • From the Start search bar, enter ‘env’ and select Edit environment variables for your account.
  • Under-User variables check if there is an entry called Path:
  • If the entry exists, append the full path to flutter\bin using ; as a separator from existing values.
  • If the entry doesn’t exist, create a new user variable named Path with the full path to flutter\bin as its value.

Call the Doctor

run Flutter doctor command to inspect status of your Flutter SDK and tools installed

Android IOS development

For Android you have to install the Android Studio for development tool support which can be download from official website.

Enable web feature

Before starting make sure you chrome/Edge installed on your system. Otherwise the feature may not work

For enabling the web feature we have to switch to the beta channel ( web feature is an experimental feature and official full support is not yet released)

flutter channel beta
flutter upgrade
flutter config --enable-web

Run the flutter doctor command again and then check the web feature is list or not by using

flutter devices

and it will list the web feature

Test Run

Flutter web app on Windows 10

Create sample Flutter project

flutter create myweb_app

run the app using flutter run command

flutter run -d chrome

For building the web we can use

flutter build web

How to enable Flutter Desktop support in Windows 10


Flutter can be used to create awesome Windows applications, which is possible by enabling the feature. Before that I would like recommend to run the basic flutter setup on Windows.

Flutter setup for Windows

Flutter become popular cross platform development tool. Let’s Install Flutter in Windows. As a open source project, we can install the flutter SDK from GitHub.

The prerequisites

The minimum requirement for Flutter for Windows is Windows 10 or later . In order to clone the repository we have to use git. Also recommend to have Visual Code /Atom for editing the code.

Download and install the Git tool for windows

Clone the repository

Get the latest stable version from GitHub repository or alternatively can download from flutter site

git clone https://github.com/flutter/flutter.git -b stable --depth 1

Use the -b option to clone the stable version

Set the path variable

You also need to update the path variables

  • From the Start search bar, enter ‘env’ and select Edit environment variables for your account.
  • Under-User variables check if there is an entry called Path:
  • If the entry exists, append the full path to flutter\bin using ; as a separator from existing values.
  • If the entry doesn’t exist, create a new user variable named Path with the full path to flutter\bin as its value.

Call the Doctor

run Flutter doctor command to inspect status of your Flutter SDK and tools installed

Android IOS development

For Android you have to install the Android Studio for development tool support which can be download from official website.

Enable desktop feature

In order to make Windows ready for Flutter desktop development environment we should have following dependencies

Now switch to the dev channel and run upgrade command, which will install necessary libraries and packages.

flutter channel dev
flutter upgrade

Configure the feature using config

flutter config --enable-windows-desktop

run the flutter doctor and then flutter devices as follows

flutter doctor
flutter devices

Flutter devices

Make sure the devices command list the Linux desktop

Test Run

Create sample Flutter project

flutter create myweb_app

run the app using flutter run command

flutter run -d windows
or
flutter run

Flutter Windows App

Happy fluttering

Flutter setup for Windows


Flutter become popular cross platform development tool. Let’s Install Flutter in Windows. As a open source project, we can install the flutter SDK from GitHub.

The prerequisites

The minimum requirement for Flutter for Windows is Windows 10 or later . In order to clone the repository we have to use git. Also recommend to have Visual Code /Atom for editing the code.

Download and install the Git tool for windows

Clone the repository

Get the latest stable version from GitHub repository or alternatively can download from flutter site

git clone https://github.com/flutter/flutter.git -b stable --depth 1

Use the -b option to clone the stable version

Set the path variable

You also need to update the path variables

  • From the Start search bar, enter ‘env’ and select Edit environment variables for your account.
  • Under-User variables check if there is an entry called Path:
  • If the entry exists, append the full path to flutter\bin using ; as a separator from existing values.
  • If the entry doesn’t exist, create a new user variable named Path with the full path to flutter\bin as its value.

Call the Doctor

run Flutter doctor command to inspect status of your Flutter SDK and tools installed

Android IOS development

For Android you have to install the Android Studio for development tool support which can be download from official website.

How to add Flutter path in OpenSUSE Linux


Flutter command not working on SuSE Linux ? Here is the quick reason for that. The path variable may not set or save.

Adding the path in a proper way may fix this issue.

 export PATH="$PATH:`pwd`/flutter/bin"

And now you are ready to create your first project

Filter Firebase collection in Future builder in Flutter


Cloud Firebase NoSQL can blazingly fast live data to your Flutter app. We can rely on Stream builder or Future builder to get a list of collections as we learn in the below posts.

Filtering future

How about filtering some collection based on fields ? We can filter collection using where clause then call the documents/get method to get the document snapshot as follows

 FutureBuilder(
           future: FirebaseFirestore.instance.collection('carts').where('Finished',isEqualTo: true).get(),
           builder: (context, snapshot) {
             return snapshot.hasData

Here the future return only those documents in the collection from carts whose Finished field is equal to true. Here isEqualTo: accept the document type value, it can be a string, bool or a number, can be any Firestore document type.

Connect Flutter app with MongoDB


To connect and perform CURD operations use any driver package available on pub.dev. mongo_dart package offer everything we need and it is pretty popular than others.

A prerequisite for using the dart package is that configure Mongo Cluster.  

Mongo_dart package

Mongo dart package is one of the most used one for connecting MongoDB with dart. You can grab the connection string from the MongoDB or just use the given code and put it in an async function.

For connecting MongoDB we need

  1. Import the mongo_dart package / add package dependency
  2. MongoDB user id and password
  3. MongoDB name

Continue reading Connect Flutter app with MongoDB