패키지, 저장소 및 앱 카테고리 검색

패키지 상세v7.0.0

dart_helper_utils

re-export된 convert_object, collection, intl API를 포함한 Dart 유틸리티 및 확장 기능.

AndroidiOSWebmacOSWindowsLinux
30일 다운로드
2.9천
좋아요
44
Pub 점수
160

패키지 설치

flutter pub add dart_helper_utils

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

convert_object, collection 및 intl에서 유용한 확장 기능과 핵심 API를 다시 내보내는 다트 유틸리티 패키지입니다. 자주 사용하는 작업인 형식 변환, 컬렉션 조작 및 국제화에 편리한 메서드를 제공하여 개발자의 생산성을 높입니다. 가볍고 다양한 플랫폼에서 일상적인 다트 작업을 간소화하도록 설계되었습니다. 외부 종속성 없이 일관되고 재사용 가능한 유틸리티 함수가 필요한 프로젝트에 이상적입니다.

사용 사례

  • 데이터 유형 변환 간소화
  • 컬렉션 작업 향상
  • 국제화 워크플로우 간소화
  • 확장 기능을 통한 코드 가독성 향상
  • 유틸리티 함수 내의 반복 코드 줄이기
  • 크로스 플랫폼 개발 지원

주요 기능

  • 핵심 Dart 라이브러리 재내보내기
  • 직관적인 확장 제공
  • 경량이며 최소한의 오버헤드
  • 크로스 플랫폼 호환성
  • pub를 통한 간편한 통합
  • 클린하고 유지보수 가능한 코드 실천

적합한 대상

  • 유용성 향상을 원하는 Dart 개발자
  • convert_object, collection 또는 intl를 사용하는 프로젝트
  • 크로스플랫폼 애플리케이션
  • 코드 일관성을 우선시하는 팀
  • 개발자가 반복적인 유틸리티 코드를 줄이고 있다
  • 빠른 확장 기반 도우미가 필요한 앱

고려 사항

  • 재내보내기된 패키지( convert_object, collection, intl)에 의존합니다
  • 복잡한 논리에 대한 독립형 솔루션이 아님
  • 기존 Dart 도구와 함께 사용하는 것이 가장 좋습니다
  • 유틸리티 및 확장 기능에 한정
  • 런타임 성능 향상 없음
  • 재내보내기된 API에 익숙해야 합니다

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

dart_helper_utils logo

pub package

A batteries-included utility package for Dart. One import gives you type-safe conversions, ergonomic extensions, a serious debouncer, stream superpowers, and the APIs you already know from convert_object, collection, and intl.

  • Repository: https://github.com/omar-hanafy/dart_helper_utils
  • Full API: https://pub.dev/documentation/dart_helper_utils/latest/dart_helper_utils/
  • Migration guide: https://github.com/omar-hanafy/dart_helper_utils/blob/main/migration_guides.md

AI coding-assistant support

This repository ships a package-specific agent plugin for Claude Code and OpenAI Codex (this is tooling for coding agents, not a runtime feature of the Dart package). It teaches the agent the exact dart_helper_utils APIs - utility member names and semantics, the Debouncer/throttle/stream lifecycles, the v5-to-v6 breaking migration, and version-aware upgrades.

Install in Claude Code:

/plugin marketplace add omar-hanafy/dart_helper_utils
/plugin install dart-helper-utils@dart-helper-utils-tools

Install in OpenAI Codex (CLI; the IDE extension does not support plugins - use its $skill-installer there instead):

codex plugin marketplace add omar-hanafy/dart_helper_utils
codex plugin add dart-helper-utils@dart-helper-utils-tools

Start a new agent session after installing so the skills load. Then try prompts like "debounce this search field with dart_helper_utils and clean it up on dispose" or "migrate this project from dart_helper_utils 5.x to 6.x", or invoke a skill explicitly in Claude Code, e.g. /dart-helper-utils:use-dart-helper-utils.

The plugin is installed from this Git repository (not from the pub.dev archive), contains markdown skills only - no hooks, no MCP servers, no telemetry - and its version tracks the package version. Details, the full capability list, updating, and uninstalling are in tooling/ai/dart-helper-utils/README.md.

