搜索分类、插件与代码仓

插件详情v3.2.0

platform

一个可插拔的、可模拟的 Dart 平台信息抽象。

AndroidiOSmacOSWindowsLinux
近 30 天下载
1610万
喜欢数
121
Pub 分数
160

安装插件

flutter pub add platform

插件介绍

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

该平台包为 Dart 应用程序提供了一个可插拔且可模拟的抽象,用于获取平台信息。它使开发者能够以一致的方式访问操作系统、架构和环境等详细信息,适用于不同的平台。通过将平台检测与直接系统调用解耦,该包简化了测试并提高了代码的可维护性。在需要在测试中模拟或验证特定平台行为的环境中,该包尤其有用。

适合场景

  • 测试平台特定逻辑
  • 在单元测试中模拟平台数据
  • 跨平台应用开发
  • 模拟不同的操作系统环境
  • 确保一致的平台检测
  • 构建可移植的 Dart 库

主要特点

  • 可插拔的平台实现
  • 可模拟的平台信息
  • 对多平台的支持
  • 关注点的清晰分离
  • 与测试框架的轻松集成
  • 跨平台一致的 API

适合对象

  • Dart 开发人员编写跨平台应用
  • 需要平台模拟的测试工程师
  • 需要平台感知的库
  • 团队在实践测试驱动开发
  • 面向多个操作系统的开发者

使用建议

  • 需要为自定义平台实现进行设置
  • 对于简单用例,可能会增加轻微开销
  • 最好与测试框架配合使用
  • 不建议在生产应用中用于运行时平台检测
  • 仅限基本平台元数据
  • 依赖于 Dart 的核心平台包

原始 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.

所属分类

依赖

依赖清单 1 项

源码仓库

使用此插件的项目

所在榜单