搜索插件、代码仓与 APP 分类

插件详情v2.0.4

os_detect

平台无关的操作系统检测。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
42.8万
喜欢数
44
Pub 分数
150

安装插件

flutter pub add os_detect

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

os_detect 包提供了一种与平台无关的方式来检测运行 Dart 应用程序的操作系统。它提供了一个简单的 API,可在多个平台(包括 Android、iOS、Web、macOS、Windows 和 Linux)上识别当前操作系统。这使得开发者能够编写跨平台代码,并根据底层操作系统自适应行为,而无需依赖特定于平台的检查。该包是 Dart 核心库的一部分,确保了可靠性和一致性。它非常适合需要操作系统感知逻辑的应用程序,例如文件路径处理或用户界面调整。

适合场景

  • 跨平台应用行为自定义
  • 基于操作系统的文件路径格式化
  • 条件性 UI 渲染
  • 系统特定功能检测
  • 按操作系统调试和日志记录
  • 与原生操作系统功能集成

主要特点

  • 支持所有主要平台
  • 简单且一致的 API
  • Dart 核心库的一部分
  • 无外部依赖
  • 准确的系统识别
  • 轻量且高效

适合对象

  • 开发跨平台 Flutter 应用的开发者
  • 需要操作系统特定逻辑的应用程序
  • 需要运行时操作系统感知的工具
  • 跨平台实用工具
  • Dart 库维护者

使用建议

  • 仅限操作系统检测
  • 不提供详细的操作系统版本信息
  • 不适用于低级别系统操作
  • 在 Web 环境中需要谨慎处理
  • 无运行时配置选项
  • 依赖于 Dart SDK 的可用性

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

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.

所属分类

依赖

依赖清单 2 项

源码仓库

使用此插件的项目