flutter入门_Flutter入门安装指南

flutter入门

Flutter is a mobile SDK meant for designing high-performance and high-fidelity mobile apps for iOS and Android using a single codebase.

Flutter是一个移动SDK,旨在使用单个代码库为iOS和Android设计高性能和高保真移动应用。

Technically, Flutter is an open-source UI software development kit created by Google. It’s used to develop applications for Android, iOS, the web, etc. Flutter apps can be written in the Dart programming language.

从技术上讲,Flutter是Google创建的开源UI软件开发套件。 它用于开发Android,iOS,Web等应用程序。Flutter应用程序可以用Dart编程语言编写。

Dart is a client-optimized language for fast apps on any platform. It‘s optimized for UI, fast on all platforms, and includes productive development.

Dart是针对任何平台上的快速应用程序的客户端优化语言。 它针对UI进行了优化,可在所有平台上快速运行,并且包括高效的开发。

Dart shares features with many other languages, like Kotlin and Swift. It can be easily transpiled into JavaScript code. As Flutter allows for a reactive and declarative style of programming, it resembles React Native. There is no need to use a bridge in Flutter to improve overall performance and startup time.

Dart与许多其他语言(例如Kotlin和Swift)共享功能。 它可以轻松地转换为JavaScript代码。 因为Flutter允许React式和声明式的编程风格,所以它类似于React Native。 无需在Flutter中使用桥接器来改善整体性能和启动时间。

By using Dart, it will automatically achieve Ahead-of-Time compilation (AOT).

通过使用Dart,它将自动实现提前时间编译(AOT)。

入门 (Getting Started)

First, download Flutter SDK and set the path on .zprofile.

首先, 下载Flutter SDK并在.zprofile上设置路径。

Here we go. Just follow the commands in terminal.

开始了。 只需按照终端中的命令进行操作即可。

Image for post

In my case, I have installed Xcode, Android Studio, and Visual Studio Code.

就我而言,我已经安装了Xcode,Android Studio和Visual Studio Code。

So when you hit ‘enter’ after typing “flutter doctor,” it shows you:

因此,当您在输入“ flutter doctor ”后按下“ enter”时它会向您显示:

Image for post

If you have not installed Xcode, Android Studio, and Visual Studio Code, follow these steps.

如果尚未安装Xcode,Android Studio和Visual Studio Code,请按照以下步骤操作。

Step 1

第1步

Install Xcode from the App Store. That’s it.

从App Store安装Xcode。 而已。

Step 2

第2步

Download Android Studio and install the Flutter and Dart plugins.

下载Android Studio并安装Flutter和Dart插件。

To install these:

要安装这些:

  1. Start Android Studio.

    启动Android Studio。
  2. Open plugin preferences (Preferences > Plugins on macOS, File > Settings > Plugins on Windows and Linux).

    打开插件首选项(在macOS上为首选项>插件,在Windows和Linux上为文件>设置>插件)。
  3. Select Marketplace, select the Flutter and Dart plugins, and click Install.

    选择市场,选择Flutter和Dart插件,然后单击安装。
  4. Click Yes when prompted to install the Dart plugin and restart.

    当提示您安装Dart插件并重新启动时,单击“是”。
Image for post

Then, you have to configure the paths for Android Studio and Android SDK. Open terminal:

然后,您必须配置Android Studio和Android SDK的路径。 打开终端:

flutter config --android-studio-dir /Applications/Android\Studio.app
flutter config --android-sdk ~/Library/Android/sdk

All done for Android.

所有操作均已在Android中完成。

Step 3

第三步

Install Visual Studio Code and install the Flutter and Dart plugins.

安装Visual Studio Code并安装Flutter和Dart插件。

  1. Start VS Code and Invoke View > Command Palette.

    启动“ VS代码”,然后调用“视图”>“命令面板”。
  2. Type “install” and select Extensions: Install Extensions.

    键入“安装”,然后选择扩展:安装扩展。
  3. Type “flutter” in the extensions search field, select Flutter from the list, and click Install. This also installs the required Dart plugin.

    在扩展名搜索字段中键入“ flutter”,从列表中选择Flutter,然后单击“安装”。 这还将安装所需的Dart插件。
Image for post

All set. Now go to terminal and type “flutter doctor.”

可以了,好了。 现在转到终端并输入“ flutter doctor”

Image for post

For connected devices, you have to connect a physical device (iOS/Android) through a USB cable and enable developer options in Android. Or you can use an emulator or simulator.

对于已连接的设备,您必须通过USB电缆连接物理设备(iOS / Android),并在Android中启用开发人员选项。 或者,您可以使用仿真器或模拟器。

Let’s discuss basic Flutter commands in an upcoming piece. Cheers!

让我们在下一篇文章中讨论Flutter的基本命令。 干杯!

翻译自: https://medium.com/better-programming/getting-started-with-flutter-an-installation-guide-5678616f8d76

flutter入门

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值