Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 521
Rashedul Hasan Avatar asked May 27 '19 22:05

Rashedul Hasan


3 Answers

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.

like image 181
Kalpesh Kundanani Avatar answered Oct 10 '22 18:10

Kalpesh Kundanani


  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!

like image 23
ja2375 Avatar answered Oct 10 '22 16:10

ja2375


  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.

like image 1
airvine Avatar answered Oct 10 '22 18:10

airvine