Skip to content

oliwave/Hitchhike

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

311 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hitchhike

事前準備

所有 Google 的服務都會經過手機內的 Google Play Services 來傳輸資料。我們可以從下圖得知應用程式是只要使用到 Google 的服務都會透過 IPC 與 Google Play Services 做溝通的(認證、取得資訊...)

因此記得在 Android studio 中安裝 Google Play services 不然是無法取得地圖的任何資訊喔!!!

Android 環境設置

設定 google mapAPI keyAndroidManifest.xml 檔案中

在該路徑底下 android/app/src/main/AndroidManifest.xml

<manifest ...
  <application ...
    <meta-data android:name="com.google.android.geo.API_KEY"
               android:value="YOUR KEY HERE"/>

iOS 環境設置

Step 1

在 cmd 建立 Flutter 專案時把預設 iOS 開發語言設定成 swift

flutter create -i swift <專案名字>

Step 2

設定 google mapAPI keyAppdelegate.swift 檔案中

在該路徑底下 ios/Runner/AppDelegate.swift

import UIKit
import Flutter
import GoogleMaps

@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
  override func application(
    _ application: UIApplication,
    didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?
  ) -> Bool {
    GMSServices.provideAPIKey("YOUR KEY HERE")
    GeneratedPluginRegistrant.register(with: self)
    return super.application(application, didFinishLaunchingWithOptions: launchOptions)
  }
}

Step 3

確保 iOS 裝置可以支援地圖渲染還需要加入以下設定在該檔案中

在該路徑底下ios/Runner/Info.plist

<key>io.flutter.embedded_views_preview</key>
<true/>

架構圖

  • 前端狀態管理架構圖

  • 系統架構圖

介面

drawing drawing drawing drawing drawing drawing drawing drawing drawing drawing drawing drawing drawing drawing

Releases

No releases published

Packages

 
 
 

Contributors