Skip to content

AcarFurkan/overlay_search

Repository files navigation

In a nutshell, this package allows you to perform a search on a web page even if there isn't a pre-existing list on that page. You can easily display a list on top of your existing components using this package.

Example

Mobile View

show overlay mobile

Web View

show overlay web

Usage

SearchWithList(
      overlaySearchController: widget.overlayController,
      list: list
          .map(
            (e) => OverlayItemModel(
              title: e.symbol ?? "name",
              content: e.name,
              id: e.id,
            ),
          )
          .toList(),
      isLoading: isLoading,
      hintStyle: Theme.of(context).textTheme.bodyMedium,
      overlayBackgroundColor: Colors.black,
      hint: "Search Stock",
      suffixAction: () {
        widget.overlayController.hideOverlay();
        widget.overlayController.clearSearchQuery();
      },
      notFoundText: "Stock Not Found",
      onItemSelected: (item) {
        print(item.title);
      },
      enableDebounce: true,
      debounceDuration: const Duration(milliseconds: 2200),
      onChanged: (p0) {
        print(p0);
        _fetchSearchWithKey(p0);
      },
      onTap: () {
        _fetchSearch();
      },
    )

Additional information

overlay search is still in the beta version, I would be very happy if you contribute. Have a nice day :)