浏览器版本低!无法浏览完整内容,建议升级或更换浏览器。
(以“{{flutter-sidebar}}<div class="wrap-time-sdk">更新时间:2020-06-23</div><div class="bluetitle"><div class="services-title-text service-page-anchor">Flutter开...”为内容创建页面)
 
第3行: 第3行:
 
<div><div class="bluetitle"><div class="services-title-text service-page-anchor">创建Flutter项目</div></div></div>
 
<div><div class="bluetitle"><div class="services-title-text service-page-anchor">创建Flutter项目</div></div></div>
 
<span style="letter-spacing:.75pt;"><span style="color:#666666;"><span style="font-size:10.5pt;">1、推荐使用</span><span style="font-family:helvetica;"><span style="font-size:10.5pt;">Android Studio</span></span></span></span><span style="letter-spacing:.75pt;"><span style="color:#666666;"><span style="font-size:10.5pt;">直接创建</span></span></span><span style="letter-spacing:.75pt;"><span style="color:#666666;"><span style="font-family:helvetica;"><span style="font-size:10.5pt;">Flutter Project</span></span><span style="font-size:10.5pt;">。<br/>2、推荐使用</span></span></span><span style="letter-spacing:.75pt;"><span style="color:#666666;"><span style="font-family:helvetica;"><span style="font-size:10.5pt;">Visual Studio Code</span></span></span></span><span style="letter-spacing:.75pt;"><span style="color:#666666;"><span style="font-size:10.5pt;">作为</span></span></span><span style="letter-spacing:.75pt;"><span style="color:#666666;"><span style="font-family:helvetica;"><span style="font-size:10.5pt;">Flutter</span></span></span></span><span style="letter-spacing:.75pt;"><span style="color:#666666;"><span style="font-size:10.5pt;">工程主要开发和调试工具,涉及到</span></span></span><span style="letter-spacing:.75pt;"><span style="color:#666666;"><span style="font-family:helvetica;"><span style="font-size:10.5pt;">Native</span></span></span></span><span style="letter-spacing:.75pt;"><span style="color:#666666;"><span style="font-size:10.5pt;">代码的调试和改动,请分别使用</span></span></span><span style="letter-spacing:.75pt;"><span style="color:#666666;"><span style="font-family:helvetica;"><span style="font-size:10.5pt;">Android Studio</span></span></span></span><span style="letter-spacing:.75pt;"><span style="color:#666666;"><span style="font-size:10.5pt;">和</span></span></span><span style="letter-spacing:.75pt;"><span style="color:#666666;"><span style="font-family:helvetica;"><span style="font-size:10.5pt;">XCode</span></span><span style="font-size:10.5pt;">做双端调试。</span><font face="helvetica">&nbsp;</font></span></span>
 
