### Run Pana for Package Analysis Source: https://pub.dev/help/scoring Execute the pana tool on a copy of your package directory to calculate pub points and get suggestions before publishing. It's recommended to work on a copy as pana may modify the package. ```bash dart pub global run pana ~/tmp/mypkg ``` -------------------------------- ### All Package Names for Archiving and Mirrors Source: https://pub.dev/help/api Fetches all package names on pub.dev, paginated. Clients should use the 'nextUrl' field to retrieve subsequent pages. The response is gzip-compressed JSON and should be cached for at least 2 hours. ```json { "packages": [ "http", "provider", /* further package names */ ], "nextUrl": null /* a client should call this full URL for the next page */ } ``` -------------------------------- ### Package names for archiving and mirrors Source: https://pub.dev/help/api Retrieves all package names on pub.dev, paginated. Clients should use the `nextUrl` field to fetch subsequent pages. The response is gzip-compressed JSON and should be cached for at least 2 hours. ```APIDOC ## GET https://pub.dev/api/package-names ### Description Returns all package names on pub.dev. The results are paginated, and the `nextUrl` field in the response should be used to fetch the next page of results. The response is gzip-compressed JSON and should be cached for at least 2 hours. ### Method GET ### Endpoint https://pub.dev/api/package-names ### Headers - `accept-encoding`: gzip ### Response #### Success Response (200) - `packages` (array[string]) - A list of package names on the current page. - `nextUrl` (string | null) - The full URL to fetch the next page of package names, or null if this is the last page. ### Response Example ```json { "packages": [ "http", "provider", "further package names" ], "nextUrl": null } ``` ``` -------------------------------- ### Activate Pana Tool Source: https://pub.dev/help/scoring Ensure you have the latest version of the pana tool, which is used to calculate pub points. Run this command frequently to update. ```bash dart pub global activate pana ``` -------------------------------- ### Package Names for Name Completion Source: https://pub.dev/help/api Retrieves a list of top package names for auto-completion. The response is gzip-compressed JSON and should be cached for at least 8 hours. ```json { "packages": [ "http", "provider", /* further package names */ ] } ``` -------------------------------- ### Importing the Path Package Source: https://pub.dev/packages/path Import the path package with a prefix for convenient use of its functions. ```dart import 'package:path/path.dart' as p; ``` -------------------------------- ### Package names for name completion Source: https://pub.dev/help/api Retrieves a list of top package names on pub.dev for name completion. The response is gzip-compressed JSON and should be cached for at least 8 hours. ```APIDOC ## GET https://pub.dev/api/package-name-completion-data ### Description Returns a list of the top package names on pub.dev, suitable for use in name completion features. The response is gzip-compressed JSON and may not include all package names due to payload size limitations. Clients should cache the response for at least 8 hours. ### Method GET ### Endpoint https://pub.dev/api/package-name-completion-data ### Headers - `accept-encoding`: gzip ### Response #### Success Response (200) - `packages` (array[string]) - A list of package names. ### Response Example ```json { "packages": [ "http", "provider", "further package names" ] } ``` ``` -------------------------------- ### Analyze Flutter Package Source: https://pub.dev/help/scoring Run static analysis on your Flutter package to check for errors, warnings, and lints. Fix all reported issues before publishing. ```bash flutter analyze ``` -------------------------------- ### Joining Path Segments (Platform-Specific) Source: https://pub.dev/packages/path Use the top-level join() function to combine path segments using the current platform's directory separator. ```dart p.join('directory', 'file.txt'); ``` -------------------------------- ### Package Score and Metadata Source: https://pub.dev/help/api Fetches the current scores and metadata for a package, including likes, downloads, granted points, and tags. Values may be null if not yet calculated. ```json { "grantedPoints": 160, "maxPoints": 160, "likeCount": 8297, "downloadCount30Days": 11831655, "tags": [ "sdk:dart", "sdk:flutter", "platform:android", /* further tags */ ] } ``` -------------------------------- ### Joining Path Segments (Explicit Context) Source: https://pub.dev/packages/path Create a p.Context with a specific Style (e.g., Style.windows) to manipulate paths using a particular platform's separators, regardless of the host environment. ```dart var context = p.Context(style: Style.windows); context.join('directory', 'file.txt'); ``` -------------------------------- ### Analyze Dart Package Source: https://pub.dev/help/scoring Run static analysis on your Dart package to check for errors, warnings, and lints. Fix all reported issues before publishing. ```bash dart analyze ``` -------------------------------- ### Declaring Platform Support in pubspec.yaml Source: https://pub.dev/help/scoring Use the 'platforms' key in pubspec.yaml to declare the specific platforms a package supports, especially for packages with platform-specific implementations like FFI. This overrides automatic detection. ```yaml # This package works only on Windows and Linux. platforms: windows: linux: ``` -------------------------------- ### Check for Outdated Dependencies in Flutter Source: https://pub.dev/help/scoring Determine if your Flutter package has outdated dependencies. Update all dependencies to their latest stable versions. ```bash flutter pub outdated ``` -------------------------------- ### Package Publisher Metadata Source: https://pub.dev/help/api Retrieves the publisher ID for a given package. Returns null if the package is not under a publisher. ```json { "publisherId": "dart.dev" } ``` -------------------------------- ### Check for Outdated Dependencies in Dart Source: https://pub.dev/help/scoring Determine if your Dart package has outdated dependencies. Update all dependencies to their latest stable versions. ```bash pub outdated ``` -------------------------------- ### Package metadata: score Source: https://pub.dev/help/api Retrieves scoring and metadata for a package, including like count, 30-day downloads, pana scores, and tags. The response is JSON and should be cached for 120 seconds. ```APIDOC ## GET https://pub.dev/api/packages//score ### Description Provides the current scores and related metadata for a package. This includes the number of likes, 30-day download count, pana score points, and assigned tags. Values may be `null` if not yet calculated. The response is JSON and should be cached for 120 seconds. ### Method GET ### Endpoint https://pub.dev/api/packages//score ### Parameters #### Path Parameters - **package** (string) - Required - The name of the package. ### Response #### Success Response (200) - `grantedPoints` (integer | null) - The granted points from pana scores. - `maxPoints` (integer | null) - The maximum possible points from pana scores. - `likeCount` (integer) - The total number of likes for the package. - `downloadCount30Days` (integer) - The number of downloads in the last 30 days. - `tags` (array[string]) - Tags assigned to the package (e.g., SDK, platform). ### Response Example ```json { "grantedPoints": 160, "maxPoints": 160, "likeCount": 8297, "downloadCount30Days": 11831655, "tags": [ "sdk:dart", "sdk:flutter", "platform:android" ] } ``` ``` -------------------------------- ### Package metadata: publisher Source: https://pub.dev/help/api Retrieves the publisher ID for a given package. The response is JSON and should be cached for 120 seconds. ```APIDOC ## GET https://pub.dev/api/packages//publisher ### Description Fetches the publisher ID associated with a specific package. Returns `null` if the package is not managed by a publisher. The response is JSON and should be cached for 120 seconds. ### Method GET ### Endpoint https://pub.dev/api/packages//publisher ### Parameters #### Path Parameters - **package** (string) - Required - The name of the package. ### Response #### Success Response (200) - `publisherId` (string | null) - The ID of the publisher, or null if the package is not under a publisher. ### Response Example ```json { "publisherId": "dart.dev" } ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.