google_matter_flutter 0.0.1 copy "google_matter_flutter: ^0.0.1" to clipboard
google_matter_flutter: ^0.0.1 copied to clipboard

PlatformAndroid

Flutter plugin for getting implementing Google's Matter SDKs on Android

google_matter_flutter #

pub package

Flutter plugin for getting implementing Google's Matter SDKs on Android Supports only Android for now.

Google Matter Flutter mobile app demo

Available features: #

  • Commission a Matter device.
  • Get device events (Boolean only).

Unavailable features: #

  • Get events other than Boolean.
  • Have ability to send commands to the device.
  • Set the device type during registration.

Please note that this plugin is still under development, and many APIs are not be available yet. The library is also unstable and crashed when unhandled devices are commissioned. If you can help with any of the above, please feel free to contribute to the project.

Usage #

  1. To use this plugin, add google_matter_flutter as a dependency in your pubspec.yaml file.
  2. Then, download the sample-app-for-matter-android-codelab.zip from here.
  3. Once downloaded, extract this zip, and navigate to sample-app-for-matter-android-codelab/app.
  4. You will find a folter "third_party" here. Copy and paste this folder in the android directory of your project.
  5. Add the following in your AndroidManifest.xml:

Inside Activity tag:

<intent-filter>
    <action android:name="android.intent.action.MAIN" />
    <category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
    <action android:name="com.google.android.gms.home.matter.ACTION_COMMISSION_DEVICE" />
    <category android:name="android.intent.category.DEFAULT" />
</intent-filter>

Inside Application tag:

<service
    android:name="com.google.google_matter_flutter.google_matter_flutter.AppCommissioningService"
    android:exported="true" />

Example #

final GoogleMatterFlutter _googleMatterFlutterPlugin = GoogleMatterFlutter();

// Commission a Matter device
final MatterDevice? device = await _googleMatterFlutterPlugin.commissionDevice();

// Get device events
if (device != null) {
    device.listenToEvents().listen((event) {
        print(event);
    });
}
8
likes
120
pub points
23%
popularity

Publisher

verified publisherpraharshbhatt.com

Flutter plugin for getting implementing Google's Matter SDKs on Android

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter, plugin_platform_interface, shared_preferences

More

Packages that depend on google_matter_flutter