flutter_kin_sdk 0.2.1

flutter_kin_sdk #

A flutter Kin SDK plugin to create, import accounts and transferring Kin.

Unofficial Kin SDK plugin written in Dart for Flutter.

Usage #

To use this plugin, add flutter_kin_sdk as a dependency in your pubspec.yaml file.

dependencies:
  flutter_kin_sdk: '^0.2.1'

Initializing #

import 'package:flutter_kin_sdk/flutter_kin_sdk.dart';

FlutterKinSdk.infoStream.stream.listen((data) async {
    streamReceiver(data);
}, onError: (error){
    throw PlatformException(code: error.code, message: error.type, details: error.message);
});

FlutterKinSdk.balanceStream.stream.listen((BalanceReport balanceReport) async {
    if (balanceReport.publicAddress == firstPublicAddress) {
        print(balanceReport.amount);
    }
});

//Insert your appId
FlutterKinSdk.initKinClient("some");

Some methods inserted in reciever #

String firstPublicAddress;
String secondPublicAddress;
String recoveryString;
int count = 0;

void streamReceiver(Info info) async {
    switch (info.type) {
      case FlutterKinSDKConstans.INIT_KIN_CLIENT:
        print(info.message);
        firstPublicAddress = await FlutterKinSdk.createAccount();
        secondPublicAddress = await FlutterKinSdk.createAccount();
        break;
      case FlutterKinSDKConstans.CREATE_ACCOUNT_ON_PLAYGROUND_BLOCKCHAIN:
        print(info.type + " Wallet: " + info.value);
        count++;
        if (count > 1){
          FlutterKinSdk.sendTransaction(firstPublicAddress, secondPublicAddress, 10, "some", 1000);
        }
        break;
      case FlutterKinSDKConstans.DELETE_ACCOUNT:
        print(info.message);
        break;
      case FlutterKinSDKConstans.SEND_TRANSACTION:
        print(info.message + " Amount: " + info.value);
        FlutterKinSdk.fund(firstPublicAddress, 30);
        break;
      case FlutterKinSDKConstans.SEND_WHITELIST_TRANSACTION:
        print(info.message + " Amount: " + info.value);
        break;
      case FlutterKinSDKConstans.PAYMENT_EVENT:
        print(info.message + " Amount: " + info.value);
        print(await FlutterKinSdk.getAccountBalance(firstPublicAddress));
        print(await FlutterKinSdk.getAccountBalance(secondPublicAddress));
        break;
      case FlutterKinSDKConstans.FUND:
        print(info.message + " Amount: " + info.value);
        print(await FlutterKinSdk.getAccountBalance(firstPublicAddress));
        break;
    }
  }

Installation #

iOS #

<key>NSAppTransportSecurity</key>
    <dict>
        <key>NSAllowsArbitraryLoads</key>
        <true/>
        <key>NSExceptionDomains</key>
        <dict>
            <key>yourdomain.com</key>
            <dict>
                <key>NSIncludesSubdomains</key>
                <true/>
                <key>NSThirdPartyExceptionRequiresForwardSecrecy</key>
                <false/>
            </dict>
       </dict>
  </dict>

0.0.1 #

  • Init with all functional for Android and IOS

0.1.1 #

  • Opportunity to choose between playground and production mode

0.1.2 #

  • Returning amount of earn in Info json

0.1.3 #

  • iOS migration methods

0.2.0 #

New Kin SDK (Playground mode)

  • Base methods (init, createAccount, importAccount etc.)
  • Transfer Kin (Android only)
  • New stream approach returning data
  • Constants refactoring

0.2.1 #

  • Transfer Kin (Playground: Android and iOS)
  • Fund Kin (Playground: Android and iOS)
  • Update Android Kin SDK to 1.0.3.1

example/README.md

flutter_kin_sdk_example #

Demonstrates how to use the flutter_kin_sdk plugin.

Getting Started #

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  flutter_kin_sdk: ^0.2.1

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:flutter_kin_sdk/flutter_kin_sdk.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
37
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
68
Learn more about scoring.

We analyzed this package on Jul 17, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.4.0
  • pana: 0.12.19
  • Flutter: 1.7.8+hotfix.3

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Health issues and suggestions

Document public APIs. (-1 points)

65 out of 65 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Format lib/flutter_kin_sdk.dart.

Run flutter format to format lib/flutter_kin_sdk.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11
meta 1.1.6 1.1.7
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8

Admin