パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v3.0.1

humanizer

Dart の値を人間が読みやすい表現に変換するためのライブラリです。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
8880
いいね数
54
Pub ポイント
155

パッケージをインストール

flutter pub add humanizer

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

Humanizer は、値を人間が読みやすい形式に変換するための Dart ライブラリであり、データをよりアクセスしやすく、ユーザーに優しいものにします。数値、日付、文字列を自然言語表現に変換する機能をサポートしており、タイムスタンプを「2分前」や数値を「1.2K」として表示できます。複数プラットフォームのアプリにおけるUIの明確性を高めるのに最適で、ローカライズを簡素化し、直感的な方法で情報を提示することでユーザー体験を向上させます。パッケージは軽量で、Flutterプロジェクトとスムーズに統合できます。

用途

  • ユーザーインターフェースでのタイムスタンプのフォーマット
  • 大きな数を読みやすい形式に変換する
  • 数値データのアクセシビリティの向上
  • ログの可読性の向上
  • アプリにおける日付表示の簡素化

主な機能

  • 数値をK/M/B表記に変換します
  • 現在を基準に日付をフォーマットします
  • 複数形および文法のサポート
  • 文字列のケース変換を提供します
  • Flutter との簡単な統合

適している対象

  • Flutter開発者
  • ローカライズされたテキストを必要とするアプリ
  • データ可視化ツール
  • ユーザー向けダッシュボード
  • アクセシビリティを重視したアプリケーション

注意事項

  • テキスト書式設定ユーティリティに限定
  • 複雑な国際化を処理しない
  • エッジケースの手動処理が必要です
  • 英語以外のロケールに対応する組み込みサポートなし
  • 一貫した入力フォーマットに依存する

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

Humanizer

pub package

All Contributors

What?

A Dart library to convert values into human-friendly representations.

Why?

When writing user interfaces we often want to present data we have in a raw format in a way that makes sense to the end user, but doing so is often non-trivial. This library aims to make such conversions easy and flexible.

Where?

Firstly, install the humanizer package, then you can import Humanizer into your Dart code as follows:

import 'package:humanizer/humanizer.dart';

How?

This library has a broad API surface, and in fact has multiple API layers as discussed here. The following table gives a high level overview of the various features, with links to deeper discussion:

Feature Description
Approximate time Converts a Duration to a human-friendly approximation.
Cardinal numbers Converts an integral value to cardinal form (one, two, three etc).
Ordinal numbers Converts an integral value to ordinal form (1st / first, 2nd / second etc).
Plurality Alters the plurality of an input word.
String casing Converts input strings to Sentence case or Title Case.
String truncation Intelligently truncates input strings.
Symbols Converts programming symbol names into human-friendly representations.
Units of measurement Provides types to represent common units of measurement and the ability to convert those types to a human-readable form.

Note that whilst this library is locale-aware, it currently only includes an English implementation.

Who?

Thanks goes to these wonderful people (emoji key):


Kent Boogaart

💻

Arun Prakash

💻

This project follows the all-contributors specification. Contributions of any kind welcome!

Special thanks to these inspirational open source libraries:

カテゴリー

依存関係

依存関係一覧 4 件

ソースリポジトリ

このパッケージを使用しているプロジェクト