Search categories, packages and repositories

Package detailsv3.2.0

platform

A pluggable, mockable platform information abstraction for Dart.

AndroidiOSmacOSWindowsLinux
30-day downloads
16.1M
Likes
121
Pub points
160

Install package

flutter pub add platform

Package Overview

Package selection guidance compiled from public package information, community data, and project usage.

The platform package provides a pluggable and mockable abstraction for retrieving platform information in Dart applications. It enables developers to access details such as operating system, architecture, and environment in a consistent way across different platforms. By decoupling platform detection from direct system calls, it simplifies testing and improves code maintainability. The package is particularly useful in environments where platform-specific behavior needs to be simulated or verified during tests.

Use cases

  • Testing platform-specific logic
  • Mocking platform data in unit tests
  • Cross-platform app development
  • Simulating different OS environments
  • Ensuring consistent platform detection
  • Building portable Dart libraries

Key features

  • Pluggable platform implementation
  • Mockable platform information
  • Support for multiple platforms
  • Clean separation of concerns
  • Easy integration with test frameworks
  • Consistent API across platforms

Suitable for

  • Dart developers writing cross-platform apps
  • Test engineers needing platform mocks
  • Libraries requiring platform awareness
  • Teams practicing test-driven development
  • Developers targeting multiple operating systems

Considerations

  • Requires setup for custom platform implementations
  • May add slight overhead for simple use cases
  • Best used in conjunction with testing frameworks
  • Not intended for runtime platform detection in production apps
  • Limited to basic platform metadata
  • Depends on Dart's core platform package

Original README

Original README snapshot from the linked source repository. Visit the repository for the latest content.

Overview

This repository is home to various Dart packages under the dart.dev publisher.

Packages

Package Description Issues Version
args Library for defining parsers for parsing raw command-line arguments into a set of options and values using GNU and POSIX style options. issues pub package
async Utility functions and classes related to the 'dart:async' library. issues pub package
characters String replacement with operations that are Unicode/grapheme cluster aware. issues pub package
collection Collections and utilities functions and classes related to collections. issues pub package
convert Utilities for converting between data representations. Provides a number of Sink, Codec, Decoder, and Encoder types. issues pub package
crypto Implementations of SHA, MD5, and HMAC cryptographic functions. issues pub package
fixnum Library for 32- and 64-bit signed fixed-width integers with consistent behavior between native and JS runtimes. issues pub package
lints Official Dart lint rules. Defines the 'core' and 'recommended' set of lints suggested by the Dart team. issues pub package
logging Provides APIs for debugging and error logging, similar to loggers in other languages, such as the Closure JS Logger and java.util.logging.Logger. issues pub package
os_detect Platform independent OS detection. issues pub package
path A string-based path manipulation library. issues pub package
platform A pluggable, mockable platform information abstraction for Dart. issues pub package
typed_data Utility functions and classes related to the dart:typed_data library. issues pub package

Publishing automation

For information about our publishing automation and release process, see https://github.com/dart-lang/ecosystem/wiki/Publishing-automation.

For additional information about contributing, see our contributing page.

Categories

Dependencies

Dependency list 1 items

Source repository

Projects using this package

Rankings