12

I have some basic knowledge of building android apps using Android Studio with Java language. Now I want to start learning flutter but not really sure about a couple of things. I read that it's possible to build cross-platform mobile apps with flutter and I can use an android studio to build those apps. Using flutter its also possible to build a website and desktop projects.

My confusions are :

1) Can I use Android Studio IDE with flutter to build mobile apps(both Android & IOS), desktop apps and websites?

2) First of all, I thought I just write a single code for both mobile apps and websites but guess I am wrong. So, if codes are different for mobile apps and website then how different are they? I mean is it something totally different or has some similarities. So, if someone can build a mobile app using flutter then they can easily build a website with flutter too?

3) Can flutter web be used instead of PHP for making websites and web services?

Samet ÖZTOPRAK
  • 3,112
  • 3
  • 32
  • 33
Rashedul Hasan
  • 155
  • 1
  • 1
  • 8

11 Answers11

8
  1. Yes, Android Studio can be used to write Android, iOS, Web and Desktop apps with flutter. All of them with a single codebase. By using Flutter you don't need to write separate apps for mobile & web for example.

  2. Right now, Flutter web is still a technical preview. Because of that, it is a fork of the original flutter project. That means you will need to separate the code for mobile and for web, as web project will need to import flutter_web and mobile projects just import flutter. That's the only difference. But when flutter web will be stable, it will be merged with the original flutter SDK and your code will then be the same on mobile and on web!

  3. Flutter is a frontend framework. PHP is for backends. So it is not directly comparable. With Flutter you can build UIs. If you need a backend framework then check server side Dart, which is really easy to learn and also really powerful.

Bonus: Flutter uses Dart as language so if you learn Flutter, you already know Dart :) One language to rule them all!

ja2375
  • 231
  • 3
  • 2
7

Yes it is. Open CMD in your project directory.

  1. You need to enable web support for flutter. use following command to do that.

    flutter channel beta
    
    flutter upgrade
    
    flutter config --enable-web
    
  2. If you want your existing flutter project to run on web then in your project directory you should call flutter create . command. This will create a web project if it is not created already.

  3. Use flutter devices command, you should see chrome as a device.

  4. In device list of Android studio it will show you the option to run your project on web.

  5. You can do the same using command line too. Use flutter run -d chrome command to run your project on web.

In terms of tools and configuration creating web project is not much different than creating an mobile app in Flutter. So, just follow the configuration steps properly and it should work well for you.

See this for more information.

Kalpesh Kundanani
  • 5,413
  • 4
  • 22
  • 32
1
  1. You can absolutely use the Android Studio IDE to write apps in the Dart language for both Android and iOS. I have built for both platforms with Android Studio and loaded them on iOS and Android emulators. Like Bevan Shaw said in his answer, you can checkout the flutter tutorials on the flutter.dev website to learn how to use one language to develop for both platforms at one time.

  2. You can build web applications using flutter, but it is in its infancy. I have been looking heavily into this lately. Go to this link for some web examples: https://flutter.github.io/samples/ ---> more info for flutter web apps is here: https://flutter.dev/web. Unfortunately, I have been unable to find any commercial applications that use Flutter for web.

airvine
  • 631
  • 8
  • 23
1

Yes, it is possible to use Android Studio to write web applications in flutter. I have wrote an article that will help you write web application in flutter, here is the link: https://medium.com/@zubairehman.work/flutter-for-web-c75011a41956

Do let me know if you need any help :)

Zubair Rehman
  • 2,335
  • 2
  • 20
  • 25
1

With Flutter-SDK 1.9 and Android Studio 3.4.2, web development is fully supported and you can select Google Chrome as a device (if installed) from the list and press run to run your Flutter web project on Google Chrome. no additional plugins are needed except those required for Flutter mobile development.
This is what I have tested.

Mohsen Emami
  • 2,709
  • 3
  • 33
  • 40
1

Yes, You can create and publish a Flutter web on Android Studio. You can create project with flutter create projectname command. I found a simple example to create and publish Flutter web application here.

Sunil
  • 3,211
  • 3
  • 21
  • 21
0

Update on @Kalpesh Kundanani's answer.

At point 2 you have to run flutter create [new folder name] from you flutter app's folder. Also install chrome if you haven't installed yet.

  • go to new folder, then
  • flutter run -d chrome from command line.
techniqez
  • 135
  • 1
  • 9
0

Yes, you can build (Mobile app, desktop, website) with Flutter. I had built a mobile app with Flutter using Android Studio, and now I am building website using Flutter with Android Studio.

Sana'a Al-ahdal
  • 1,684
  • 1
  • 17
  • 33
0

To open your flutter project in web from android studio, you just need to type this command in terminal of Android Studio.

flutter run -d chrome --web-renderer html

  • This does not provide an answer to the question. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](https://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/late-answers/34097251) – Esmaeil Ahmadipour Mar 30 '23 at 22:04
-1

1) Yes this is definitely possible. Android studio has a plugin for Flutter and Dart that works beautifully. You can find out how to get it working by following online tutorials step-by-step to get it set up here: https://flutter.dev/docs/get-started/editor. 2) Also as Flutter (a library that uses Dart), & Dart (the language Flutter is used with) are designed to be a hybrid language for mobile development, this means that you write one code base which is then able to be run on Android or IOS. When I was using this technology I was aware that the next step for Flutter & Dart is to add progressive websites to its capabilities so I am not sure if it is available yet so one code base can also work on desktop. 3) Sorry I am not sure about your last question!

Bevan Shaw
  • 89
  • 8
-1

1)Surely , you can use Android Studio as IDE for developing of Flutter web. I am also using this . It works good.

2)You are thinking 100% right . You don't need to write other code for web .You can use same code for Android, Ios, web ,Desktop apps ( Mac Os) others platform too.

3)Yes, You can use Flutter web for writing web applications.

Rahul Kushwaha
  • 5,473
  • 3
  • 26
  • 30