w_common 1.20.1

w_common #

A collection of helpful utilities for use in Dart projects. Right now, it includes the following:

  • Disposable interface / mixin to assist with cleaning up streams and other data structures that won't necessarily be garbage collected without some manual intervention.
  • A simple typedef that can be parameterized to represent a zero-arity callback that returns a particular type.
  • InvalidationMixin mixin used to mark a class as requiring validation.
  • JsonSerializable interface to indicate that something can be serialized to JSON.
  • A CSS compilation executable that can be run via
    pub run w_common:compile_sass
    
    from the root of your package that depends on w_common.
    • It can also be used as a watcher - great for when you're doing a lot of work on .scss files and don't want to have to remember to keep re-running the script after each change.
      pub run w_common:compile_sass --watch
      
    • Run
      pub run w_common:compile_sass -h
      
      for more usage details / instructions.

We expect this list to grow as we identify small pieces of code that are useful across a wide variety of Dart projects, especially in cases where there is value in projects sharing a single implementation.

Use this package as a library

1. Depend on it

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


dependencies:
  w_common: ^1.20.1

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_common/w_common.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
84
Health:
Code health derived from static analysis. [more]
89
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
50
Overall:
Weighted score of the above. [more]
79
Learn more about scoring.

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

  • Dart: 2.5.1
  • pana: 0.12.21

Platforms

Detected platforms: web

Primary library: package:w_common/w_common.dart with components: html.

Health suggestions

Fix lib/src/common/disposable.dart. (-4.41 points)

Analysis of lib/src/common/disposable.dart reported 9 hints, including:

line 471 col 12: 'isDisposedOrDisposing' is deprecated and shouldn't be used.

line 491 col 12: 'isDisposedOrDisposing' is deprecated and shouldn't be used.

line 540 col 12: 'isDisposedOrDisposing' is deprecated and shouldn't be used.

line 582 col 12: 'isDisposedOrDisposing' is deprecated and shouldn't be used.

line 588 col 12: 'isDisposedOrDisposing' is deprecated and shouldn't be used.

Fix lib/disposable.dart. (-2.96 points)

Analysis of lib/disposable.dart reported 6 hints, including:

line 18 col 9: 'DisposableManager' is deprecated and shouldn't be used.

line 20 col 9: 'DisposableManagerV2' is deprecated and shouldn't be used.

line 22 col 9: 'DisposableManagerV3' is deprecated and shouldn't be used.

line 24 col 9: 'DisposableManagerV4' is deprecated and shouldn't be used.

line 26 col 9: 'DisposableManagerV5' is deprecated and shouldn't be used.

Fix lib/disposable_browser.dart. (-2.96 points)

Analysis of lib/disposable_browser.dart reported 6 hints, including:

line 18 col 9: 'DisposableManager' is deprecated and shouldn't be used.

line 20 col 9: 'DisposableManagerV2' is deprecated and shouldn't be used.

line 22 col 9: 'DisposableManagerV3' is deprecated and shouldn't be used.

line 24 col 9: 'DisposableManagerV4' is deprecated and shouldn't be used.

line 26 col 9: 'DisposableManagerV5' is deprecated and shouldn't be used.

Fix lib/src/common/disposable_manager.dart. (-0.50 points)

Analysis of lib/src/common/disposable_manager.dart reported 1 hint:

line 296 col 47: 'DisposableManagerV6' is deprecated and shouldn't be used.

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

Analysis of lib/test_utils.dart reported 1 hint:

line 20 col 71: Use = to separate a named parameter from its default value.

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.

Support latest dependencies. (-10 points)

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

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.

None of the files in the package's example/ directory matches known example patterns.

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

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.24.3 <3.0.0
args ^1.5.1 1.5.2
async >=1.13.3 <3.0.0 2.4.0
colorize >=0.1.2 <3.0.0 2.0.0
dart2_constant ^1.0.0 1.0.2+dart2
glob ^1.1.7 1.2.0
intl >=0.14.0 <0.16.0 0.15.8 0.16.0
js ^0.6.1+1 0.6.1+1
logging ^0.11.0 0.11.3+2
meta ^1.0.4 1.1.7
package_config ^1.0.3 1.1.0
package_resolver ^1.0.2 1.0.10
path ^1.5.1 1.6.4
sass ^1.6.0 1.23.0
source_maps ^0.10.5 0.10.8
watcher ^0.9.6 0.9.7+12
Transitive dependencies
charcode 1.1.2
cli_repl 0.2.0+1
collection 1.14.12
http 0.12.0+2
http_parser 3.1.3
matcher 0.12.5
node_interop 1.0.3
node_io 1.0.1+2
pedantic 1.8.0+1
quiver 2.0.5
source_span 1.5.5
stack_trace 1.9.3
stream_transform 0.0.19
string_scanner 1.0.5
term_glyph 1.1.0
tuple 1.0.3
typed_data 1.1.6
Dev dependencies
build_runner >=0.6.0 <2.0.0
build_test >=0.9.0 <2.0.0
build_web_compilers >=0.2.0 <3.0.0
dependency_validator ^1.2.2
mockito >=2.2.2 <4.0.0
test >=0.12.34 <2.0.0