finds.dev← search

// the find

Sky24n/common_utils

★ 1,456 · Dart · BSD-2-Clause · updated Jan 2023

Dart common utils library. DateUtil, EncryptUtil, JsonUtil, LogUtil, MoneyUtil, NumUtil, ObjectUtil, RegexUtil, TextUtil, TimelineUtil, TimerUtil. 包含日期,正则,倒计时,时间轴等工具类。

A Dart utility library covering the standard grab-bag of helper functions Flutter developers end up writing themselves: date formatting, number precision, regex validation, money conversion, countdown timers, and a few others. It's primarily aimed at Chinese-market Flutter apps — the regex validators target Chinese phone numbers, ID cards, and QQ numbers, and the README is mostly in Chinese. Western-audience Flutter projects will find maybe half of it directly useful.

NumUtil uses the `decimal` package for arithmetic, so you actually get correct money math instead of floating-point surprises. TimelineUtil's configurable locale abstraction (the `TimelineInfo` interface) lets you plug in any language's relative-time strings without forking the library. TextUtil's bank card formatter and phone number masking are the kind of finicky string ops that are annoying to get right from scratch. The library is pure Dart with no Flutter dependency, so it works in non-UI Dart contexts too.

Last commit was January 2023 — three years of Dart SDK evolution with no updates. Dart 3 brought null safety improvements, records, and patterns that make several of these utilities look dated; ObjectUtil's isEmpty checks in particular are clunky against what you can do with null-aware operators and pattern matching now. The EncryptUtil XOR cipher is not encryption — it's obfuscation with a fixed key passed as a string, and the README presents it alongside MD5 and Base64 as if they're equivalent security tools. RegexUtil's phone and ID card patterns are China-specific with no documentation of that fact in the English README, which will silently give wrong results for developers who don't notice. No tests are included in the repo.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →