Skip to content

Latest commit

 

History

History
26 lines (16 loc) · 835 Bytes

README.md

File metadata and controls

26 lines (16 loc) · 835 Bytes

Features

Exposed Dart Classes for easy flutter integration with Reef chain

Getting started

Add dependency to pubscpek.yaml, copy lib/js/packages/reef-mobile-js/dist/index.js to your app under same path and add this .js file to assets in pubspeck.yaml

Usage

import 'package:reef_chain_flutter/reef_chain_flutter.dart';

final JsApiService reefJsApiService = JsApiService.reefAppJsApi(onErrorCb: (){
  debugPrint('JS CONNECTION ERROR');
});

widget.reefJsApiService.jsCall("window.isJsConn()").then((v)=>debugPrint(v.toString()));
widget.reefJsApiService.jsPromise("window.futureFn(\"fltrrr\")").then((v)=>debugPrint(v.toString()));
widget.reefJsApiService.jsObservable("window.testObs()").listen((v)=>debugPrint(v.toString()));

Example App Repo

https://github.com/reef-chain/reef-flutter-lib-example-app