motor_flutter 0.2.1 copy "motor_flutter: ^0.2.1" to clipboard
motor_flutter: ^0.2.1 copied to clipboard

The Sonr Motor Plugin for Flutter

motor_flutter #

Flutter bindings for the Sonr Motor Node.

Installation #

Integrating into your existing Flutter project

flutter pub add motor_flutter

or

dependencies:
  motor_flutter: ^0.2.1

iOS

Add the following to your Podfile:

platform :ios, '13.0'

Then remove this line from your Podfile:

use_frameworks!

Usage #

Here is a simple example of using the Motor class to control a motor.

import 'package:motor_flutter/motor_flutter.dart';

// Initialize the Sonr Motor Node
final instance = await MotorFlutter();

// Create a new account
instance.createAccount("secure-password-123", _handleResponse);

// Helper function to handle response
void _handleResponse(CreateAccountResponse? resp) {
  if (resp != null) {
    // Login to an existing account
    final authInfo = resp.authInfo;
    instance.login(authInfo, (response) {
      print(response);
    });
  }
}

API Reference #

These methods are subject to change, as the library is being actively developed. For extended documentation, learn more at the Sonr docs.

Contributing #

See the contributing guide to learn how to contribute to the repository and the development workflow.

License #

MIT