Viam Flutter SDK

build status license

Viam is a software platform for robots and smart machines. The Viam Flutter SDK allows you to build custom mobile applications to interact with your machines, from controlling individual hardware components to monitoring many machines.

Website: viam.com Documentation: docs.viam.com

(In)stability Notice

Warning This is a beta release of the Viam Flutter SDK. No guarantees are made to the stability of the API. All changes will be enumerated in the release notes.

Getting started

Make sure your project meets the minimum requirements:

  • Minimum iOS target: 13.0
  • Minimum Android SDK: 23
  • Kotlin version: 1.8.20

Installation

flutter pub add viam_sdk

Upgrading

flutter pub upgrade viam_sdk

Note that breaking changes may occur in patch version changes because the Viam Flutter SDK is still in beta. We recommend locking your project to a specific version by adding a specific version number (for example viam_sdk: 0.0.12) to your pubspec.yaml file.

Update Info.plist

If you are building for Apple platforms, you may have to update your app's Info.plist. NSLocalNetworkUsageDescription is needed to establish stable WebRTC connections, and NSBonjourServices is required to connect to local devices via mDNS.

<key>NSLocalNetworkUsageDescription</key>
<string>Viam requires access to your devices local network to connect to your devices.</string>
<key>NSBonjourServices</key>
<array>
    <string>_rpc._tcp</string>
</array>

Usage

You can use the Viam SDK to connect to an existing machine (to create a machine, see Build a simple smart machine or if you don't have your own hardware, Try Viam).

import 'package:viam_sdk/viam_sdk.dart';

// Connect to an existing machine (robot)
// *NOTE* Get '<API KEY ID>' and '<API KEY>' from
// your machine's "CONNECT" tab on app.viam.com
final options = RobotClientOptions.withAPIKey('<API KEY ID>', '<API KEY>');
final robot = await RobotClient.atAddress('<LOCATION>', options);

// Print the available resources
print(robot.resourceNames);

// Access a component
final movementSensor = MovementSensor.fromRobot(robot, 'my_sensor');
print(await movementSensor.readings())

Example apps

View sample apps in the /example directory. This tutorial walks through a version of one of these examples.

GitHub

You can view the code for the Viam Flutter SDK on GitHub.

License

Copyright 2021-2024 Viam Inc.

Apache 2.0 - See LICENSE file

Libraries

widgets
widgets/button
widgets/camera_stream
widgets/joystick
widgets/multi_camera_stream
widgets/refreshable_data_table
widgets/resources/arm
widgets/resources/base
widgets/resources/board
widgets/resources/gripper
widgets/resources/motor
widgets/resources/sensor
widgets/resources/servo

Common

Classes in Viam SDK Library

protos/common/common Common
The proto definitions for common

Viam SDK

Viam SDK

viam_sdk Viam SDK
Robots at your fingertips.

Protobuf Definitions

Viam protobuf definitions

protos/app/agent Protobuf Definitions
The proto definitions for agent
protos/app/app Protobuf Definitions
The proto definitions for app
protos/app/billing Protobuf Definitions
The proto definitions for billing
protos/app/build Protobuf Definitions
The proto definitions for build
protos/app/cloud_slam Protobuf Definitions
The proto definitions for cloud_slam
protos/app/data Protobuf Definitions
The proto definitions for data
protos/app/data_sync Protobuf Definitions
The proto definitions for data_sync
protos/app/dataset Protobuf Definitions
The proto definitions for dataset
protos/app/end_user Protobuf Definitions
The proto definitions for end_user
protos/app/ml_inference Protobuf Definitions
The proto definitions for ml_inference
protos/app/ml_training Protobuf Definitions
The proto definitions for ml_training
protos/app/packages Protobuf Definitions
The proto definitions for packages
protos/app/robot Protobuf Definitions
The proto definitions for robot
protos/component/arm Protobuf Definitions
The proto definitions for arm
protos/component/audioinput Protobuf Definitions
The proto definitions for audioinput
protos/component/base Protobuf Definitions
The proto definitions for base
protos/component/board Protobuf Definitions
The proto definitions for board
protos/component/camera Protobuf Definitions
The proto definitions for camera
protos/component/encoder Protobuf Definitions
The proto definitions for encoder
protos/component/gantry Protobuf Definitions
The proto definitions for gantry
protos/component/generic Protobuf Definitions
The proto definitions for generic
protos/component/gripper Protobuf Definitions
The proto definitions for gripper
protos/component/input_controller Protobuf Definitions
The proto definitions for input_controller
protos/component/motor Protobuf Definitions
The proto definitions for motor
protos/component/movementsensor Protobuf Definitions
The proto definitions for movementsensor
protos/component/pose_tracker Protobuf Definitions
The proto definitions for pose_tracker
protos/component/powersensor Protobuf Definitions
The proto definitions for powersensor
protos/component/sensor Protobuf Definitions
The proto definitions for sensor
protos/component/servo Protobuf Definitions
The proto definitions for servo
protos/component/testecho Protobuf Definitions
The proto definitions for testecho
protos/module/module Protobuf Definitions
The proto definitions for module
protos/provisioning/provisioning Protobuf Definitions
The proto definitions for provisioning
protos/robot/robot Protobuf Definitions
The proto definitions for robot
protos/service/data_manager Protobuf Definitions
The proto definitions for data_manager
protos/service/generic Protobuf Definitions
The proto definitions for generic
protos/service/mlmodel Protobuf Definitions
The proto definitions for mlmodel
protos/service/motion Protobuf Definitions
The proto definitions for motion
protos/service/navigation Protobuf Definitions
The proto definitions for navigation
protos/service/sensors Protobuf Definitions
The proto definitions for sensors
protos/service/shell Protobuf Definitions
The proto definitions for shell
protos/service/slam Protobuf Definitions
The proto definitions for slam
protos/service/vision Protobuf Definitions
The proto definitions for vision