jsonrpc2flutter 1.0.0

  • README.md
  • CHANGELOG.md
  • Installing
  • Versions
  • 64

jsonrpc2-flutter

This project is a repackage of jsonrpc2-dart made to be compatible with Flutter.

The sdk has been upgraded to Dart 2 as it is now the default sdk for Flutter.

For more details please visit the original project.

Basic Usage

  • Import the client library.
  • Create a ServerProxy with the url for the desired endpoint.
  • Call a method on that endpoint, error check, and do something with the result.
    import 'package:jsonrpc2/jsonrpc_io_client.dart';
    proxy = ServerProxy('http://example.com/some_endpoint');
    proxy.call('some_method',[arg1, arg2])
         .then((returned)=>proxy.checkError(returned))
         .then((result){do_something_with(result);})
         .catchError((error){handle(error);});

Credit

All credit to jwashin for the original implementation, only minor changes were needed to ensure Flutter compatibility.

[1.0.0] - 2018-09-10

Added

  • Initial publication.

Use this package as a library

1. Depend on it

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


dependencies:
  jsonrpc2flutter: ^1.0.0

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

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

3. Import it

Now in your Dart code, you can use:


import 'package:jsonrpc2flutter/client_base.dart';
import 'package:jsonrpc2flutter/jsonrpc_io_client.dart';
import 'package:jsonrpc2flutter/rpc_exceptions.dart';
  
Version Uploaded Documentation Archive
1.0.0 Sep 10, 2018 Go to the documentation of jsonrpc2flutter 1.0.0 Download jsonrpc2flutter 1.0.0 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
32
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
64
Learn more about scoring.

We analyzed this package on Oct 26, 2018, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.0.0
  • pana: 0.12.5

Platforms

Detected platforms: Flutter, other

Platform components identified in package: io.

Maintenance suggestions

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package. Common file name patterns include: main.dart, example.dart or you could also use jsonrpc2flutter.dart.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0