<span style="letter-spacing:.75pt;"><span style="color:#666666;"><span style="font-size:10.5pt;">1、推荐使用</span><span style="font-family:helvetica;"><span style="font-size:10.5pt;">Android Studio</span></span></span></span><span style="letter-spacing:.75pt;"><span style="color:#666666;"><span style="font-size:10.5pt;">直接创建</span></span></span><span style="letter-spacing:.75pt;"><span style="color:#666666;"><span style="font-family:helvetica;"><span style="font-size:10.5pt;">Flutter Project</span></span><span style="font-size:10.5pt;">。<br/>2、推荐使用</span></span></span><span style="letter-spacing:.75pt;"><span style="color:#666666;"><span style="font-family:helvetica;"><span style="font-size:10.5pt;">Visual Studio Code</span></span></span></span><span style="letter-spacing:.75pt;"><span style="color:#666666;"><span style="font-size:10.5pt;">作为</span></span></span><span style="letter-spacing:.75pt;"><span style="color:#666666;"><span style="font-family:helvetica;"><span style="font-size:10.5pt;">Flutter</span></span></span></span><span style="letter-spacing:.75pt;"><span style="color:#666666;"><span style="font-size:10.5pt;">工程主要开发和调试工具,涉及到</span></span></span><span style="letter-spacing:.75pt;"><span style="color:#666666;"><span style="font-family:helvetica;"><span style="font-size:10.5pt;">Native</span></span></span></span><span style="letter-spacing:.75pt;"><span style="color:#666666;"><span style="font-size:10.5pt;">代码的调试和改动,请分别使用</span></span></span><span style="letter-spacing:.75pt;"><span style="color:#666666;"><span style="font-family:helvetica;"><span style="font-size:10.5pt;">Android Studio</span></span></span></span><span style="letter-spacing:.75pt;"><span style="color:#666666;"><span style="font-size:10.5pt;">和</span></span></span><span style="letter-spacing:.75pt;"><span style="color:#666666;"><span style="font-family:helvetica;"><span style="font-size:10.5pt;">XCode</span></span><span style="font-size:10.5pt;">做双端调试。</span><font face="helvetica">&nbsp;</font></span></span>
<div><div class="bluetitle"><div class="services-title-text service-page-anchor">Flutter工程配置</div></div></div>
+
<div><div class="bluetitle"><div class="services-title-text service-page-anchor">Flutter工程配置</div></div></div> <span style="letter-spacing:.75pt;"><span style="color:#666666;"><font face="helvetica">1、Android工程配置:<br/>&nbsp; &nbsp; 需要在Android工程的local.propertiues里配置</font></span></span><br/>&nbsp; &nbsp;&nbsp;<pre class="prettyprint codestyle">flutter.sdk="本地Flutter SDK目录"</pre>
<span style="letter-spacing:.75pt;"><span style="color:#666666;"><font face="helvetica">iOS端的UiKitView目前还只是preview状态, 默认是不支持的, 需要手动打开开关, 在info.plist文件中新增一行io.flutter.embedded_views_preview为true.&nbsp;</font></span></span><br/>&nbsp;
+
<br/><span style="letter-spacing:.75pt;"><span style="color:#666666;"><font face="helvetica">2、iOS工程配置:<br/>&nbsp; &nbsp; &nbsp;1)、iOS端的UiKitView目前还只是preview状态, 默认是不支持的, 需要手动打开开关, 需要在iOS工程的info.plist添加如下配置:</font></span></span><br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<pre class="prettyprint codestyle">&lt;key&gt;io.flutter.embedded_views_preview&lt;/key&gt;
<div><div class="bluetitle"><div class="services-title-text service-page-anchor">在项目中集成百度地图Flutter插件</div></div></div>
+
&lt;string&gt;YES&lt;/string&gt;
&nbsp; &nbsp; &nbsp; 目前百度地图Flutter插件支持基础地图(flutter_bmfmap)和计算工具(flutter_bmfutils),两个都已经发布到Flutter Pub仓库<br/>需要在您Flutter项目中的yaml文件里配置对百度地图Flutter插件包的依赖,才可使用,具体如下<br/>1、基础地图依赖添加:<br/>&nbsp; &nbsp; &nbsp; dependencies:<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;flutter_bmfmap:1.0.0<br/>&nbsp;&nbsp;<br/>2、计算工具依赖添加:<br/>&nbsp; &nbsp; &nbsp; dependencies:<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;flutter_bmfutils:1.0.0<br/>&nbsp;<br/>3、Flutter 依赖拉取<br/>&nbsp; &nbsp; &nbsp;需要在当前项目位置的Terminal(终端)里使用flutter pub get拉取依赖项目,才能正常进行开发和编译。
+
</pre>
 +
&nbsp; &nbsp; &nbsp;<br/>&nbsp; &nbsp; &nbsp;&nbsp;2)、地图sdk鉴权需要配置BundleDisplayName,&nbsp;需要在<span style="letter-spacing:.75pt;"><span style="color:#666666;"><font face="helvetica">iOS工程</font></span></span>Info.plist中添加如下配置:<br/><pre class="prettyprint codestyle">&lt;key&gt;CFBundleDisplayName&lt;/key&gt;
 +
&lt;string&gt;app名称&lt;/string&gt;</pre>
 +
&nbsp; &nbsp; &nbsp;<br/>&nbsp; &nbsp; &nbsp; 3)、个性化地图需要配置 NSAppTransportSecurity , 需要在iOS工程的info.plist中添加:<br/><pre class="prettyprint codestyle"> &lt;key&gt;NSAppTransportSecurity&lt;/key&gt;  
 +
    &lt;dict&gt;
 +
      &lt;key&gt;NSAllowsArbitraryLoads&lt;/key&gt;
 +
      &lt;true/&gt; &nbsp;&nbsp; &nbsp;
 +
