IvoriApp/woozy-search
A super simple and lightweight client-side fuzzy-search library based on Levenshtein distance.
github へ移動してダウンロードWoozy Search
A super simple and lightweight client-side fuzzy-search library based on Levenshtein distance.
Usage
dependencies:
woozy_search: '>=2.0.2 <3.0.0'
Basic Usage
import 'package:woozy_search/woozy_search.dart';
main() {
final woozy = Woozy();
woozy.addEntries(['basketball', 'badminton', 'skating']);
final output = woozy.search('badmi');
output.forEach((element) => print(' - ${element}'));
}
Output:
- text: badminton, score: 0.56
- text: basketball, score: 0.20
- text: skating, score: 0.14
With Associate Values
Associate value can be anything, integers, UUIDs, text, etc.
As an example, we use a name and their phone number here.
import 'package:woozy_search/woozy_search.dart';
main() {
final woozy = new Woozy();
woozy.addEntry('John Doe', value: "+1 210-269-0117");
woozy.addEntry('Nate Humphrey', value: "+1 (416) 527-4927");
woozy.addEntry('Serena Waldorf', value: "+ 1 914-514-7901");
final output = woozy.search('humphray');
output.forEach((element) => print(' - ${element}'));
}
Output:
- text: Nate Humphrey, score: 0.88, value: +1 (416) 527-4927
- text: Serena Waldorf, score: 0.13, value: + 1 914-514-7901
- text: John Doe, score: 0.13, value: +1 210-269-0117
With Search Output Limit
Limit the number of search result to return.
It is defaulted to 10, but can be overwritten.
import 'package:woozy_search/woozy_search.dart';
main() {
final woozy = Woozy(limit: 2);
woozy.setEntries(List.filled(100, 'foo'));
final output = woozy.search('f');
output.forEach((element) => print(' - ${element}'));
}
Output:
- text: foo, score: 0.33
- text: foo, score: 0.33
With Case Sensitive
main() {
final woozy = Woozy(caseSensitive: true);
woozy.setEntries(['FOO', 'boo']);
final output = woozy.search('foo');
output.forEach((element) => print(' - ${element}'));
}
Output:
- text: boo, score: 0.67
- text: FOO, score: 0.00
Features and bugs
Please file feature requests and bugs at the issue tracker.
![](/images/banner-woo.jpg)
関連する IvoriApp/woozy-search 優れたプロジェクトの推薦ダウンロード
localsend
33797
An open-source cross-platform alternative to AirDrop
gsy_github_app_flutter
14559
Flutter 超完整的开源项目,功能丰富,适合学习和日常使用。GSYGithubApp系列的优势:我们目前已经拥有Flutter、Weex、ReactNative、kotlin 四个版本。 功能齐全,项目框架内技术涉及面广,完成度高,持续维护,配套文章,适合全面学习,对比参考。跨平台的开源Github客户端App,更好的体验,更丰富的功能,旨在更好的日常管理和维护个人Github,提供更好更方便的驾车体验Σ( ̄。 ̄ノ)ノ。同款Weex版本 : https://github.com/CarGuo/GSYGithubAppWeex 、同款React Native版本 : https://github.com/CarGuo/GSYGithubApp 、原生 kotlin 版本 https://github.com/CarGuo/GSYGithubAppKotlin
dio
12249
A powerful HTTP client for Dart and Flutter, which supports global settings, Interceptors, FormData, aborting and canceling a request, files uploading and downloading, requests timeout, custom adapters, etc.
bloc
11441
A predictable state management library that helps implement the BLoC design pattern
getx
9899
Open screens/snackbars/dialogs/bottomSheets without context, manage states and inject dependencies easily with Get.
flame
8846
A Flutter based game engine.
flutter_deer
7595
🦌 Flutter 练习项目(包括集成测试、可访问性测试)。内含完整UI设计图,更贴近真实项目的练习。Flutter practice project (including integration testing and accessibility testing). Contains complete UI design drawings for a more realistic practice project.
fl_chart
6451
FL Chart is a highly customizable Flutter chart library that supports Line Chart, Bar Chart, Pie Chart, Scatter Chart, and Radar Chart.
riverpod
5828
A reactive caching and data-binding framework. Riverpod makes working with asynchronous code a breeze.
provider
5029
InheritedWidgets, but simple
getwidget
4416
Most popular and easy to use open source UI library with 1000+ Widgets to build flutter app.
fvm
4325
Flutter Version Management: A simple CLI to manage Flutter SDK versions.
pilipala
4003
PiliPala 是使用Flutter开发的BiliBili第三方客户端,感谢使用。
flutter_screenutil
3787
Flutter screen adaptation, font adaptation, get screen information
flutter_rust_bridge
3608
Flutter/Dart <-> Rust binding generator, feature-rich, but seamless and simple.
isar
3366
Extremely fast, easy to use, and fully async NoSQL database for Flutter
bruno
3126
An enterprise-class package of Flutter components for mobile applications. ( Bruno 是基于一整套设计体系的 Flutter 组件库。)
flutter_staggered_grid_view
3043
A Flutter staggered grid view
flutter_hooks
3030
React hooks for Flutter. Hooks are a new kind of object that manages a Widget life-cycles. They are used to increase code sharing between widgets and as a complete replacement for StatefulWidget.
flutter_spinkit
2945
✨ A collection of loading indicators animated with flutter. Heavily Inspired by http://tobiasahlin.com/spinkit.