jsonrpc2flutter 1.0.0

  • Readme
  • Changelog
  • Installing
  • 59

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])

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:

  jsonrpc2flutter: ^1.0.0

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

Alternatively, your editor might support pub get or 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:jsonrpc2flutter/client_base.dart';
import 'package:jsonrpc2flutter/jsonrpc_io_client.dart';
import 'package:jsonrpc2flutter/rpc_exceptions.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Jan 14, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.0
  • pana: 0.13.4

Health issues and suggestions

Document public APIs. (-1 points)

75 out of 75 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.

Fix lib/client_base.dart. (-7.71 points)

Analysis of lib/client_base.dart reported 16 hints, including:

line 34 col 19: Don't explicitly initialize variables to null.

line 42 col 17: Don't explicitly initialize variables to null.

line 48 col 19: Unnecessary new keyword.

line 52 col 14: Unnecessary new keyword.

line 54 col 7: DO use curly braces for all flow control structures.

Fix lib/jsonrpc_io_client.dart. (-2.48 points)

Analysis of lib/jsonrpc_io_client.dart reported 5 hints:

line 29 col 23: Unnecessary new keyword.

line 35 col 13: Unnecessary new keyword.

line 48 col 19: Unnecessary new keyword.

line 59 col 13: Unnecessary new keyword.

line 70 col 13: Unnecessary new keyword.

Fix lib/src/classb.dart. (-1 points)

Analysis of lib/src/classb.dart reported 2 hints:

line 9 col 31: Unnecessary new keyword.

line 14 col 14: Unnecessary new keyword.

Fix lib/rpc_exceptions.dart. (-0.50 points)

Analysis of lib/rpc_exceptions.dart reported 1 hint:

line 25 col 55: Don't explicitly initialize variables to null.

Maintenance suggestions

Package is getting outdated. (-34.52 points)

The package was last published 70 weeks ago.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and jsonrpc2flutter.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.


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