本项目包括:
- 各种基本控件使用(Text、TextField、Icon、Image、ListView、GridView、Picker、Stepper、Dialog、Slider、Row、Appbar、SizeBox、BottomSheet、Chip、Dismissible、FlutterLogo、Check、Switch、TabBar、BottomNavigationBar、Sliver等)
- 自定义控件及使用
- 各种UI (豆瓣电影、tubi TV、追书神器、好奇心日报、每日一文、和天气、百姓生活、随机诗词、联系人、句子迷、朋友圈、有道精品课、高德地图应用demo等)
运行环境
[✓] Flutter (Channel beta, v1.10.7, on Mac OS X 10.14.5 18F132, locale zh-Hans-CN)
• Flutter version 1.10.7 at /Users/14cells/Android/flutter
• Framework revision e70236e36c (3 weeks ago), 2019-10-02 09:32:30 -0700
• Engine revision 9e6314d348
• Dart version 2.6.0 (build 2.6.0-dev.0.0 1103600280)
[✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
• Android SDK at /Users/14cells/Android/SDK
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-29, build-tools 29.0.2
• Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
• All Android licenses accepted.
[✗] Xcode - develop for iOS and macOS
✗ Xcode installation is incomplete; a full installation is necessary for iOS development.
Download at: https://developer.apple.com/xcode/download/
Or install Xcode via the App Store.
Once installed, run:
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
✗ CocoaPods not installed.
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 install:
sudo gem install cocoapods
[✓] Android Studio (version 3.5)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin version 40.2.2
• Dart plugin version 191.8593
• Java version OpenJDK Runtime Environment (build 1.8.0_202-release-1483-b49-5587405)
[✓] Connected device (1 available)
• MI 5X • 1c7664100104 • android-arm64 • Android 8.1.0 (API 27)
注意事项
- 高德定位ios设备的apikey没有配置,使用ios设备的朋友们可以自己去高德地图申请apikey,ios具体配置见高德地图flutter插件配置。
- 音乐🎵播放器Music Player暂不支持ios设备,详情请见插件Flute-Music-Player。
- Multi Image Picker 插件 ios 配置见Multi Image Picker 使用
- 项目中某些接口为http url,Android 9.0/P和iOS禁止从非https网址加载,故需更改 App 的网络安全配置以允许此类连接
Android
在 res 下新增一个 xml 目录,创建network_security_config.xml文件
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<base-config cleartextTrafficPermitted="true" />
</network-security-config>
在AndroidManifest.xml文件下的application标签增加以下属性
<application
android:networkSecurityConfig="@xml/network_security_config"
/>
iOS
在Info.plist下编辑
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSAllowsArbitraryLoadsInWebContent</key>
<true/>
</dict>