Flutter-环境搭建篇

develop the flutter app on android & ios

Posted by Egbert on September 10, 2019

Flutter

Flutter is Google’s UI toolkit for building beautiful, natively compiled applications for mobile, web, and desktop from a single codebase.

Reference

https://flutter.dev
Flutter official home page

https://flutterchina.club/
Flutter Chinese Site
https://www.youtube.com/flutterdev
Flutter learning videos
https://github.com/flutter
Flutter official examples
https://medium.com/aviabird/top-10-open-source-flutter-apps-997afff4f1b8
Flutter open source demo app
https://api.flutter.dev/index.html
Flutter SDK library index
https://flutter.dev/docs/reference/widgets
Flutter wiki homepage
https://tech.meituan.com/2018/08/09/waimai-flutter-practice.html
Good article for introduce Flutter
https://www.infoq.cn/article/xianyu-cross-platform-based-on-flutter Practice summary of xianyu APP


install SDK

Google provides the flutter SDK for mac,windows,linux. https://flutter.dev/docs/get-started/install/macos

  • download sdk.
  • configuare the $PATH for flutter sdk.
  • run the flutter command to try it.

install IDE

if you use vim, please ignore it.

  • Xcode
  • Visual Studio
  • Android studio (recommanded)

Android studio provide a series of plugins to run android and ios devices.

install simulator

if you want to develop and run it in real devices, you can ignore it .

  • Android simulator, you can install by Android SDK (inside the Android Studio)
  • IOS simulator, you must install Xcode, you can install it in APP store, must above the 9.0 version

install Flutter and Dart plugins

Android studio(Recommended)

  • Start Android Studio.
  • Open plugin preferences (Preferences > Plugins on macOS, File > Settings > Plugins on Windows & Linux).
  • Select Browse repositories, select the Flutter plugin and click Install.
  • Click Yes when prompted to install the Dart plugin.
  • Click Restart when prompted.

Visual Studio

  • Start VS Code.
  • Invoke View > Command Palette….
  • Type “install”, and select Extensions: Install Extensions.
  • Type “flutter” in the extensions search field, select Flutter in the list, and click Install. This also installs the required Dart plugin.

run app in simulator or devices

the method same with the native dev.

Android
  • start AVD in Android Studio
  • build and install it
IOS
  • command line input it open a simulator,replease my_app to your project path
1
2
3
open -a Simulator
cd my_app
flutter run
  • or use android studio to run it directly

develop and debug

  • use Dart language to dev
  • use hotload feature to build some changes
  • use some tools to monitor some performance

finally

welcome the into the fluteer world ! more and more details about flutter in the next chapter !