&nbsp;  &lt;/dict&gt;</pre>
 +
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br/>&nbsp; &nbsp; &nbsp; 4)、使用计算工具组件调起百度地图客户端时,需要参考如下配置:<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;[https://lbsyun.baidu.com/index.php?title=iossdk/guide/tool/launchmap https://lbsyun.baidu.com/index.php?title=iossdk/guide/tool/launchmap]<br/><div><div class="bluetitle"><div class="services-title-text service-page-anchor">在项目中集成百度地图Flutter插件</div></div></div>
 +
&nbsp; &nbsp; &nbsp; 目前百度地图Flutter插件支持基础地图(flutter_bmfmap)和计算工具(flutter_bmfutils),两个都已经发布到Flutter Pub仓库。<br/>&nbsp; &nbsp; &nbsp; 需要在您Flutter项目中的yaml文件里配置对百度地图Flutter插件包的依赖,才可使用,具体如下:<br/>1、基础地图依赖添加:<br/>&nbsp; &nbsp; &nbsp; dependencies:<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;flutter_bmfmap:&nbsp; ^1.0.1<br/>&nbsp;&nbsp;<br/>2、计算工具依赖添加:<br/>&nbsp; &nbsp; &nbsp; dependencies:<br/>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;flutter_bmfutils: ^1.0.1<br/>&nbsp;<br/>3、Flutter 依赖拉取<br/>&nbsp; &nbsp; &nbsp;需要在当前项目位置的Terminal(终端)里使用flutter pub get拉取依赖项目,才能正常进行开发和编译。

2020年7月29日 (三) 06:23的版本

更新时间:2020-06-23
Flutter开发环境配置

 请参考Flutter官方网站(https://flutter.dev/),或者Flutter中文网(https://flutterchina.club/

创建Flutter项目

1、推荐使用Android Studio直接创建Flutter Project
2、推荐使用
Visual Studio Code作为Flutter工程主要开发和调试工具,涉及到Native代码的调试和改动,请分别使用Android StudioXCode做双端调试。 

Flutter工程配置
1、Android工程配置:
    需要在Android工程的local.propertiues里配置

    
flutter.sdk="本地Flutter SDK目录"

2、iOS工程配置:
     1)、iOS端的UiKitView目前还只是preview状态, 默认是不支持的, 需要手动打开开关, 需要在iOS工程的info.plist添加如下配置:

           
<key>io.flutter.embedded_views_preview</key>
<string>YES</string>
     
      2)、地图sdk鉴权需要配置BundleDisplayName, 需要在iOS工程Info.plist中添加如下配置:
<key>CFBundleDisplayName</key>
<string>app名称</string>
     
      3)、个性化地图需要配置 NSAppTransportSecurity , 需要在iOS工程的info.plist中添加:
 <key>NSAppTransportSecurity</key> 
    <dict>
       <key>NSAllowsArbitraryLoads</key>
       <true/>     
    </dict>
                     
      4)、使用计算工具组件调起百度地图客户端时,需要参考如下配置:
             https://lbsyun.baidu.com/index.php?title=iossdk/guide/tool/launchmap
在项目中集成百度地图Flutter插件

      目前百度地图Flutter插件支持基础地图(flutter_bmfmap)和计算工具(flutter_bmfutils),两个都已经发布到Flutter Pub仓库。
      需要在您Flutter项目中的yaml文件里配置对百度地图Flutter插件包的依赖,才可使用,具体如下:
1、基础地图依赖添加:
      dependencies:
             flutter_bmfmap:  ^1.0.1
  
2、计算工具依赖添加:
      dependencies:
             flutter_bmfutils: ^1.0.1
 
3、Flutter 依赖拉取
     需要在当前项目位置的Terminal(终端)里使用flutter pub get拉取依赖项目,才能正常进行开发和编译。

  • 文档根本没法用

  • 文档水平很差

  • 文档水平一般

  • 文档不错

  • 文档写的很好

如发现文档错误,或对此文档有更好的建议,请在下方反馈。问题咨询请前往反馈平台提交工单咨询。

提交反馈

拖动标注工具

添加矩形标注

添加箭头标注

完成

取消