dom_tools 1.2.2

  • Readme
  • Changelog
  • Installing
  • 44

dom_tools #

DOM rich elements and tools

Usage #

A simple usage example:

import 'package:dom_tools/dom_tools.dart';

main() {

  // Example of an image that only loads when visualized in viewport: 

  TrackElementInViewport tracker = TrackElementInViewport() ;
  var imageElement = ImageElement() ;
  tracker.track(imageElement, onEnterViewport: (elem) {
    imageElement.src = '' ;


Features and bugs #

Please file feature requests and bugs at the issue tracker.

Author #

Graciliano M. Passos: gmpassos@GitHub.

License #

Dart free & open-source license.

1.2.2 #

  • DataStorageType: browser transparent storage over IdbFactory or window.sessionStorage.
  • json_object_mapper: ^1.0.0
  • swiss_knife: ^2.3.1

1.2.1 #

  • CanvasImageViewer.cropPerspective.

1.2.0 #

  • CanvasImageViewer support for perspective filter.
  • Caches: ImageScaledCache, ImagePerspectiveFilterCache.

1.0.1 #

  • CSS functions: applyCSS(), defineCSS(), hasCSS()
  • Class Color (from dart:ui).
  • Class CanvasImageViewer.

1.0.0 #

  • Initial version, created by Stagehand

Use this package as a library

1. Depend on it

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

  dom_tools: ^1.2.2

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:dom_tools/dom_tools.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 Jul 5, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.13

Health issues and suggestions

Fix lib/src/dom_data_storage.dart. (-86.72 points)

Analysis of lib/src/dom_data_storage.dart failed with 7 errors, 1 hint, including:

line 5 col 8: Target of URI doesn't exist: 'package:swiss_knife/swiss_knife_browser.dart'.

line 136 col 9: Undefined class 'EventStream'.

line 136 col 36: The method 'EventStream' isn't defined for the type '_PersistentSimpleStorage'.

line 242 col 9: Undefined class 'EventStream'.

line 242 col 36: The method 'EventStream' isn't defined for the type '_DBSimpleStorage'.

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

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

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

line 1009 col 13: The value of the local variable 'boundsPrev' isn't used.

Format lib/dom_tools.dart.

Run dartfmt to format lib/dom_tools.dart.

Format lib/src/dom_tools_base.dart.

Run dartfmt to format lib/src/dom_tools_base.dart.

Format lib/src/perspective_filter.dart.

Run dartfmt to format lib/src/perspective_filter.dart.

Maintenance issues and suggestions

No valid SDK. (-20 points)

The analysis could not detect a valid SDK that can use this package.

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

For more information see the pub package layout conventions.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.7.0 <3.0.0
intl ^0.16.0 0.16.1
json_object_mapper ^1.0.0 1.0.0
swiss_knife ^2.3.1 2.5.3
Transitive dependencies
collection 1.14.13
path 1.7.0
resource_portable 2.1.7
typed_data 1.2.0
Dev dependencies
pedantic ^1.8.0
test ^1.6.0