/polygonid-flutter-sdk

Flutter Plugin to use the Polygon ID SDK

Primary LanguageDartOtherNOASSERTION

polygonid_flutter_sdk

pub package build license

Description

This is a flutter Plugin for PolygonID Mobile SDK (https://polygon.technology/polygon-id) This plugin provides a cross-platform tool (iOS, Android) to communicate with the PolygonID platform.

Installation

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

dependencies:
  polygonid_flutter_sdk: ^x.y.z

This will get you the latest version.

If you want to test a specific branch of the repository, pull polygonid_flutter_sdk like this

dependencies:
  polygonid_flutter_sdk:
      git:
        url: ssh://git@github.com/iden3/polygonid-flutter-sdk.git
        ref: branchPathName

Env variables

Required:

NETWORK_NAME - Blockchain name.
NETWORK_ENV - Network name.
INFURA_URL - Infura base url.
INFURA_RDP_URL - Infura base rdp url.
INFURA_API_KEY - Infura api key.
ID_STATE_CONTRACT_ADDR - Identity state smart contract address.

Not required:

PUSH_URL - Polygon push gateway server base url.

Deploy and check

Deploy

  1. Clone this repository.
  2. Generate .env and .env.dev files in the root folder of the project.
  3. Add required env variables (example):
     NETWORK_NAME="polygon"
     NETWORK_ENV="mumbai"
     INFURA_URL="https://polygon-mumbai.infura.io/v3/"
     INFURA_RDP_URL="wss://polygon-mumbai.infura.io/v3/"
     INFURA_API_KEY="secret"
     ID_STATE_CONTRACT_ADDR="sc_address"
     PUSH_URL="push_url"
  4. run build_runner to generate .g.dart files:
flutter pub run build_runner build --delete-conflicting-outputs

Features and bugs

Please file feature requests and bugs at the issue tracker.

Usage

To start using this package first import it in your Dart file.

import 'package:polygonid_flutter_sdk/sdk/polygon_id_sdk.dart';

Notes

P.S. Using iOS simulator for testing wallet sdk is right now under maintenance and will be available soon.