注意:
我們重在整合
標榜可以多系統整合,可以轉成該平台可接受的 native code。
但是 iOS 跟 android 的版本一直更新,裡面的 code 也可能會改變。而且 iOS 沒有開源,也不知道 Flutter 是不是可以調用所有 iOS 有提供的功能。
如果沒有支援,你必須要瞭解該平台的原始碼,然後手動轉換。
而且原始碼不能無痛轉成 android 或 iOS 支援的原始碼。
開左側有目錄,但是是編輯器自己分類的虛擬目錄,不完全跟實際的目錄相同。
會自動生成,不用管他
專案設定檔
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="<http://schemas.android.com/apk/res/android>"
// 這裡是原始的宣告點
xmlns:tools="<http://schemas.android.com/tools>">
<application
android:allowBackup="true"
android:dataExtractionRules="@xml/data_extraction_rules"
android:fullBackupContent="@xml/backup_rules"
android:icon="@mipmap/ic_launcher"
// 控制啟動圖示
android:label="@string/app_name"
// 控制啟動文字,這裡可以控制多語言顯示
// 這裡的 string 並不是 strings 的檔案,是因為 Strings 檔案裡放的都是 string 標籤
android:roundIcon="@mipmap/ic_launcher_round"
// 為了因應新版系統,所以加入圓的 icon 屬性
android:supportsRtl="true"
android:theme="@style/Theme.I18nDemo"
tools:targetApi="31">
<activity
// 現在的首頁,而且要在這裡「宣告」
android:name=".MainActivity" // 程式的名字
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" /> // 這是首頁,後面加設定 MAIN
<category android:name="android.intent.category.LAUNCHER" /> // 這是為了方便開發用。沒加的話,雖然開始模擬,但是不會自動啟動。還好這個功能只會發生在開發階段,就算有這行,使用者不會自動啟動
</intent-filter>
<meta-data
android:name="android.app.lib_name"
android:value="" />
</activity>
</application>
</manifest>
程式碼支援項目