如何在桌面和移动应用程序中使用Dart Flutter [英] How to use Dart Flutter for desktop and mobile applications

查看:125
本文介绍了如何在桌面和移动应用程序中使用Dart Flutter的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您能解释一下如何在普通的桌面网站上使用Dart flutter吗?

Can you explain me how to use Dart flutter with just an ordinary desktop web site?

假设我有一个网站,该网站的响应式设计很好,但是我想让它对移动用户更方便。因此,我决定使用Dart,然后创建服务器。我需要将用户重定向到f.e. m.mysite.com是基于flutter小部件构建的,但是PC用户将重定向到mysite.com吗?另外,有信息表明,自2019年6月以来,您可以编写桌面Web应用程序。是什么意思,我们以前做不到?

Let's say I have a website, which has a good responsive design, but I want to make it more handy for mobile users. So, I decide to use Dart, I create a server and then? Do I need to redirect users to f.e. m.mysite.com which is built on flutter widgets, but PC users will redirect to mysite.com? Also, there is an information that since June 2019 you can write desktop web application. What does it mean, we couldn't do that before?

推荐答案

正如@Randal Schwartz所说,Flutter Web处于早期开发阶段(我相信是alpha阶段),这意味着您不应该在生产中使用它。但是,这是使用Flutter构建网站的唯一方法。您可以在以下位置找到它:

As @Randal Schwartz noted, Flutter Web is in very early stages of development (alpha, I believe), meaning you should not roll with it in production. However, it is the only way to use Flutter to build websites. You can find it at:

  • https://flutter.dev/web
  • https://flutter.dev/docs/get-started/web
  • https://flutter.dev/docs/development/platform-integration/web

如果要在网站中使用Dart(而不是Flutter),可以尝试使用这些工具。它们比Flutter Web更为成熟,但是您将失去 Flutter功能:

If you want to use Dart (not Flutter) in a website, you can try these. They are more mature than Flutter Web, but you'll lose "Flutter" features:

  • VueDart (https://refi64.com/vuedart/)
  • AngularDart (https://angulardart.dev/)
  • React-Dart (https://github.com/cleandart/react-dart) (This one is tricky!)

这些都是Dart流行的JS框架(Vue,Angular和React)的所有端口,因此您可以将它们用于响应式网站设计。请注意,您可能必须在原始JS框架中进行一些背景研究,以填写文档。

These are all ports of popular JS frameworks (Vue, Angular, and React) to Dart, so you can use them for responsive website design. Note that you might have to do some background research in the original JS framework, to fill in documentation.

注意:以上所有工作均在Mac和Windows上完成。 Flutter Web / Dart框架不依赖于平台。

Note: All of the above work on both Mac and Windows. Flutter Web/Dart frameworks are not platform dependent.

这篇关于如何在桌面和移动应用程序中使用Dart Flutter的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