Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOCS-2382: Update readme #222

Merged
merged 5 commits into from
Jun 7, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 21 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
# Viam Flutter SDK

Build and connect to robots with Flutter

![build status](https://img.shields.io/github/actions/workflow/status/viamrobotics/viam-flutter-sdk/test.yaml?branch=main)
[![license](https://img.shields.io/badge/license-Apache_2.0-blue)](https://github.com/viamrobotics/viam-flutter-sdk/blob/main/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](https://www.viam.com)
**Documentation:** [docs.viam.com](https://docs.viam.com)

## (In)stability Notice

> **Warning**
Expand All @@ -22,6 +26,13 @@ Make sure your project meets the minimum requirements:

`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.
Expand All @@ -37,13 +48,14 @@ If you are building for Apple platforms, you may have to update your app's `Info

## Usage

You can use the Viam SDK to connect to an existing robot (to create a robot, view the [documentation](https://docs.viam.com/) or [try Viam](https://docs.viam.com/try-viam/)).
You can use the Viam SDK to connect to an existing machine (to create a machine, see [Build a simple smart machine](https://docs.viam.com/use-cases/configure/) or if you don't have your own hardware, [Try Viam](https://docs.viam.com/try-viam/)).

```dart
import 'package:viam_sdk/viam_sdk.dart';

// Connect to an existing robot
// *NOTE* Get '<API KEY ID>' and '<API KEY>' from app.viam.com
// 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);

Expand All @@ -55,16 +67,17 @@ final movementSensor = MovementSensor.fromRobot(robot, 'my_sensor');
print(await movementSensor.readings())
```

## Example app
## Example apps

View the sample app in the [`/example`](https://github.com/viamrobotics/viam-flutter-sdk/blob/main/example/) directory to see a more in-depth example.
View sample apps in the [`/example`](https://github.com/viamrobotics/viam-flutter-sdk/blob/main/example/) directory.
[This tutorial](https://docs.viam.com/tutorials/control/flutter-app/) walks through a version of one of these examples.

## GitHub

You can view the code for the Viam Flutter SDK on [GitHub](https://github.com/viamrobotics/viam-flutter-sdk).

## License

Copyright 2021-2023 Viam Inc.
Copyright 2021-2024 Viam Inc.

Apache 2.0 - See [LICENSE](https://github.com/viamrobotics/viam-python-sdk/blob/main/LICENSE) file