Installation

dependencies:
  dart_helper_utils: ^<latest_version>
import 'package:dart_helper_utils/dart_helper_utils.dart';

At a glance

// Type-safe map extraction, collection helpers, and intl formatting
// all from a single import.
final map = {'name': 'Omar', 'count': '42', 'items': [1, 2, 3]};
print(map.getString('name'));                  // Omar
print(map.getInt('count'));                    // 42
print(map.getList<int>('items').firstOrNull);  // 1
print(1234567.89.formatAsReadableNumber());    // 1,234,567.89
print('invoice.pdf'.isPDF);                    // true

Why reach for it

One import, not five

Everything below is available from the single package import:

  • Type-safe conversions from the re-exported convert_object
  • package:collection (firstOrNull, groupBy, mapIndexed, ...)
  • intl essentials (DateFormat, NumberFormat, Bidi, Intl)
  • dozens of focused extensions and helpers from this package itself

No import soup, no glue code.

A debouncer that is actually complete

Leading or trailing execution, a maxWait ceiling, pause and resume, a state stream for observability, and optional execution history for debugging.

final debouncer = Debouncer(
  delay: const Duration(milliseconds: 300),
  maxWait: const Duration(seconds: 2),
);

void onSearchChanged(String q) =>
    debouncer.run(() => runSearch(q));

// Screen pauses:
debouncer.pause();
// Resumes later:
debouncer.resume();

// Optional observability.
debouncer.stateStream.listen(print);
Stream superpowers, no reactive dependency
// Hold events until you are ready for them.
final paused = sensorStream.asPausable();

// Cap a noisy source at 5 events per second.
final safe = eventStream.rateLimit(5, const Duration(seconds: 1));

// Group events into fixed-size or time-based batches.
final batched = logStream.bufferCount(100);
final windowed = logStream.window(const Duration(seconds: 1));

// Behaviour-subject semantics: late subscribers see the last value.
final replay = priceStream.withLatestValue();
Bounded concurrency and soft timeouts
// Run at most 4 uploads at once, results in completion order.
final urls = await files.mapConcurrent(upload, parallelism: 4);

// Soft timeout: the original task keeps running in the background.
try {
  final report = await TimeUtils.runWithTimeout(
    task: fetchReport,
    timeout: const Duration(seconds: 5),
  );
} on TimeoutException {
  showSlowNetworkBanner();
}
Deep map utilities for config-heavy apps
final nested = {
  'user': {'name': 'Omar', 'roles': ['admin', 'editor']},
};

final flat = nested.flatMap();
// {user.name: Omar, user.roles.0: admin, user.roles.1: editor}

print(flat.unflatten()); // round-trips back to nested

final payload = {'users': [{'name': 'A'}, {'name': 'B'}]};
print(payload.getPath('users[1].name')); // B

Also in the box

Everyday sugar that you would otherwise write by hand: the full stringo string toolkit (case conversion, slugify, truncate, mask, whitespace normalization) re-exported here, format validators (isValidEmail, isUuid), parseDuration, MIME checks (isPDF, isImage, isFont), date helpers (isBetween, addBusinessDays, daysInMonth), Intl formatters (formatAsCurrency, formatAsCompact, toOrdinal, pluralize), URI builders (rebuild, mergeQueryParameters, appendPathSegment), and Iterable<num> statistics (mean, median, percentile, standardDeviation).

Browse the full API: https://pub.dev/documentation/dart_helper_utils/latest/

Migration notes

  • 6.1.0 moved string text transformations into stringo, which is re-exported here. Call sites are unchanged; only explicit extension type names differ (see the CHANGELOG). Depend on stringo directly if you want the string helpers without the rest of this package.
  • v6 moved conversion logic into convert_object, which is re-exported here.
  • Duplicate iterable and map helpers were removed in favor of package:collection, which is now also re-exported.
  • Old JSON helpers like safelyEncodedJson are now toJsonString(...) or encodeWithIndent from convert_object.

Full guide: https://github.com/omar-hanafy/dart_helper_utils/blob/main/migration_guides.md

카테고리

의존성

의존성 목록 6 개

소스 저장소

이 패키지를 사용하는 프로젝트