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

10

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?

Kampmeier answered 27/5, 2019 at 22:6 Comment(0)
H
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!

Holbrook answered 10/8, 2019 at 15:59 Comment(0)
P
8

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.

Preacher answered 13/12, 2019 at 17:18 Comment(0)
T
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.

That answered 28/5, 2019 at 3:44 Comment(1)
Note that he is asking about flutter webMorville
S
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 :)

Stainless answered 10/8, 2019 at 15:5 Comment(0)
R
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.

Rainwater answered 15/10, 2019 at 16:37 Comment(0)
C
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.

Callaghan answered 10/3, 2020 at 5:18 Comment(0)
S
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.
Sheathing answered 6/2, 2020 at 14:50 Comment(0)
L
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.

Load answered 9/12, 2020 at 8:11 Comment(0)
S
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

Surrogate answered 24/3, 2023 at 10:42 Comment(1)
This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From ReviewSpitsbergen
Y
-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!

Younker answered 27/5, 2019 at 22:52 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.