w_service 1.1.0

  • README.md
  • Installing
  • Versions
  • 34


Pub Build Status codecov.io documentation


This library has been deprecated in favor of w_transport. All of the functionality provided by this library has been covered by w_transport.

Platform agnostic library for sending and receiving data messages between an application and a server with the ability to shape traffic and transform data through the use of message interceptors.


The w_service package provides a data transport layer that makes message preparation, data transformation, and traffic shaping easy.

w_service does not directly interact with data transport protocols like HTTP and WebSocket. It utilizes w_transport - a platform-agnostic library with ready to use transport classes for sending and receiving data.


Creating a service API often starts out with a simple interface between client and server with some basic error handling. But, as an application grows, the demand for a higher quality service tier inevitably arises. The wish list usually includes more sophisticated fault tolerance, retry logic, data transforms, and traffic shaping.

w_service's goal is to provide you with classes and patterns designed with these ideas in mind so you can scale your service tier to handle comprehensive use cases while eliminating unnecessary complexity.


w_service includes ready to use classes for immediate consumption and is built with extensibility and composability in mind for more customized applications. It makes data transformation and traffic shaping easy by leveraging the interceptor pattern to compose independent pieces of logic into a single workflow for every single service message.

This is accomplished through the use of Providers, Interceptors, and an InterceptorManager.

For more detailed information on these concepts, check out the w_service wiki.

Platform Agnostic

The main library (w_service/w_service.dart) is built on w_transport (also platform-agnostic) and depends on neither dart:html nor dart:io, making it platform agnostic. This means you can use the w_service library to build components, libraries, or APIs that will be reusable in the browser AND on the server.

The end consumer will make the decision between client and server, most likely in a main() block.

Usage in the Browser

import 'package:w_service/w_service_client.dart' show configureWServiceForBrowser;

void main() {

Usage on the Server

import 'package:w_service/w_service_server.dart' show configureWServiceForServer;

void main() {


This project leverages the dart_dev package for most of its tooling needs, including static analysis, code formatting, running tests, collecting coverage, and serving examples. Check out the dart_dev readme for more information.



  • Initial version of w_service.

Use this package as a library

1. Depend on it

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

  w_service: "^1.1.0"

2. Install it

You can install packages from the command line:

with pub:

$ pub get

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

3. Import it

Now in your Dart code, you can use:

      import 'package:w_service/w_service.dart';
Version Uploaded Documentation Archive
1.1.0 Aug 11, 2016 Go to the documentation of w_service 1.1.0 Download w_service 1.1.0 archive
1.0.2 Sep 4, 2015 Go to the documentation of w_service 1.0.2 Download w_service 1.0.2 archive
1.0.1 Jun 26, 2015 Go to the documentation of w_service 1.0.1 Download w_service 1.0.1 archive


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

  • Dart: 2.0.0-dev.60.0
  • pana: 0.11.3


Describes how popular the package is relative to other packages. [more]
23 / 100
Code health derived from static analysis. [more]
70 / 100
Reflects how tidy and up-to-date the package is. [more]
7 / 100
Overall score:
Weighted score of the above. [more]
Learn more about scoring.


Detected platforms: unsure

Error(s) prevent platform classification:

Error(s) in lib/w_service_diagnostic.dart: Target of URI doesn't exist: 'package:react/react.dart'.


  • Fix platform conflicts.

    Error(s) prevent platform classification:

    Error(s) in lib/w_service_diagnostic.dart: Target of URI doesn't exist: 'package:react/react.dart'.

  • Running dartdoc failed.

    Make sure dartdoc runs without any issues.

  • Fix analysis and formatting issues.

    Analysis or formatting checks reported 52 errors 14 hints.

    Make sure that the imported libraries are not in conflict. Error(s) in lib/w_service_diagnostic.dart: Target of URI doesn't exist: 'package:react/react.dart'.

    Strong-mode analysis of lib/src/diagnostic/components/collapsible_panel.dart failed with the following error:

    line: 17 col: 8
    Target of URI doesn't exist: 'package:react/react.dart'.

    Similar analysis of the following files failed:

    • lib/src/diagnostic/components/detailed_message_view.dart (error)
    • lib/src/diagnostic/components/diagnostic_panel.dart (error)
    • lib/src/diagnostic/components/message.dart (error)
    • lib/src/diagnostic/components/message_stats.dart (error)
    • lib/src/diagnostic/components/message_ticker.dart (error)
    • lib/src/diagnostic/components/provider_panel.dart (error)
    • lib/src/generic/interceptors/csrf_interceptor.dart (error)
    • lib/src/http/http_context.dart (error)
    • lib/src/http/http_future.dart (error)
    • lib/src/http/http_provider.dart (error)
    • lib/src/diagnostic/diagnostic_interceptor.dart (hint)
    • lib/src/diagnostic/diagnostics.dart (hint)
    • lib/src/diagnostic/provider_diagnostics.dart (hint)
    • lib/src/generic/interceptors/json_interceptor.dart (hint)
  • Package is getting outdated.

    The package was released 96 weeks ago.

  • The description is too long.

    Search engines will display only the first part of the description. Try to keep it under 180 characters.

  • Maintain an example.

    None of the files in your example/ directory matches a known example patterns. Common file name patterns include: main.dart, example.dart or you could also use w_service.dart.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.9.0 <2.0.0
fluri >=1.0.1 <2.0.0 1.2.4
w_transport >=1.0.1 <2.0.0 1.0.1 3.2.5
Dev dependencies
browser ^0.10.0+2
coverage ^0.7.2
dart_dev ^1.0.0
dart_style ^0.2.0
dartdoc ^0.8.0
mockito ^0.10.0
react ^0.7.0
test ^0.12.4