thrift 0.13.0

Thrift Dart Library

License #

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Using Thrift with Dart #

Dart 1.24.3 or newer is required

Use this package as a library

1. Depend on it

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


dependencies:
  thrift: ^0.13.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:thrift/thrift.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
42
Health:
Code health derived from static analysis. [more]
75
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
20
Overall:
Weighted score of the above. [more]
48
Learn more about scoring.

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

  • Dart: 2.8.4
  • pana: 0.13.9+1

Analysis suggestions

Package not compatible with runtime flutter-web of web

Because of the import of dart:io via the import chain package:thrift/thrift.dart->package:http/http.dart->package:http/src/streamed_response.dart->package:http/src/base_request.dart->package:http/src/client.dart->package:http/src/io_client.dart->dart:io

Package not compatible with runtime web

Because of the import of dart:io via the import chain package:thrift/thrift.dart->package:http/http.dart->package:http/src/streamed_response.dart->package:http/src/base_request.dart->package:http/src/client.dart->package:http/src/io_client.dart->dart:io

Health suggestions

Fix lib/src/protocol/t_json_protocol.dart. (-25 points)

Analysis of lib/src/protocol/t_json_protocol.dart reported 72 hints, including:

line 22 col 12: Unnecessary new keyword.

line 32 col 38: Avoid const keyword.

line 39 col 33: Unnecessary new keyword.

line 42 col 20: Unnecessary new keyword.

line 43 col 15: Unnecessary new keyword.

Fix lib/src/protocol/t_compact_protocol.dart. (-14.82 points)

Analysis of lib/src/protocol/t_compact_protocol.dart reported 32 hints, including:

line 24 col 12: Unnecessary new keyword.

line 41 col 31: Unnecessary new keyword.

line 56 col 37: Unnecessary new keyword.

line 56 col 59: Unnecessary new keyword.

line 70 col 39: Avoid const keyword.

Fix lib/src/protocol/t_binary_protocol.dart. (-13.53 points)

Analysis of lib/src/protocol/t_binary_protocol.dart reported 29 hints, including:

line 21 col 42: Use = to separate a named parameter from its default value.

line 21 col 67: Use = to separate a named parameter from its default value.

line 27 col 12: Unnecessary new keyword.

line 39 col 39: Avoid const keyword.

line 45 col 23: Use = to separate a named parameter from its default value.

Fix additional 15 files with analysis or formatting issues. (-39.39 points)

Additional issues in the following files:

  • lib/src/browser/t_web_socket.dart (10 hints)
  • lib/src/transport/t_framed_transport.dart (10 hints)
  • lib/src/transport/t_message_reader.dart (9 hints)
  • lib/src/transport/t_socket_transport.dart (9 hints)
  • lib/src/transport/t_buffered_transport.dart (7 hints)
  • lib/src/console/t_web_socket.dart (6 hints)
  • lib/src/t_application_error.dart (6 hints)
  • lib/src/transport/t_http_transport.dart (6 hints)
  • lib/src/console/t_tcp_socket.dart (5 hints)
  • lib/src/serializer/t_deserializer.dart (3 hints)
  • lib/src/serializer/t_serializer.dart (3 hints)
  • lib/src/protocol/t_multiplexed_protocol.dart (2 hints)
  • lib/src/protocol/t_protocol_util.dart (2 hints)
  • lib/src/transport/t_transport.dart (1 hint)
  • lib/src/transport/t_transport_factory.dart (1 hint)

Maintenance issues and suggestions

Provide a file named CHANGELOG.md. (-20 points)

Changelog entries help developers follow the progress of your package. See the example generated by stagehand.

Use analysis_options.yaml. (-10 points)

Change the name of your package's .analysis_options file to analysis_options.yaml.

Read more about the setup of analysis-options.yaml.

Support latest dependencies. (-10 points)

The version constraint in pubspec.yaml does not support the latest published versions for 1 dependency (http).

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

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 thrift.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Documentation URL is insecure. (-5 points)

Update the documentation field and use a secure (https) URL.

Homepage URL is insecure. (-5 points)

Update the homepage field and use a secure (https) URL.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.24.3 <3.0.0
dart2_constant ^1.0.0 1.0.2+dart2
fixnum ^0.10.2 0.10.11
http ^0.11.3 0.11.3+17 0.12.1
logging ^0.11.0 0.11.4
Transitive dependencies
async 2.4.1
charcode 1.1.3
collection 1.14.13
http_parser 3.1.4
meta 1.1.8
path 1.7.0
source_span 1.7.0
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.2.0
Dev dependencies
dart_dev ^2.0.0
mockito >=2.2.2 <4.0.0
test >=0.12.30 <2.0.0