Skip to content

A package that wraps Everything SDK API calls using FFI to make them accessible to Dart code.

License

Notifications You must be signed in to change notification settings

Krysl/DartPackage-EverythingSearchEngine

Repository files navigation

A package that wraps Everything SDK API calls using FFI to make them accessible to Dart code.

Features

Getting started

dart pub add everything_search_engine

import 'package:everything_search_engine/everything.dart';

/// `await Everything.ensureInited()` must be called before `Everything.fromDefaultLibraryPath()` unless you use your own dll library
await Everything.ensureInited();
Everything everything = Everything.fromDefaultLibraryPath();

add flutter asset in pubspec.yaml if you are using flutter or flutter_test

flutter:
  assets:
    - packages/everything_search_engine/src/dll/Everything64.dll

Usage

import 'package:everything_search_engine/everything_search_engine.dart';

Future<void> main() async {
  /// `await Everything.ensureInited()` must be called before `Everything.fromDefaultLibraryPath()` unless you use your own dll library
  await Everything.ensureInited();

  final everything = Everything.fromDefaultLibraryPath();

  final results = everything.runQuery(
    const Query(
      search: r'^pubspec\.yaml$',
      isMatchPath: false,
      isRegex: true,
      // isMatchCase: false,
      // isMatchWholeWord: false,
      requestFlags: RequestFlags(
        dateCreated: true,
      ),
      sort: EverythingSort.dateCreatedDescending,
      max: 20,
      offset: 0,
    ),
  );
  // ignore: avoid_print
  print(results.items.join('\n'));
}

Additional information

About

A package that wraps Everything SDK API calls using FFI to make them accessible to Dart code.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published