搜尋套件、儲存庫與 APP 分類

套件詳情v1.1.0

wear

一個為 Google Wear OS 提供 Flutter 支援的外掛程式

Android
近 30 天下載
3000
喜歡數
167
Pub 分數
150

安裝套件

flutter pub add wear

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

wear 套件為開發針對 Google Wear OS 的應用程式提供了 Flutter 支援,讓開發者能夠建立互動性強且反應迅速的手錶應用程式。它與 Flutter 框架無縫整合,提供對 Wear OS 特定功能的存取,例如可快速瀏覽的使用者介面、語音輸入和感測器資料。專為基於 Android 的智慧手錶設計,該套件簡化了在可穿戴裝置上建立類原生體驗的過程。此外,該外掛由 Flutter Community 維護,確保社群驅動的更新與穩健的功能。

適用情境

  • 為 Wear OS 智能手錶建構 Flutter 應用
  • 建立可快速瀏覽和快速操作的介面
  • 在手錶上整合語音和感應器輸入
  • 為安卓可穿戴設備開發配套應用
  • 在腕部設備上實現即時數據顯示

主要特色

  • 原生 Wear OS 集成
  • 支援可快速瀏覽及互動的表盤
  • 訪問語音和傳感器API
  • 與 Flutter 的跨平台相容性
  • 社群維護且文件完整

適合對象

  • 針對 Wear OS 設備的 Flutter 開發人員
  • 開發智慧手錶配套應用的團隊
  • 專注於可穿戴使用者體驗的創作者
  • 移動應用開發者擴展到可穿戴設備
  • 需要輕量級、快速加載的表盤介面的專案

使用建議

  • 需要 Android SDK 和 Wear OS 模擬器或裝置
  • 僅限 Android 平台
  • 可能需要為特定於手錶的佈局進行額外設定
  • 依賴於 Flutter 版本相容性
  • 建議主要在實體裝置或模擬器上進行測試

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

Flutter Wear Plugin

A plugin that offers Flutter support for Wear OS by Google (Android Wear).

To use this plugin you must set your minSdkVersion to 23.

Tutorial

https://medium.com/flutter-community/flutter-building-wearos-app-fedf0f06d1b4

Widgets

There currently three widgets provided by the plugin:

  • WatchShape: determines whether the watch is square or round.
  • AmbientMode: builder that provides what mode the watch is in. The widget will rebuild whenever the watch changes mode.

Example

Typically, all three of these widgets would be used near the root of your app's widget tree:

class WatchScreen extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return WatchShape(
      builder: (BuildContext context, WearShape shape, Widget? child) {
        return AmbientMode(
          builder: (context, mode, child) {
            return mode == Mode.active ? ActiveWatchFace() : AmbientWatchFace();
          },
        );
      },
    );
  }
}

Old Requirements

You DO NOT need to modify these files anymore:

You can remove all the old wearable references from the previous release. This plugin automatically adds all required references and settings.

  1. build.gradle: wearable dependencies

  2. AndroidManifest.xml: WAKE_LOCK and android.hardware.type.watch and com.google.android.wearable.standalone.

  3. MainActivity.kt or MainActivity.java: all AmbientMode references.

所屬分類

原始碼儲存庫

使用此套件的專案