fuzzy 0.2.1


Pub Package CI

Fuzzy search in Dart.

This project is basically a code conversion, subset of Fuse.js.

Installation #

add the following to your pubspec.yaml file:

  fuzzy: <1.0.0

then run:

pub get

or with flutter:

flutter packages get

Usage #

import 'package:fuzzy/fuzzy.dart';

void main() {
  final fuse = Fuzzy(['apple', 'banana', 'orange']);

  final result = fuse.search('ran');

  result.map((r) => r.output.first.value).forEach(print);

Don't forget to take a look at FuzzyOptions!


0.2.1 #

  • Fix bug for search empty list

0.2.0+8 #

  • Testing GitHub actions

0.2.0 #

  • Make it generic (to use a List

0.1.1 #

  • Add string normalization, from latinize

0.1.0 #

  • First usable version, fixing stupid bugs from conversion, and with tests

0.0.2 #

  • Code ported from Fuse.js

0.0.1 #

  • Initial commit


import 'package:fuzzy/fuzzy.dart';

void main() {
  final bookList = [
    'Old Man\'s War',
    'The Lock Artist',
    'Right Ho Jeeves',
    'The Code of the Wooster',
    'Thank You Jeeves',
    'The DaVinci Code',
    'Angels & Demons',
    'The Silmarillion',
    'The Lost Symbol',
    'The Book of Lies',
    'Backwards, Red Dwarf',
    'The Grand Design',
    'The Book of Samson',
    'The Preservationist',
    'Monster 1959',
  final fuse = Fuzzy(
    options: FuzzyOptions(
      findAllMatches: true,
      tokenize: true,
      threshold: 0.5,

  final result = fuse.search('book');

      'A score of 0 indicates a perfect match, while a score of 1 indicates a complete mismatch.');

  result.forEach((r) {
    print('\nScore: ${r.score}\nTitle: ${r.item}');

Use this package as a library

1. Depend on it

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

  fuzzy: ^0.2.1

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

  • Dart: 2.7.1
  • pana: 0.13.5


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.6.0 <3.0.0
latinize ^0.0.2 0.0.2
Dev dependencies
pedantic ^1.9.0
test ^1.9.4