简体   繁体   中英

Is it possible to write a Dart program that runs on mobile or web browser by creating its code on Replit?

I'm fairly new to programming, been these last few days watching a few dozens of hours of courses in Dart programming language and coding along on Repl.it through the exercises and tutorials. I'd like to know if any of you have used Replit to not just practice coding but actually create mobile and web applications using Dart or other languages, well I'm sure it's possible for other languages (such as HTML, CSS, C#, JavaScript, and Python), but I haven't really seen any written in Dart. Please, I'm learning Dart to be able to develop applications on Replit, so I'd like to have some feedback on that from veteran devs.

Repl.it is a great tool to start coding without having to setup all development tools on your computer first. I personally haven't used repl.it much before, but from what I can tell it seems to be sufficient to implement simple command line applications in Dart. However, in my opinion repl.it is not suited for web or mobile development in Dart. The following are the reasons why I think so.

  • If you want to build larger applications you will have to use third party code at some point. In Dart packages are used for that purpose. Usually the pub command-line tool is used to manage Dart packages. Repl.it has a graphical user interface for managing packages, however, in my test, its search function didn't seem to work very well. Luckily, the pub tool is available in the Console tab. So it is still possible to install packages.

  • The Dart programming language is constantly evolving. The current version of the language is 2.15 but repl.it supports only version 2.6 at the moment. Therefore, you would miss out on a lot of new language features such as null safety which was introduced in 2.12 for example.

  • Due to the old Dart version, I was not able to get the web development tools to work on repl.it since the build_runner executables failed to compile. If you were able to setup webdev , I guess that you could do web programming, though.

  • To do mobile development, the Flutter framework is used in Dart. However, Flutter does not seem to be supported by repl.it. Even if it was supported, you would need to install Flutter locally to test your apps on a real smartphone anyway. There are other tools such as DartPad that allow you to sketch Flutter applications online. But DartPad does not aim to be a full IDE.

In summary, I think that it is great that you want to learn Dart and I encourage you to use repl.it or similar products if they help you to get into programming. However, if you want to do more advanced programming or work with features introduced in more recent versions of Dart you will probably not get around installing the Dart or Flutter SDK on your computer.

Instead of using Dart by itself, please consider using Flutter instead. Flutter is built on top of Dart and provide the ability to write mobiles app and web apps (and desktop apps) from the same source code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM