Search packages, repositories and app categories

Package detailsv2.0.4

os_detect

Platform independent OS detection.

AndroidiOSWebmacOSWindowsLinux
30-day downloads
428K
Likes
44
Pub points
150

Install package

flutter pub add os_detect

Package Overview

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

The os_detect package provides a platform-independent way to detect the operating system on which a Dart application is running. It offers a simple API to identify the current OS across multiple platforms, including Android, iOS, Web, macOS, Windows, and Linux. This enables developers to write cross-platform code that adapts behavior based on the underlying operating system without relying on platform-specific checks. The package is part of the Dart core libraries, ensuring reliability and consistency. It's ideal for applications needing OS-aware logic, such as file path handling or UI adjustments.

Use cases

  • Cross-platform app behavior customization
  • File path formatting based on OS
  • Conditional UI rendering
  • System-specific feature detection
  • Debugging and logging by OS
  • Integration with native OS features

Key features

  • Supports all major platforms
  • Simple and consistent API
  • Part of Dart core libraries
  • No external dependencies
  • Accurate OS identification
  • Lightweight and efficient

Suitable for

  • Developers building multi-platform Flutter apps
  • Apps requiring OS-specific logic
  • Tools needing runtime OS awareness
  • Cross-platform utilities
  • Dart library maintainers

Considerations

  • Limited to OS detection only
  • Does not provide detailed OS version info
  • Not suitable for low-level system operations
  • Requires careful handling in web context
  • No runtime configuration options
  • Depends on Dart SDK availability

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 2 items

Source repository

Projects using this package