Movatterモバイル変換


[0]ホーム

URL:


Search#

Query expressions#

pub.dev supports the following search query expressions:

  • "exact phrase": By default, when you perform a search, the results includepackages with similar phrases. When a phrase is inside quotes, you'll seeonly those packages that contain exactly the specified phrase.

  • package:<prefix>: Searches for packages that begin withprefix. Use thisfeature to find packages in the same framework.

  • dependency:<package_name>: Searches for packages that referencepackage_name in theirpubspec.yaml.

  • dependency*:<package_name>: Searches for packages that depend onpackage_name (as direct, dev, or transitive dependencies).

  • topic:<topic-name>: Searches for packages that have specified thetopic-nametopic.

  • publisher:<publisher-name.com>: Searches for packages published bypublisher-name.com

  • sdk:<sdk>: Searches for packages that support the given SDK.sdk can be eitherflutter ordart

  • runtime:<runtime>: Searches for packages that support the given runtime.runtime can be one ofweb,native-jit andnative-aot.

  • updated:<duration>: Searches for packages updated in the given past days,with the following recognized formats:3d (3 days),2w (two weeks),6m (6 months),2y 2 years.

  • has:executable: Search for packages with Dart files in theirbin/ directory.

Filters#

The search UI also supports filters.On a wide screen,the filter options will appear to the left of the search results.On a non-wide screen, to open the filter options,click the filter icon to the right of the search bar.

  • To filter by Dart or Flutter support,expand theSDKs section,then select the SDK you are developing with.

  • To filter by platform, under thePlatforms section,select all platforms you intend to support.

  • To filter for only packages withOSI approved licenses,expand theLicense section,then selectOSI approved.

  • For other filters, such as including unlisted packages,expand theAdvanced section.

Ranking#

When you search for a package, the search algorithm first appliesfilters,and then considers only the packages that aren’t filtered out and that matchthe search query. Because packages contain a lot of text (including documentationcomments and identifiers from source code), common words can match many packages.

To find the most relevant search results, the algorithm ranks packages using acombination of the following parameters, listed in order of relative importance:

  • Search query relevance of the following:

    • Package name
    • Description
    • README
    • Documentation comments and identifiers
  • Package download count and like count

  • Pub points, which are based on factors such as these:

    • Adherence to Dart file conventions
    • Presence of documentation
    • Up-to-date dependencies
    • Language feature support

These parameters are normalized, weighted for relative importance, and combinedto form an overall score for each search result; this score determines thedefault order of the displayed search results.

The code for normalizing and weighting parameters changes occasionally. You can findit atgithub.com/dart-lang/pub-dev.

Legacy packages#

pub.dev does not expose packages that support only Dart SDK 1.x in search resultsor in listing pages. However, one can access these packages through their packagepage (/packages/<pkg>) andpub client can download them.

To search for such packages, includeis:legacy in the search query.


[8]ページ先頭

©2009-2025 Movatter.jp