just_debounce_it 1.0.4

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 76

just_debounce_it

Build Status

A simple debounce library.

import 'package:just_debounce_it/just_debounce_it.dart';

Debounce.milliseconds(1000, print, ["Debounce World!"]);

Static methods

There are three methods available for debouncing:

Debounce.seconds(int timeoutSeconds, Function target, [List<dynamic> args])
Debounce.milliseconds(int timeoutMs, Function target, [List<dynamic> args])
Debounce.duration(Duration timeout, Function target, [List<dynamic> args])

All methods differ only by the first parameter used to specify timeout values in different formats.

Example

A quick demonstration can be found in the example directory. To run the example:

pub run example/main.dart

Credits

https://gist.github.com/marc-hughes/8302149

Changelog

1.0.4

  • Run dartfmt.
  • Adjust analysis_options.yaml and fix issues.
  • Add travis YAML.

1.0.3

  • Move project into repo. Fix typos in README.md.

1.0.2

  • Clean-up README.md.

1.0.1

  • Improved documentation. Added example.

1.0.0

  • Initial version of a debounce library.

example/main.dart

import 'package:just_debounce_it/just_debounce_it.dart';

void main() {
  void printSeconds() => print("Hello World (Debounce.seconds)");
  Debounce.seconds(1, printSeconds);
  Debounce.seconds(1, printSeconds);
  Debounce.seconds(1, printSeconds);
  Debounce.seconds(1, printSeconds);
  Debounce.seconds(1, printSeconds);

  void printMs() => print("Hello World (Debounce.milliseconds)");
  Debounce.milliseconds(500, printMs);
  Debounce.milliseconds(500, printMs);
  Debounce.milliseconds(500, printMs);
  Debounce.milliseconds(500, printMs);
  Debounce.milliseconds(500, printMs);

  final duration = const Duration(milliseconds: 2000);
  Debounce.duration(duration, print, ["Hello World (Debounce.duration)"]);
  Debounce.duration(duration, print, ["Hello World (Debounce.duration)"]);
  Debounce.duration(duration, print, ["Hello World (Debounce.duration)"]);
  Debounce.duration(duration, print, ["Hello World (Debounce.duration)"]);
  Debounce.duration(duration, print, ["Hello World (Debounce.duration)"]);
}

1. Depend on it

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


dependencies:
  just_debounce_it: "^1.0.4"

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter packages get

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

3. Import it

Now in your Dart code, you can use:


import 'package:just_debounce_it/just_debounce_it.dart';
        
Version Uploaded Documentation Archive
1.0.4 Apr 12, 2018 Go to the documentation of just_debounce_it 1.0.4 Download just_debounce_it 1.0.4 archive
1.0.3 Feb 9, 2018 Go to the documentation of just_debounce_it 1.0.3 Download just_debounce_it 1.0.3 archive
1.0.2 Feb 9, 2018 Go to the documentation of just_debounce_it 1.0.2 Download just_debounce_it 1.0.2 archive
1.0.1 Feb 9, 2018 Go to the documentation of just_debounce_it 1.0.1 Download just_debounce_it 1.0.1 archive
1.0.0 Feb 9, 2018 Go to the documentation of just_debounce_it 1.0.0 Download just_debounce_it 1.0.0 archive

Analysis

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

  • Dart: 2.0.0-dev.49.0
  • pana: 0.10.6

Scores

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

Platforms

Detected platforms: Flutter, web, other

No platform restriction found in primary library package:just_debounce_it/just_debounce_it.dart.

Suggestions

  • The description is too short.

    Add more detail about the package, what it does and what is its target use case. Try to write at least 60 characters.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.24.0 <2.0.0
Dev dependencies
test ^0.12.0