Rashedul Hasan
Rashedul Hasan

Reputation: 155

Is it possible to use Android Studio to build a website in flutter

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?

Upvotes: 12

Views: 14909

Answers (10)

Himanshu
Himanshu

Reputation: 1

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

Upvotes: 0

Kalpesh Kundanani
Kalpesh Kundanani

Reputation: 5763

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.

Upvotes: 8

Sana'a Al-ahdal
Sana'a Al-ahdal

Reputation: 1780

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.

Upvotes: 0

Sunil
Sunil

Reputation: 3494

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.

Upvotes: 1

techniqez
techniqez

Reputation: 135

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.

Upvotes: 0

Mohsen Emami
Mohsen Emami

Reputation: 3142

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.

Upvotes: 1

ja2375
ja2375

Reputation: 231

  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!

Upvotes: 8

Zubair Rehman
Zubair Rehman

Reputation: 2545

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 :)

Upvotes: 1

airvine
airvine

Reputation: 731

  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.

Upvotes: 1

Bevan Shaw
Bevan Shaw

Reputation: 79

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!

Upvotes: -1

Related Questions