flutter

2022/4/19 6:14:32

本文主要是介绍flutter,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

一、安装Flutter

1、官网下载

2、添加flutter相关工具到path中

export PATH=`pwd`/flutter/bin:$PATH
 PS:   在 shell 中执行程序时,shell 会提供一组环境变量。export 可新增,修改或删除环境变量,供后续执行的程序使用。export 的效力仅限于该次登陆操作。   'pwd' 命令用于查看当前工作目录的完整路径

3、执行命令 

flutter doctor

运行以下命令查看是否需要安装其它依赖项来完成安装:

4、永久更新环境此变量,以便可以运行flutter命令在任何终端会话中。(步骤2的进阶) 《1》进入路径/Users/mac 《2》修改隐藏文件.bash_profile 前两条是设置国内镜像站点(提高下载速度),第三条是
export PUB_HOSTED_URL=https://pub.flutter-io.cn  // 国内用户需要设置
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn  // 国内用户需要设置
export PATH=/Users/mac/Documents/Flutter/flutter/bin:$PATH  // /Users/mac/Documents/Flutter是我的flutter安装包路径

二、使用

运行flutter doctor

Checking Android licenses is taking an unexpectedly long time...⣟ideviceinstaller not found. To work with iOS devices, please install
ideviceinstaller. To install, run:
brew install ideviceinstaller.
[!] Android toolchain - develop for Android devices (Android SDK version 27.0.3)
    ✗ Flutter requires Android SDK 28 and the Android BuildTools 28.0.3
      To update using sdkmanager, run:
        "/Users/mac/Library/Android/sdk/tools/bin/sdkmanager"
        "platforms;android-28" "build-tools;28.0.3"
      or visit https://flutter.dev/setup/#android-setup for detailed
      instructions.
    ! Some Android licenses not accepted.  To resolve this, run: flutter doctor
      --android-licenses
[!] Xcode - develop for iOS and macOS (Xcode 10.3)
    ! CocoaPods out of date (1.6.0 is recommended).
        CocoaPods is used to retrieve the iOS and macOS platform side's plugin
        code that responds to your plugin usage on the Dart side.
        Without CocoaPods, plugins will not work on iOS or macOS.
        For more info, see https://flutter.dev/platform-plugins
      To upgrade:
        brew upgrade cocoapods
        pod setup
[!] iOS tools - develop for iOS devices
    ✗ Verify that all connected devices have been paired with this computer in
      Xcode.
      If all devices have been paired, libimobiledevice and ideviceinstaller may
      require updating.
      To update with Brew, run:
        brew update
        brew uninstall --ignore-dependencies libimobiledevice
        brew uninstall --ignore-dependencies usbmuxd
        brew install --HEAD usbmuxd
        brew unlink usbmuxd
        brew link usbmuxd
        brew install --HEAD libimobiledevice
        brew install ideviceinstaller
    ✗ ios-deploy not installed. To install:
        brew install ios-deploy
[!] Android Studio (version 3.1)
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
[!] IntelliJ IDEA Ultimate Edition (version 2018.1.6)
    ✗ Flutter plugin not installed; this adds Flutter specific functionality.
    ✗ Dart plugin not installed; this adds Dart specific functionality.
[✓] Connected device (2 available)

 



这篇关于flutter的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程