
Stop writing the same utility functions in every Flutter project. This library contains 400+ production-hardened extension methods and utilities extracted from a real-world Flutter app with thousands of active users.
π Every utility meets one standard
Each method in this library is held to the same bar β no exceptions:
- World-class code. Pure, tree-shakeable, null-safe Dart that passes
dart analyzeand the fullsaropa_lintsrule set (1,000+ rules) with zero issues.- Detailed documentation. Every public member carries dartdoc that explains the why β the failure mode it guards, the edge cases it handles, and a runnable example.
- Bullet-proof test coverage. Every method is backed by unit tests covering happy paths, empty/null inputs, Unicode, and boundary conditions (5,900+ tests and counting).
If a contribution does not clear all three, it does not ship.
Production-Proven, Not Theoretical
These utilities aren't academic exercisesβthey're dog-fooded daily in Saropa Contacts, a production Flutter app available on both Google Play and the App Store. Every method has been refined through real user feedback and edge cases you only discover in production.
What this means for you:
- Edge cases already handled (empty strings, nulls, Unicode, timezone issues)
- Performance optimized for mobile devices
- API design proven intuitive through actual usage
- Bugs already found and fixed by real users
Why Choose This Library
| Before | After |
|---|---|
text != null && text.isNotEmpty ? text : fallback |
text.orDefault(fallback) |
if (date != null && date.isAfter(start) && date.isBefore(end)) |
date.isBetween(start, end) |
list.length > index ? list[index] : null |
list.itemAt(index) |
"${n}${n == 1 ? 'st' : n == 2 ? 'nd' : ...}" |
n.ordinal() |
| Writing regex for email extraction | text.between("@", ".") |
One import. Zero boilerplate. Full null-safety.
What's Included
π Full index:
CAPABILITIES.mdis a complete, per-symbol catalog β every public utility with a one-line description and its import path, grouped by category. The table below is the high-level map; that file is the searchable detail for teams evaluating the library.
| Category | Scope | Highlights |
|---|---|---|
| String | 110+ extensions, 30+ utils | Case conversion, truncation, wrapping, searching, grammar, diacritics, Unicode-safe ops; Levenshtein, slug/mask/template, diff (Myers), fuzzy search, excerpt, markdown, HTML sanitizer, name parsing |
| DateTime | 50+ extensions, 10+ utils | Age calculation, range checks, date arithmetic, leap years, week numbers; bounds, business days, duration format/parse, fiscal, relative, time rounding, injectable clock |
| List/Iterable | 40+ extensions | Safe access, deduplication, frequency analysis, order-independent comparison; chunks, partition, groupBy, run-length, binary search, rotate |
| Collections | 38 modules | LIS, LCS, sliding window, reservoir sampling, trie, disjoint set, DamerauβLevenshtein, knapsack, bloom filter, n-way merge, ring buffer, multiset, histogram, k-means, weighted interval, string pool, seeded shuffle, and more |
| Graph | 15 modules | BFS/DFS, Dijkstra, A*, connected components, topological sort, MST, critical path, bipartite, tree utils, DAG scheduler |
| Stats | 16 modules | Robust stats, moving average, normalization, quantile summary, correlation, linear regression, confidence intervals, funnel, retention, sampling, outlier (MAD), feature encoding |
| Validation | 12 modules | Validation errors, path/input shaping, guards, cross-field validation, safe temp names, password strength, PII detection, data redaction, safe parse, typed positives, IP/CIDR, JWT structure |
| Async | 22 modules | Debounce, throttle, delay, retry (with backoff/policy), memoize future, sequential/batch, cancel previous, semaphore, mutex, stream buffer/window, exponential backoff, circuit breaker, barrier, timeout policy, race/cancel, idempotent, heartbeat |
| Number | 25+ extensions, 15+ utils | Ordinals (1st, 2nd, 3rd), range clamping, digit ops; math (gcd, lcm), lerp, stats (variance, median, percentile), prime, factorial, locale format/parse, safe division |
| Map | 15+ extensions, 5+ utils | Nested access, pretty printing, null-safe ops; deep merge/copy, flatten keys, diff, invert, pick/omit, transform |
| Parsing | 22 modules | CSV, email, phone (E.164), Luhn, ISBN, SemVer, version compare, hex color, bool, list-from-string; config precedence, CSV dialect, canonicalize JSON, changelog section, JSON diff/patch, nested query, varint |
| Caching | 4 modules | LRU cache, TTL cache, size-limited cache, memoize (sync) |
| URL/Path | 8+ modules | Path join/extension/normalize, URL encode/query/build/absolute, path_more (directory, base name, bearer token) |
| Bool | 8+ | Flexible string parsing ("yes"/"1"/"true"), iterable analysis |
| Niche | 10+ | Color (hex/rgb, luminance, contrast), name (abbreviate, initials), pad/format, random string, hash, string diff, checksum, natural sort, UUID v4 |
| Object/Pipe | 12+ | Pipe, compose, once; nullable (whenNonNull, mapNonNull, tryCast); assert, coalesce, require, shallow copy, copyWithDefaults |
| Utilities | 25+ | JSON validation/type/iterables, Base64, UUID, Hex, HTML entities, gesture types, regex common/match, debug (testing) |
Installation
Run from your project directory:
flutter pub add saropa_dart_utils
Or for a pure Dart project:
dart pub add saropa_dart_utils
Then import it:
import 'package:saropa_dart_utils/saropa_dart_utils.dart';
For minimal bundle size, import only what you use (tree-shaking friendly):
import 'package:saropa_dart_utils/string/string_extensions.dart';
import 'package:saropa_dart_utils/datetime/date_time_extensions.dart';
import 'package:saropa_dart_utils/async/debounce_utils.dart'; // or throttle_utils, retry_utils, etc.
Tree-shaking checklist
Your release binary only carries the utilities you actually call β the barrel import is not a hidden "pull in everything" cost. Confirm:
- β
Barrel or leaf import β same shipped size. Importing
saropa_dart_utils.dartbrings names into scope, not code into the binary. AOT (flutter build,dart compile) anddart compile jskeep only what's reachable from yourmain(). Leaf imports help namespace hygiene and debug-build load time, not release size. - β Extensions shake per method. Call one method on an extension and only that method (plus its transitive calls) survives β not the whole file.
- β
No startup cost from unused code. The package adds no
vm:entry-pointpragmas, nodart:mirrors, and no eager top-level side effects; its internal regex/const helpers are lazyfinals that never run unless a used method touches them. - β οΈ Tree-shaking is a release-build behavior. Debug/JIT runs (
flutter run,dart run) load everything by design β judge size from a release build, never a debug one. - β οΈ Download size is separate.
pub getstill fetches the full source into.pub-cache; that's disk, not app binary, and is unaffected by tree-shaking.
Quick Start Examples
Drop-in solutions for common Flutter development tasks:
String Extensions (110+ methods)
// Null safety
String? text;
text.isNullOrEmpty; // true
"hello".isNotNullOrEmpty; // true
// Case manipulation
"hello world".titleCase(); // "Hello world"
"hello world".capitalizeWords(); // "Hello World"
// Formatting
"Saropa".wrapSingleQuotes(); // 'Saropa'
"Saropa".encloseInParentheses(); // (Saropa)
// Truncation
"Long text here".truncateWithEllipsis(10); // "Long text β¦"
// Cleaning
"www.saropa.com".removeStart("www."); // "saropa.com"
" extra spaces ".compressSpaces(); // "extra spaces"
"abc123".removeNonNumbers(); // "123"
// Searching
"test@example.com".between("@", "."); // "example"
// Grammar
"apple".pluralize(3); // "apples"
"John".possess(); // "John's"
"apple".grammarArticle(); // "an"
// Diacritics
"cafe".removeDiacritics(); // "cafe"
DateTime Extensions (50+ methods)
DateTime date = DateTime(2024, 1, 15);
// Comparisons
date.isToday();
date.isBeforeNow();
date.isSameDateOnly(otherDate);
date.isBetween(start, end);
// Manipulation
date.addYears(1);
date.addMonths(2);
date.addDays(10);
date.nextDay();
date.prevDay();
// Age calculation
DateTime(1990, 5, 15).calculateAgeFromNow();
birthDate.isUnder13();
// List generation
DateTime.now().generateDayList(7); // 7 days, starting today
List Extensions (30+ methods)
// Comparison
[1, 2, 3].equalsIgnoringOrder([3, 2, 1]); // true
['a', 'a', 'b'].topOccurrence(); // 'a'
// Safe access
[1, 2, 3].itemAt(10); // null (no exception)
// Null-safe operations
items.addNotNull(maybeNull);
// Deduplication
[1, 2, 2, 3].toUnique(); // [1, 2, 3]
Number Extensions (25+ methods)
// Ordinals
1.ordinal(); // "1st"
22.ordinal(); // "22nd"
// Range operations
15.forceBetween(1, 10); // 10
5.isBetween(1, 10); // true
// Digit counting
12345.countDigits(); // 5
Iterable Extensions (10+ methods)
[1, 2, 3, 4, 5].randomElement();
[1, 2, 3].containsAll([1, 2]);
[1, 2, 3, 4, 5].countWhere((n) => n > 3); // 2
Map Extensions (15+ methods)
final pretty = {'name': 'John', 'age': 30}.formatMap(); // Pretty print
data.removeKeys(['a', 'c']);
Bool Extensions (8+ methods)
"true".toBool(); // true
[true, true, false].countTrue; // 2
[false, false].anyTrue; // false
Enum Extensions (2+ methods)
enum Status { active, inactive }
Status.values.byNameTry("active"); // Status.active
Status.values.byNameTry("invalid"); // null (safe)
Status.values.byNameTry("ACTIVE", isCaseSensitive: false); // Status.active
Utility Classes (25+ methods)
// Hex
255.intToHex(); // 'ff'
'FF'.hexToInt(); // 255
// Random
CommonRandom(42).nextInt(10); // 0 to 9, repeatable with a seed
CommonRandom().nextDouble(); // 0.0 up to, not including, 1.0
// URL
Uri.parse("https://example.com?key=value").hasQueryParameter("key"); // true
Async (debounce, throttle, retry, circuit breaker, and more)
// Debounce a callback (no-arg)
final debouncedSearch = debounce(() => fetchSuggestions(), Duration(milliseconds: 300));
debouncedSearch(); // call when user types; runs after 300 ms of no further calls
// Retry with exponential backoff
final result = await retryWithBackoff(() => http.get(uri), maxAttempts: 3);
// Limit concurrency
final semaphore = AsyncSemaphoreUtils(2);
await semaphore.run(() => heavyWork());
Collections, Graph, Stats, Validation
// Longest increasing subsequence (top-level function)
lisLength([3, 1, 4, 1, 5, 9, 2, 6]); // 4
// Shortest distances from source (Dijkstra)
final distances = dijkstraDistances(weightedGraph, source);
// Safe parsing (no-throw, returns ParseOk/ParseErr)
final result = safeParse(int.parse, formValue);
final width = result.valueOrNull; // int? (null if parse failed)
Real-World Use Cases
These aren't contrived examplesβthey're patterns we use constantly:
// User profile display
String displayName = user.firstName.capitalizeWords();
String initials = "${user.firstName.firstCharacter()}${user.lastName.firstCharacter()}";
String age = birthDate.calculateAgeFromNow().toString();
// Form validation
bool isValidInput = email.isNotNullOrEmpty && phone.removeNonNumbers().length >= 10;
// Date logic for subscriptions
bool isTrialActive = signupDate.addDays(14).isAfterNow();
bool isBirthdayThisMonth = birthDate.isSameMonth(DateTime.now());
// Safe API response handling
String? city = (response['address'] as Map<String, dynamic>?)?.getChildString('city');
List<String> tags = (response['tags'] as List?)?.whereType<String>().toUnique() ?? [];
// UI text formatting
String preview = longDescription.truncateWithEllipsis(100);
String itemCount = "item".pluralize(cart.length); // "item" or "items"
Finding opportunities with saropa_scan (optional tooling)
saropa_scan is a separate, optional developer tool that lives in this repo. Its main job is to find places in your code where a saropa_dart_utils call could replace hand-written code. It also finds repeated code worth extracting, which is useful with or without this package. It is not part of the published saropa_dart_utils package (/tool/ and /extension/ are listed in .pubignore), so adding the library to your app does not pull it in. You run it from a checkout of this repository.
What it does:
- Finds hand-written code a
saropa_dart_utilscall replaces (for examplename[0].toUpperCase() + name.substring(1)βname.capitalize()), with a confidence score and a safety tier per suggestion. - Finds repeated code with
dupes(orscan --repeated): near-identical code in your project that should become one shared function. It works even when your project does not usesaropa_dart_utils. - Fixes with undo and provenance:
fixapplies safe fixes (try--dry-runfirst), records a run journal sofix --undocan revert it, and can leave a provenance comment at each fixed site. - VS Code extension "Saropa Utils" (
extension/, idsaropa.saropa-utils): a companion that shows both kinds of result as two peer groups in one view, in the Problems panel with quick fixes, and in the status bar (for example12 utils Β· 5 repeated). It can also suggest adding or upgradingsaropa_dart_utilsin your project, always showing the exact command first. See VS Code extension: Saropa Utils below.
Where it lives: the CLI is in tool/scanner (see its README and user guide); the extension is in extension/.
Run it in three commands (needs the Dart SDK; the executable is saropa_scan, run dart run saropa_scan:saropa_scan --help to list every command):
cd tool/scanner && dart pub get
dart run saropa_scan:saropa_scan scan /path/to/your/project --repeated
dart run saropa_scan:saropa_scan fix /path/to/your/project --dry-run
Drop --repeated to scan for saropa_dart_utils opportunities only. For a faster, Dart-free start, dart compile exe bin/saropa_scan.dart -o saropa_scan builds a standalone binary.
Status: pre-release (scanner 0.1.0), not published to pub.dev or the VS Code Marketplace; the extension (version equal to this package) has its own Status below. Findings are suggestions: review them before applying anything beyond the safe tier.
Older script: suggest_saropa_utils
A CLI tool scans Dart files and suggests places where saropa_dart_utils can replace boilerplate (e.g. name[0].toUpperCase() + name.substring(1) β name.capitalize(), items.sublist(items.length - n) β items.takeLast(n), s ?? '' β s.orEmpty()). Every suggestion is audited against the real API and checked not to degrade your code β it will not push you toward getters like isNullOrEmpty that defeat Dart's null promotion. Run from this repo:
# With path: non-interactive, report to stdout (e.g. for CI)
dart run tool/suggest_saropa_utils.dart /path/to/your/flutter_app
# Without path: interactive β asks Y/N/? for directory, output format, and apply
dart run tool/suggest_saropa_utils.dart
dart run tool/suggest_saropa_utils.dart --help
Only [path], --help, and --version are accepted. Interactive prompts ask for directory, report vs JSON, and whether to apply (apply not yet implemented). Type ? on any prompt for help. No edits are made; use the report to refactor manually.
VS Code extension: Saropa Utils
The companion extension for the saropa_dart_utils package. It finds where your code could use saropa_dart_utils and repeated code worth extracting, and it is useful with or without the package installed. Extension id: saropa.saropa-utils; its version always equals the saropa_dart_utils package version in pubspec.yaml (a test enforces it), and it has no README or changelog of its own: this section and the Extension: entries in CHANGELOG.md are the source. Commands, views and settings use the saropaUtils. prefix (renamed from saropaScanner., see Migration). It runs the saropa_scan command line scanner for you.
Two peer results, both first-class:
- saropa_dart_utils opportunities: hand-written code that a package member replaces ("
nullIfEmpty- 14 places"), with one-click quick fixes. - Repeated code: near-identical code inside your own project that should become one shared function. Works even when
saropa_dart_utilsis not a dependency; the extension then offers to add it.
Status
Pre-release, not published to the Marketplace. The extension compiles, type-checks and has unit tests for its pure logic (npm test, no Dart needed, plus an opt-in test against the real CLI). It has run once in a real VS Code 1.105.1 Extension Host (through code-server driven by headless Chromium, see extension/test-host/README.md), in a trusted and an untrusted workspace, against a compiled saropa_scan: activation, commands, scan to Problems, tree, status bar, quick fix, report tab, version nudge toast and trust gating passed. That run found an activation-order crash that unit tests could not see; it is fixed in the current code. Not yet verified:
- The Electron desktop app (the run used the web workbench with the real Extension Host), Windows and macOS, a real Dart-Code installation (a fixture stood in for the
dartlanguage id), remote/SSH hosts, scan-on-save under load, and the pub.dev lookup. - The download flow has not been tried against a real release; the release pipeline (
plans/scanner/RELEASE_PIPELINE.md) has not run, so there are no bundled platform binaries or manifest yet.
Known limitations:
- Virtual workspaces are not supported (the scanner runs a local process on files on disk).
- Untrusted workspaces are supported only in a limited way (see Workspace trust).
- It activates only when the workspace contains a
pubspec.yaml(root or one folder down). - Quick fixes need the Dart language to be registered (the Dart extension); without it the code actions do not apply.
Features
- Findings view: one "Saropa Utils" view in the Explorer with two peer top-level groups, both expanded when they have results: "saropa_dart_utils opportunities" first, "Repeated code" second. "Group Findings By..." (util member, rule, folder, kind) applies to both; the choice is remembered per workspace. An empty view offers both commands.
- Commands: "Find opportunities to use saropa_dart_utils" is first in the palette; "Find repeated code" is its peer; "Scan Workspace (both)" runs both.
- Status bar: headline with both counts, for example
12 utils Β· 5 repeated; the tooltip shows the CLI in use and the package version line. It shows a waiting hint while a save-triggered scan yields to a busy machine. - Problems panel: one diagnostic per finding (
source: saropa_scan,code: <ruleId>), capped bysaropaUtils.maxFindings. - Quick fixes: "Replace with ...", "Replace all
- Report screen: headline "N opportunities to use saropa_dart_utils", a
saropa_dart_utils <version> (catalog built for <version>)line, the scanner in use and its version; section 1 opportunities by util and location, section 2 repeated-code clusters, then breakdowns, adoption trend and JSON/Markdown/CSV export. - Version sync (below), Doctor, Explain This Finding, Add to Exclude List,
.saropa_scan/logs. - Scan on save: scans only the saved file with the fast utils scan (catalog and library match). Repeated-code analysis is whole-project, so it is not run on save purely for cost;
saropaUtils.scanOnSave.includeRepeatedCodeturns it on.
Version sync
The extension reads every pubspec.yaml (and the nearest pubspec.lock) under the workspace, including pub workspaces and melos layouts, and records per package whether saropa_dart_utils is a dependency, from where (hosted, path, git, dev dependency, override) and which version is resolved. It compares that with the version the scanner catalog was built for (saropa_scan doctor --json, check versions, field catalogTarget).
- It can show one notification, at most once per session per workspace, only in a trusted workspace:
- Add saropa_dart_utils when it is absent but findings suggest it. Runs
dart pub add saropa_dart_utils(orflutter pub add ...when the pubspec depends on Flutter). - Upgrade to when the resolved version is older than the catalog target (or, if you opt in, the latest on pub.dev). Runs
dart|flutter pub upgrade saropa_dart_utils(with--major-versionswhen the constraint does not admit the target). Path dependencies are never nudged. - Not now (quiet for 24 hours) and Don't ask again for this workspace (stored in workspaceState).
- Add saropa_dart_utils when it is absent but findings suggest it. Runs
- Nothing runs silently: every action opens a modal showing the exact command and folder, then runs it as a visible task terminal. With several pubspecs you choose which one.
- No network call by default.
saropaUtils.versionCheck.pubDev(off, user-level) allows one cached request per day topub.devfor the latest version; it never blocks, sends nothing about you, and failures are cached too. - Commands: Check saropa_dart_utils Version, Add saropa_dart_utils to a Package, Upgrade saropa_dart_utils. The API has
getUtilsVersionInfo().
The scanner and being a good neighbour
The extension runs the saropa_scan CLI; it does not scan itself. It finds the CLI in this order: saropaUtils.cli.path, the binary bundled in the platform VSIX (bin/<platform>-<arch>/), saropa_scan on PATH, a previously downloaded copy, an on-demand download, and finally dart run (with a warning). The download asks once and shows the URL, size and SHA-256 from the release manifest (saropa_scan-manifest.json, pinned to the bundled scannerVersion tag); the file is verified against that SHA-256 before it is ever run, and a mismatch deletes it. Declining falls back to the Dart source and is remembered ("Download Scanner CLI" asks again). The scanner version is compared with the range derived from scannerVersion in package.json, and a warning appears if it is outside it.
- One scan at a time per window (not configurable, because two concurrent scans only compete for CPU and the cache and make a loaded machine, for example one running Saropa Lints, slower): save-triggered scans cancel the running one; explicit commands queue behind it. Across windows the CLI's own lock decides.
- Polite mode (
saropaUtils.politeMode, default on): scans pass--priority low --jobs auto --lock waitwhen the installed CLI supports them (probed once with--help; unknown flags are omitted). Exit code 75 means another scan holds the lock: the extension shows "Another scan is already running (waiting...)" and retries with a growing delay (2 s up to 30 s, about 10 minutes at most), never in a tight loop. - Busy machine: before a save-triggered scan it checks the 1-minute load (above 70% of cores, or 50% while the Saropa Lints extension is active) and free memory (
saropaUtils.minFreeMemoryMb). If busy, the scan waits, with a status-bar hint, and runs when the machine settles. Explicit commands always run (at low priority). Load average is not available on Windows, where only the memory check applies. - No scanner process stays alive when idle. On cancel, window close or deactivate the child and its process group are killed (
taskkill /Ton Windows). If the extension host itself crashes a child could outlive it; the CLI lock keeps that harmless.
Requirements
- VS Code 1.85 or newer.
- The
saropa_scanCLI: bundled in platform VSIXes, or downloaded on first use, or built from a checkout ofsaropa_dart_utils(needs the Dart SDK; not published to pub.dev):
cd tool/scanner
dart pub get
dart run saropa_scan:saropa_scan --help # sanity check
Then point the extension at it. Open Settings and set saropaUtils.scannerPath to the scanner package folder (for example tool/scanner; relative paths resolve against the workspace folder). saropaUtils.command (default dart run saropa_scan:saropa_scan) is run with that folder as working directory. To use a compiled binary instead (dart compile exe bin/saropa_scan.dart -o saropa_scan, see tool/scanner/docs/USER_GUIDE.md for catalog notes), set saropaUtils.command to the binary path.
Migration from "Saropa Dart Scanner" (saropaScanner.*)
Commands, views, context keys and settings were renamed to saropaUtils.*. Settings under the old prefix are still read as a fallback (only when the new key was never set, and for machine-scoped keys only from user settings), so existing configuration keeps working; save a setting once under the new name to migrate it. Whether VS Code returns values for a no-longer-contributed prefix has not been tried in a live host. The old command ids are not kept as aliases.
Workspace trust
Scanning runs an external command, so the extension declares limited support for untrusted workspaces: scanning is disabled until you trust the folder, and a prompt offers "Manage Workspace Trust". saropaUtils.command, scannerPath, cli.path, changedSince and fix.git/commitPer/comment (everything that becomes a process or a command line argument) are machine-scoped and restricted; changedSince is also validated as a plain git ref (no leading -) and passed as --changed-since=<ref>, and exclude globs as --exclude=<glob>, so a workspace's .vscode/settings.json cannot change them; set them in your user settings. The HTML report also needs a trusted workspace.
Commands
| Title | Command id |
|---|---|
| Find opportunities to use saropa_dart_utils | saropaUtils.findOpportunities |
| Find repeated code | saropaUtils.runDupes |
| Scan Workspace (both) | saropaUtils.scanWorkspace |
| Scan File | saropaUtils.scanFile |
| Check saropa_dart_utils Version | saropaUtils.checkVersions |
| Add saropa_dart_utils to a Package | saropaUtils.addPackage |
| Upgrade saropa_dart_utils | saropaUtils.upgradePackage |
| Download Scanner CLI | saropaUtils.downloadCli |
Upgrade Package Then Replace (hidden; takes {id}) |
saropaUtils.upgradeThenFix |
| Fix All Safe | saropaUtils.fixAllSafe |
| Open HTML Report | saropaUtils.openHtmlReport |
| Show Run Log | saropaUtils.showRunLog |
| Refresh Catalog | saropaUtils.refreshCatalog |
| Doctor | saropaUtils.doctor |
| Explain This Finding | saropaUtils.explainFinding |
| Cancel Running Scan | saropaUtils.cancel |
| Reveal Finding | saropaUtils.revealFinding |
| Open Report Screen | saropaUtils.openReport |
| Add to Exclude List | saropaUtils.excludeAdd |
| Open Settings | saropaUtils.openSettings |
| Group Findings By... | saropaUtils.groupBy |
| Edit Exclude List | saropaUtils.excludeList |
| Fix Finding | saropaUtils.fixFinding |
revealFinding and fixFinding are hidden from the Command Palette (they take a finding {id}); scanFile appears for Dart files, in the editor and Explorer context menus.
Settings
| Setting | Type | Default | Description |
|---|---|---|---|
saropaUtils.command |
string | dart run saropa_scan:saropa_scan |
Command used to launch the scanner CLI. Run with the scanner package as working directory unless scannerPath is set. Machine-scoped. |
saropaUtils.scannerPath |
string | "" |
Directory of the saropa_scan package (e.g. tool/scanner). Relative paths resolve against the workspace folder. Used as cwd for the command; empty means the workspace folder. Machine-scoped. |
saropaUtils.minConfidence |
number | 0.7 |
Minimum finding confidence (0-1). |
saropaUtils.safetyLevel |
string (safe, review) | safe |
Highest fix safety level applied by bulk fixes. |
saropaUtils.lowPriority.mode |
string (skip, low, normal) | low |
How tests, examples and tooling are treated: report separately (low), skip, or treat as normal. |
saropaUtils.lowPriority.globs |
array | ["**/test/**", "**/integration_test/**", "**/*_test.dart", "**/example/**", "**/benchmark/**", "**/tool/**"] |
Globs identifying low-priority code (tests, examples). Used to filter the Report screen. |
saropaUtils.jobs |
number | 0 |
Parallel scan jobs passed as --jobs. 0 lets the scanner choose (cores minus one). |
saropaUtils.dupes.complexityWeight |
boolean | true |
Rank duplicate clusters by code complexity as well as size. Off passes --no-complexity-weight. |
saropaUtils.fix.comment |
string (off, brief, full) | brief |
Machine-scoped. Provenance comment the CLI leaves at each fixed site (fix --comment). |
saropaUtils.fix.git |
boolean | false |
Machine-scoped. Let the CLI fix command commit applied fixes with provenance trailers. Off passes --no-git. |
saropaUtils.fix.commitPer |
string (rule, cluster, run) | run |
Machine-scoped. Commit granularity when saropaUtils.fix.git is on (fix --commit-per). |
saropaUtils.exclude |
array | ["**/build/**", "**/.dart_tool/**", "**/*.g.dart"] |
Glob patterns excluded from scanning (passed as --exclude). Use the Explorer context menu "Add to Exclude List" or the "Edit Exclude List" command. |
saropaUtils.scanOnSave |
boolean | true |
Scan the saved file (fast utils scan) on save; skipped or delayed while the machine is busy. |
saropaUtils.scanOnSaveDebounceMs |
number | 800 |
Debounce in milliseconds for scan-on-save. |
saropaUtils.changedSince |
string | "" |
If set, workspace scans use --changed-since=<ref>. Only plain git refs are accepted. Machine-scoped. |
saropaUtils.cli.path |
string | "" |
Absolute path of the saropa_scan executable (highest priority). Machine-scoped. |
saropaUtils.politeMode |
boolean | true |
Low priority, auto jobs, wait on the CLI lock. |
saropaUtils.scanOnSave.includeRepeatedCode |
boolean | false |
Also run the whole-project repeated-code analysis after a save scan (off only for cost). |
saropaUtils.versionNudge.enabled |
boolean | true |
Show the add/upgrade notification. |
saropaUtils.versionCheck.pubDev |
boolean | false |
Opt in to one cached daily pub.dev lookup for the latest version. Machine-scoped. |
saropaUtils.maxFiles |
number | 20000 |
Maximum number of Dart files indexed by the extension for previews (protects very large workspaces). |
saropaUtils.maxFindings |
number | 5000 |
Maximum findings published to the Problems panel; the Report screen still lists them. |
saropaUtils.minFreeMemoryMb |
number | 256 |
Delay scan-on-save while free memory is below this many MB. 0 disables the guard. |
Large-workspace safeguards: file listing and Problems output are capped, scan-on-save is debounced and backs off under memory pressure, and the CLI is always spawned asynchronously.
API for other extensions
activate() returns a ScannerApi (extension/src/api/api-types.ts, apiVersion: 1): getVersion(), getFindings(filter?), getSummary(), getUtilsVersionInfo() (pubspec facts, resolved version, catalog target, and the latest version only when the pub.dev lookup is on), runScan({file?}) (resolves false if it failed, was cancelled or the workspace is untrusted) and onDidChange. Each finding may carry needsUpgrade: { minVersion } (the util needs a newer saropa_dart_utils) and root (absolute folder the relative file belongs to). Plain readonly data only; changes are additive within a version.
const api = vscode.extensions.getExtension<ScannerApi>('saropa.saropa-utils')?.exports;
if (api?.apiVersion === 1) { await api.runScan(); api.getFindings({ fixableOnly: true }); }
Stable deep-link command ids: saropaUtils.revealFinding {id}, saropaUtils.fixFinding {id}, saropaUtils.scanFile {uri | relative path}, saropaUtils.openReport. Finding ids come from getFindings().
Troubleshooting
- Nothing happens / "scanning is disabled": trust the workspace (Manage Workspace Trust).
- Scan fails to start: check the scanner line in the Report (which CLI is used), then run "Saropa Utils: Doctor". Check
saropaUtils.scannerPathpoints at the scanner package anddart pub getwas run there; check the output channel and "Show Run Log" (.saropa_scan/run.log). - Settings in the workspace are ignored:
command,scannerPath,cli.path,changedSinceand thefix.*options only work from user settings. - View is missing: it appears only in workspaces containing a
pubspec.yaml. - Too few findings: lower
minConfidence; tests, examples and tooling are reported as low priority by default (lowPriority.mode). - Slow in a huge workspace: lower
jobs/maxFiles, add excludes, or setchangedSinceto a git ref.
Development
cd extension
npm install
npm run compile # verify-nls + type-check + esbuild bundle to dist/
npm test # vitest, pure logic; no Dart needed
npm run lint
npm run vsix # package a .vsix
Tests cover pubspec/lock parsing, version comparison, nudge decisions, pub command building, CLI discovery order, manifest/SHA verification, exit-75 backoff, the scan queue, the busy-machine gate and argument safety. The real-host test is in test-host/ (see its README); it is not part of npm test. Press F5 in VS Code with the extension/ folder open to launch an Extension Development Host (not yet done by hand for this release; see Status).
Lint configuration
This package uses saropa_lints. Some rules are disabled for a pure Dart utility library (e.g. barrel file for the main entry point, non-ASCII in source for Unicode handling, static state for shared RegExp/constants). Others are satisfied by code fixes or inline suppressions (e.g. collapsed ifs in json_utils, named booleans in html_utils, redundant else removed, long-parameter-list and similar-names suppressed where intentional). Rationale for each override or resolution is in analysis_options_custom.yaml.
Documentation
- API Reference β Full method documentation with examples
- GitHub β Source code and issue tracking
- Changelog β Version history
Contributing
We welcome contributions! These utilities grew from solving real problemsβif you've got a helper that's saved you time, it might help others too.
About Saropa
Saropa builds technology for personal safety and emergency preparedness. This utility library was extracted from Saropa Contactsβour production Flutter app for managing trusted emergency contactsβbecause we believe good utilities should be shared, not rewritten.
Libraries
- async/async_barrier_utils
- Async barrier: wait for N events β roadmap #676.
- async/async_more_utils
- async/async_mutex_utils
- Async mutex with tryLock β roadmap #652.
- async/async_semaphore_utils
- Async semaphore with permits (roadmap #651).
- async/batch_async_utils
- async/batch_flush_utils
- Batch/flush: collect events and flush on size/time β roadmap #671.
- async/bounded_work_queue_utils
- Bounded async work queue with backpressure β roadmap #654.
- async/cancel_previous_exception
- async/cancellation_token_utils
- Cooperative cancellation tokens β roadmap #674.
- async/circuit_breaker_utils
- Circuit breaker (closed / open-with-timeout) β roadmap #657.
- async/compute_stream_transformer
- Stream transformer that runs each event through Flutter's
compute()(a one-shot background isolate), keeping CPU-bound per-event work off the UI thread. From Saropa Contacts. - async/debounce_utils
- async/delay_utils
- async/exponential_backoff_utils
- Exponential backoff helper (roadmap #677).
- async/heartbeat_utils
- Heartbeat/keepalive for long-running tasks β roadmap #675.
- async/idempotent_async_utils
- Idempotent async wrapper (deduplicate concurrent calls by key) β roadmap #668.
- async/memoize_future_utils
- async/observability_utils
- Observability helpers: wrap operations with timing and outcome hooks β roadmap #680.
- async/race_cancel_utils
- Race producers, first success wins β roadmap #667. Losers are NOT cancelled (they run fire-and-forget to completion; only their results are dropped).
- async/rate_limiter_utils
- Token-bucket rate limiter β roadmap #670.
- async/read_write_lock_utils
- Async read/write lock β roadmap #653.
- async/resource_pool_utils
- Async resource pool with a fixed maximum size β roadmap #666.
- async/retry_policy_utils
- Retry policy (fixed, backoff, jitter) β roadmap #656.
- async/retry_utils
- async/sequential_async_utils
- async/sliding_window_rate_limiter_utils
- Sliding-window-log rate limiter β roadmap #685.
- async/stream_buffer_utils
- Stream buffering (bufferCount, bufferTime-style) β roadmap #664.
- async/stream_combine_utils
- Stream join/zip/combineLatest operators β roadmap #661.
- async/stream_debounce_utils
- Debounce a stream: emit an item only after a quiet gap. Roadmap #185.
- async/stream_window_utils
- Stream windowing (time- and count-based) β roadmap #660.
- async/task_scheduler_utils
- Priority task scheduler with a concurrency limit β roadmap #655.
- async/throttle_utils
- async/timeout_fallback_utils
- async/timeout_policy_utils
- Async timeout with fallback β roadmap #669.
- base64/base64_utils
- base64/gzip_codec_io
- IO-based gzip implementation using
dart:io. - base64/gzip_codec_stub
- Stub gzip implementation for platforms without
dart:io(e.g., web). - bool/bool_iterable_extensions
- bool/bool_sort_extensions
- bool/bool_string_extensions
- caching/cache_interface
- Generic synchronous cache interface + a write-through async adapter β roadmap #523.
- caching/lru_cache
- caching/memoize_sync_utils
- caching/mru_cache
- MRU (most-recently-used) cache with access-frequency tracking β roadmap #509.
- caching/size_limit_cache
- caching/ttl_cache
- caching/write_through_cache
- Write-through and write-back caches over async loaders β roadmap #508.
- collections/backtracking_utils
- Generic depth-first backtracking solver with pruning and result limits (roadmap #486).
- collections/balanced_partition_utils
- Balanced partitioning (K partitions with similar sums) β roadmap #474.
- collections/bimap_utils
- Bi-directional map (keyβvalue both unique) β roadmap #514.
- collections/bin_packing_utils
- Greedy bin packing (items into bins with capacities) β roadmap #475.
- collections/bk_tree_utils
- BK-tree for approximate string matching β roadmap #493.
- collections/bloom_filter_utils
- Bloom filter with tunable false positive rate β roadmap #455.
- collections/chunk_overlap_utils
- Chunk + overlap windows for streaming β roadmap #465.
- collections/columnar_view_utils
- Columnar view of list<Map<String, Object?>> for analytics β roadmap #470.
- collections/constrained_subset_utils
- Weighted random subset selection without replacement β roadmap #476.
- collections/damerau_levenshtein_utils
- Edit distance with transpositions (DamerauβLevenshtein) β roadmap #443.
- collections/dedup_set_expiry_utils
- Deduplicating set with expiry (for idempotency) β roadmap #511.
- collections/dependency_resolver_utils
- Dependency resolver with version constraints β roadmap #540.
- collections/difference_array_utils
- Difference arrays for efficient range updates β roadmap #484.
- collections/disjoint_set_utils
- Disjoint-set / union-find with path compression (roadmap #496).
- collections/fenwick_tree_utils
- Fenwick tree (Binary Indexed Tree) for prefix sums β roadmap #483.
- collections/greedy_set_cover_utils
- Greedy set cover approximation β roadmap #447.
- collections/hierarchical_cluster_utils
- Agglomerative hierarchical clustering (small N) β roadmap #450.
- collections/histogram_utils
- Histogram builder with fixed and quantile-based bins β roadmap #473.
- collections/hyperloglog_utils
- HyperLogLog-lite approximate distinct count β roadmap #454.
- collections/interval_scheduling_utils
- Interval scheduling: max non-overlapping intervals (roadmap #445).
- collections/interval_tree_utils
- Interval tree for overlap (stabbing) queries β roadmap #494.
- collections/inverted_index_utils
- In-memory inverted index for small datasets β roadmap #456.
- collections/item_similarity_utils
- Co-occurrence item-to-item similarity recommender (roadmap #490).
- collections/kmeans_utils
- K-means clustering (small K, small N) β roadmap #449.
- collections/knapsack_utils
- 0/1 Knapsack solver with reconstruction β roadmap #444.
- collections/lazy_combinatorics_utils
- Lazy combinatorial generators β permutations, combinations, cartesian product, power set (roadmap #488).
- collections/lcs_sequence_utils
- Longest common subsequence (LCS) of two lists. Roadmap #69.
- collections/lcs_substring_utils
- Longest common substring (not subsequence) for two lists/strings (roadmap #442).
- collections/lis_utils
- Longest increasing subsequence (LIS) with reconstruction (roadmap #441).
- collections/lru_lfu_cache_utils
- LRU/LFU hybrid eviction cache β roadmap #480.
- collections/min_max_heap_utils
- Min-max heap: a double-ended priority queue β roadmap #499.
- collections/multi_criteria_sort_utils
- Multi-criteria sort with weighted comparators β roadmap #462.
- collections/multi_index_collection_utils
- Multi-index collection β roadmap #505.
- collections/multi_key_group_utils
- Group and aggregate by several keys at once β roadmap #477.
- collections/multiset_utils
- Multi-set (bag) union/intersection/difference β roadmap #464.
- collections/nway_merge_utils
- N-way merge of multiple sorted iterables β roadmap #457.
- collections/online_mean_variance_utils
- Online mean/variance for numeric streams β roadmap #466.
- collections/pareto_frontier_utils
- Pareto frontier / dominance filtering in 2-3 dimensions β roadmap #463.
- collections/pivot_unpivot_utils
- Pivot for tabular data (list of maps) β roadmap #469.
- collections/prefix_frequency_utils
- Prefix frequency table (for autocomplete) β roadmap #481.
- collections/priority_map_utils
- Priority map (priority -> queues) β roadmap #528.
- collections/quickselect_utils
- Quickselect: the k-th smallest/largest element without fully sorting. Roadmap #52.
- collections/reservoir_sampling_utils
- Reservoir sampling for streaming data (roadmap #452).
- collections/ring_buffer_utils
- Ring buffer (bounded queue with overwrite) β roadmap #500.
- collections/rolling_hash_utils
- Rolling hash (RabinβKarp style) for substring search β roadmap #482.
- collections/row_column_table_utils
- Row-oriented vs column-oriented table conversion β roadmap #525.
- collections/run_detection_utils
- Run detection (equal or increasing sequences with metadata) β roadmap #472.
- collections/seeded_shuffle_utils
- Deterministic shuffler with seed β roadmap #529.
- collections/segment_tree_utils
- Segment tree for associative range queries (sum / min / max) β roadmap #495.
- collections/session_clustering_utils
- Gap-based sessionization of timestamped items (roadmap #485).
- collections/similarity_dedup_utils
- Single-link similarity clustering and dedup β roadmap #461.
- collections/skip_list_utils
- Skip list: a probabilistic ordered set β roadmap #502.
- collections/sliding_window_aggregate_utils
- Sliding window aggregations (min/max/sum/avg over moving window) β roadmap #451.
- collections/spatial_grid_utils
- Uniform spatial grid index for 2D points β roadmap #506.
- collections/stable_matching_utils
- Stable matching via Gale-Shapley β roadmap #448.
- collections/stream_quantile_utils
- Exact streaming quantile over a retained sample β roadmap #453.
- collections/string_pool_utils
- Memory-conscious string pool (deduplicate repeating strings) β roadmap #518.
- collections/time_bucket_utils
- Time-bucketed aggregation β roadmap #468.
- collections/time_decay_counter_utils
- Exponential time-decay counter with configurable half-life β roadmap #479.
- collections/timeseries_buffer_utils
- Time-series buffer that keeps recent raw points and down-samples old ones β roadmap #510.
- collections/top_k_heap_utils
- Top-K by key, kept in a bounded sorted buffer β roadmap #459.
- collections/trie_utils
- Trie (prefix tree) with insert/delete/prefix search (roadmap #491).
- collections/weighted_interval_utils
- Weighted interval scheduling (max weight, DP) β roadmap #446.
- collections/window_functions_utils
- Window functions (lag, lead, row_number) over ordered data β roadmap #471.
- color/material_shade
- copy_with/filter_value
- datetime/billing_cycle_utils
- Monthly billing-anniversary math with end-of-month clamping β roadmap #609.
- datetime/business_calendar_utils
- Holiday-aware business calendar β roadmap #593.
- datetime/calendar_diff_utils
- Calendar diff: added / removed / changed events between two snapshots β roadmap #608.
- datetime/calendar_heatmap_utils
- GitHub-style contribution-heatmap data builders β roadmap #603.
- datetime/date_constant_extensions
- datetime/date_constants
- datetime/date_format_preset_utils
- Dashboard date-format presets (short / medium / long) β roadmap #615.
- datetime/date_time_arithmetic_extensions
- datetime/date_time_bounds_extensions
- datetime/date_time_business_days_utils
- datetime/date_time_calendar_extensions
- datetime/date_time_clamp_extensions
- datetime/date_time_compare_age_extensions
- datetime/date_time_comparison_extensions
- datetime/date_time_extensions
- datetime/date_time_fiscal_extensions
- datetime/date_time_intl_display_extensions
- Locale-correct
DateTimedisplay viaintlskeletons β the one opt-in module inlib/datetime/that pulls theintldependency. - datetime/date_time_list_extensions
- datetime/date_time_more_extensions
- datetime/date_time_nullable_extensions
- datetime/date_time_overlap_utils
- datetime/date_time_range_utils
- datetime/date_time_relative_predicate_extensions
- datetime/date_time_relative_utils
- datetime/date_time_timezone_extensions
- datetime/date_time_utils
- datetime/date_time_week_extensions
- datetime/duration_clock_format_extensions
- datetime/duration_format_utils
- datetime/duration_parse_utils
- datetime/hebrew_date_converter
- datetime/humanize_recurrence_utils
- Human-readable text for a simple recurrence rule β roadmap #599.
- datetime/injectable_clock_utils
- Injectable clock for tests (consistent "now") β roadmap #614.
- datetime/iso_interval_parse_utils
- ISO 8601 time-interval parser β roadmap #646.
- datetime/month_weekday_named_extensions
- datetime/month_weekday_utils
- datetime/period_split_utils
- Period splitting (by month/week) β roadmap #610.
- datetime/quiet_hours_utils
- "Quiet hours" helper β roadmap #613.
- datetime/rate_limit_schedule_utils
- Rate-limiting schedule shaper: max N per rolling period plus a cooldown β roadmap #612.
- datetime/recurrence_iterator_utils
- Expand a parsed RRULE into concrete occurrences β roadmap #592.
- datetime/relative_date_bucket_utils
- Relative date bucketing ("today", "yesterday", "last 7 days") β roadmap #616.
- datetime/rrule_parse_utils
- RFC 5545 recurrence-rule (RRULE) parser β a practical subset, roadmap #591.
- datetime/simple_relative_day_utils
- Calendar-day relative classification (
Today/Yesterday/Next Tuesday/Last Month) β pure-Dart, locale-free, with anullescape hatch for dates outside a ~2-month window. - datetime/sla_calculator_utils
- SLA / due-date calculator over business hours + holidays β roadmap #595.
- datetime/time_emoji_utils
- datetime/time_rounding_utils
- Flexible time rounding (nearest 5/10/15 min, ceiling/floor) β roadmap #600.
- datetime/timebox_exception
- Timebox: run within time budget β roadmap #618.
- datetime/timeseries_gap_utils
- Gap detection and grid filling for roughly-regular time series β roadmap #606.
- double/double_aspect_ratio_extensions
- double/double_close_to_extensions
- double/double_extensions
- double/double_iterable_extensions
- double/gradient_stop_range
- enum/enum_iterable_extensions
- flutter/color_extensions
- flutter/material_color_utils
- gesture/gesture_utils
- gesture/swipe_properties
- graph/astar_utils
- A* shortest path with pluggable heuristic β roadmap #534.
- graph/bfs_dfs_utils
- BFS/DFS traversal with hooks (roadmap #532).
- graph/bipartite_utils
- Bipartite graph check and partitioning β roadmap #546.
- graph/connected_components_utils
- Connected components (and optionally SCC) β roadmap #537.
- graph/critical_path_utils
- Critical path (longest path in DAG) β roadmap #550.
- graph/dag_scheduler_utils
- DAG-based task scheduler (topological + priorities) β roadmap #558.
- graph/dijkstra_utils
- Dijkstra shortest path on weighted graphs (roadmap #533).
- graph/floyd_warshall_utils
- All-pairs shortest paths (FloydβWarshall) β roadmap #536.
- graph/graph_diff_utils
- Graph diff (added/removed/changed edges) β roadmap #553.
- graph/graph_serialize_utils
- Compact text serialization for adjacency-list graphs β roadmap #554.
- graph/graph_simplify_utils
- Graph simplification: collapse degree-2 chains β roadmap #545.
- graph/graph_utils
- Graph representation helpers: adjacency list / weighted edges (roadmap #531).
- graph/hierarchy_utils
- Hierarchy flattener and builder from flat list with parent ids β roadmap #556, #557.
- graph/line_simplify_utils
- Line simplification (DouglasβPeucker) β roadmap #547.
- graph/mst_utils
- Minimum spanning tree (Kruskal) β roadmap #538.
- graph/multi_source_bfs_utils
- Multi-source breadth-first search on unweighted graphs (roadmap #535).
- graph/pagerank_utils
- PageRank via power iteration on a directed graph (roadmap #541).
- graph/path_enumeration_utils
- Enumerate all simple paths between two nodes (roadmap #543).
- graph/reachability_utils
- Transitive closure / reachability of a directed graph (roadmap #551).
- graph/topological_sort_utils
- Topological sort with cycle detection β roadmap #539.
- graph/tree_utils
- Tree utilities (LCA, depth, subtree size) β roadmap #555.
- hex/hex_utils
- html/html_entity_data
- html/html_utils
- int/int_extensions
- int/int_iterable_extensions
- int/int_nullable_extensions
- int/int_string_extensions
- int/int_utils
- iterable/comparable_iterable_extensions
- iterable/iterable_cartesian_extensions
- iterable/iterable_diff_extensions
- iterable/iterable_extensions
- iterable/iterable_first_last_extensions
- iterable/iterable_flatten_deep_extensions
- iterable/iterable_flatten_extensions
- iterable/iterable_group_by_extensions
- iterable/iterable_indexed_extensions
- iterable/iterable_list_ops_extensions
- iterable/iterable_map_not_null_extensions
- iterable/iterable_min_max_extensions
- iterable/iterable_more_extensions
- iterable/iterable_none_extensions
- iterable/iterable_pairs_extensions
- iterable/iterable_sort_extensions
- iterable/iterable_split_extensions
- iterable/iterable_stable_sort_extensions
- iterable/iterable_sum_by_extensions
- iterable/iterable_symmetric_diff_extensions
- iterable/occurrence
- iterable/run_length_utils
- json/json_epoch_scale
- json/json_iterables_utils
- json/json_type_utils
- json/json_utils
- list/list_binary_search_extensions
- list/list_default_empty_extensions
- list/list_extensions
- list/list_lower_extensions
- list/list_mutate_during_iteration_extensions
- Safe mutation-during-iteration for lists. Closes the suite's
concurrent-modificationcrash family (Suite Integration plan, R3): adding to or removing from a list inside a plainfor-inover that same list throwsConcurrentModificationError. - list/list_nullable_extensions
- list/list_nullable_string_sort_extensions
- list/list_of_list_extensions
- list/list_rotate_extensions
- list/list_shuffle_seeded_extensions
- list/list_string_extensions
- list/list_top_k_extensions
- list/make_list_extensions
- list/unique_list_extensions
- map/deep_equality_utils
- Deep equality for nested maps and lists.
- map/deep_freeze_utils
- Deep freeze: recursively unmodifiable views of maps, lists, and sets. Roadmap #90.
- map/map_deep_merge_extensions
- map/map_deep_utils
- map/map_default_extensions
- map/map_diff_utils
- map/map_extensions
- map/map_flatten_extensions
- map/map_from_entries_extensions
- map/map_initials_sort_extensions
- map/map_invert_extensions
- map/map_merge_extensions
- map/map_more_extensions
- map/map_nested_extensions
- map/map_nullable_extensions
- map/map_pick_omit_extensions
- map/map_transform_extensions
- niche/checksum_utils
- niche/color_utils
- niche/dark_colors
- niche/hash_utils
- niche/name_utils
- niche/natural_sort_utils
- niche/niche_more_utils
- niche/pad_format_utils
- niche/random_string_utils
- niche/string_diff_utils
- num/math_utils
- GCD, LCM, and related integer math.
- num/num_clamp_extensions
- num/num_compact_parse_extensions
- num/num_extensions
- num/num_factorial_utils
- num/num_format_extensions
- num/num_intl_format_extensions
- Locale-aware number formatting via
intl's CLDR data β an opt-in module that pulls theintldependency, mirroringdate_time_intl_display_extensions.dart. - num/num_iterable_extensions
- num/num_lerp_utils
- num/num_locale_utils
- num/num_min_max_utils
- num/num_modulo_utils
- num/num_more_extensions
- num/num_prime_utils
- num/num_range_extensions
- num/num_range_inclusive_extensions
- num/num_round_multiple_extensions
- num/num_safe_division_extensions
- num/num_stats_utils
- num/num_utils
- num/unit_conversion_utils
- object/assert_utils
- object/cast_utils
- object/coalesce_utils
- object/copy_with_defaults_utils
- object/default_value_extensions
- object/identity_utils
- object/nullable_more_extensions
- object/pipe_compose_utils
- Pipe (chain unary functions). Compose (f(g(x))). Once (run block only once). Roadmap #246-248.
- object/pipe_utils
- Also/let style (pipe value through function). Roadmap #202.
- object/require_utils
- object/shallow_copy_utils
- Shallow copy list/map. Roadmap #207.
- parsing/accept_language_utils
- Parse an HTTP
Accept-Languageheader into ranked language ranges. Roadmap #159. - parsing/canonicalize_json_utils
- Canonicalization (sort keys, normalize) for JSON-like data β roadmap #639.
- parsing/changelog_section_utils
- Changelog/semantic version section parser β roadmap #431.
- parsing/config_precedence_utils
- Config precedence resolver: defaults β overlay (roadmap #644).
- parsing/cron_utils
- Parse a standard 5-field cron expression and compute its next run time. Roadmap #158.
- parsing/csv_dialect_utils
- CSV/TSV dialect detector (roadmap #435).
- parsing/csv_parse_utils
- parsing/csv_writer_utils
- CSV writer with configurable dialect and RFC 4180 auto-quoting β roadmap
#622. The inverse of parseCsvLine in
csv_parse_utils.dart. - parsing/email_validation_utils
- parsing/expression_evaluator_utils
- Safe expression evaluator (arithmetic + boolean) β roadmap #634.
- parsing/flatten_explode_utils
- Flatten nested data and explode arrays for tabular/BI export β roadmap #648.
- parsing/hex_color_utils
- parsing/http_header_parse_utils
- Parse common HTTP caching headers without any HTTP dependency β roadmap #632.
- parsing/ini_parser_utils
- INI /
.envconfiguration parser β roadmap #626. - parsing/isbn_utils
- parsing/json_diff_patch_utils
- JSON diff/patch (simple key-level) β roadmap #624.
- parsing/json_model_mapper_utils
- Read typed fields from decoded JSON, collecting errors instead of throwing β roadmap #637.
- parsing/json_path_utils
- Read a value from decoded JSON by a simple dotted/indexed path. Roadmap #157.
- parsing/json_pretty_print_utils
- Pretty-print decoded JSON with configurable indentation and key sorting β roadmap #436.
- parsing/json_schema_utils
- Declarative schema validation for JSON-like data β roadmap #636.
- parsing/log_line_parser_utils
- Template-driven log line parser β roadmap #631.
- parsing/luhn_utils
- parsing/nested_query_parser_utils
- Query string parser with nested keys (a
c) β roadmap #628. - parsing/parse_bool_utils
- parsing/parse_list_utils
- parsing/parser_error_utils
- Rich parser error (line/column, context) β roadmap #647.
- parsing/parsing_more_utils
- parsing/phone_normalize_utils
- parsing/range_header_utils
- Parse an HTTP
Rangerequest header (bytes=unit only). Roadmap #160. - parsing/semver_utils
- parsing/size_parse_utils
- parsing/sql_filter_utils
- SQL-like filter for in-memory rows β roadmap #633.
- parsing/stable_hash_utils
- Order-stable structural checksum with no crypto dependency β roadmap #649.
- parsing/validate_non_empty_utils
- parsing/varint_utils
- Varint encoding/decoding (Protobuf-style) β roadmap #635.
- parsing/version_compare_utils
- parsing/version_parse_utils
- random/common_random
- regex/regex_common_utils
- regex/regex_match_utils
- saropa_dart_utils
- Saropa Dart Utils - Boilerplate reduction tools and human-readable extension methods by Saropa.
- stats/bucketed_aggregate_utils
- Bucketed aggregation (sum/count/avg/min/max per bucket) β roadmap #570.
- stats/cdf_utils
- Empirical CDF and cumulative histogram for numeric samples β roadmap #574.
- stats/change_point_cusum_utils
- Two-sided CUSUM change-point detection (roadmap #568).
- stats/confidence_interval_utils
- Confidence interval for mean (normal approximation) β roadmap #562.
- stats/correlation_utils
- Correlation coefficients (Pearson) β roadmap #563.
- stats/data_binning_utils
- Data binning helpers: width, quantile, boundary, counts (roadmap #585).
- stats/data_normalization_utils
- Data normalization (z-score, min-max scaling) β roadmap #576.
- stats/feature_encoding_utils
- Feature scaling/encoding (bucketization, one-hot) β roadmap #589.
- stats/funnel_utils
- Funnel analysis (drop-off between ordered steps) β roadmap #580.
- stats/gini_utils
- Gini coefficient β inequality measure in
0, 1(roadmap #573). - stats/grouped_stats_utils
- Per-key descriptive statistics over an iterable β roadmap #571.
- stats/linear_regression_utils
- Simple linear regression β roadmap #564.
- stats/log_transform_utils
- Log/exp transforms for analytics β roadmap #575.
- stats/metric_rollup_utils
- Metric roll-up (daily β weekly β monthly) β roadmap #587.
- stats/moving_average_utils
- Moving averages: simple, exponential (roadmap #565).
- stats/outlier_mad_utils
- Outlier detection by MAD / Z-score β roadmap #467.
- stats/percentile_rank_utils
- Percentile rank and inverse percentile β roadmap #583.
- stats/quantile_summary_utils
- Quantile summary (percentiles, median, quartiles) β roadmap #572.
- stats/retention_utils
- Retention curves (N-day retention) β roadmap #581.
- stats/robust_stats_utils
- Robust statistics: MAD, trimmed mean (roadmap #561).
- stats/rolling_correlation_utils
- Rolling (sliding-window) Pearson correlation (roadmap #577).
- stats/sampling_utils
- Sampling helpers (stratified, systematic) β roadmap #584.
- string/acronym_extract_utils
- Acronym/initialism extractor (e.g. "Saropa Dart Utils (SDU)") β roadmap #429.
- string/apply_patch_utils
- Apply patch (edit script) to string with validation (roadmap #403).
- string/between_result
- string/code_block_extract_utils
- Code block detector/extractor from mixed text (roadmap #422).
- string/did_you_mean_utils
- "Did you mean?" over dictionary (Levenshtein) β roadmap #426.
- string/diff_render_utils
- Diff β colored/HTML/ANSI unified diff renderer (roadmap #402).
- string/duplicate_doc_utils
- Near-duplicate document detector via fingerprints β roadmap #438.
- string/email_quote_strip_utils
- Email reply quote stripper (heuristic) β roadmap #424.
- string/excerpt_utils
- Smart excerpt generator: best snippet around query terms with ellipsis (roadmap #410).
- string/fuzzy_search_utils
- Fuzzy search over list of strings with token + edit distance + ranking (roadmap #406).
- string/glob_utils
- Simple glob matching (**/*.dart style).
- string/html_sanitizer_utils
- HTML-to-plain-text reducer (roadmap #439).
- string/human_name_parser_utils
- Human name parser (first/middle/last/suffix) β roadmap #409.
- string/icu_message_utils
- ICU-style message formatting lite: pluralization and
select(gender) β roadmap #414. - string/keyphrase_utils
- TF-IDF keyphrase extraction over a small corpus β roadmap #432.
- string/language_detect_utils
- Heuristic n-gram language detector (lite, best-effort) β roadmap #428.
- string/levenshtein_utils
- Levenshtein (edit) distance and similarity ratio for strings.
- string/markdown_plain_utils
- Markdown to plain text (strip markup, keep structure) β roadmap #420.
- string/markdown_snippet_utils
- Markdown snippet extractor (heading sections, first code block) β roadmap #419.
- string/myers_diff_utils
- Myers diff for strings: minimal edit script (roadmap #401).
- string/ngram_utils
- N-gram generator for strings β character and word n-grams (roadmap #405).
- string/redline_utils
- Line-based redline / track-changes diff generator β roadmap #433.
- string/safe_html_excerpt_utils
- Safe HTML excerpt (truncate without breaking tags) β roadmap #440.
- string/search_index_utils
- Simple in-memory search index (term frequency scoring) β roadmap #407.
- string/search_query_parser_utils
- Simplified search query parser (AND/OR, quotes, minus) β roadmap #418.
- string/sensitive_scrub_utils
- Sensitive data scrubber with pluggable patterns (roadmap #425).
- string/slug_dedup_utils
- Slug deduplicator: append incremental suffixes based on taken slugs (roadmap #411).
- string/soundex_utils
- Soundex phonetic encoding for English names.
- string/spelling_key_lookup_utils
- Spelling-tolerant key lookup (canonical β variants) β roadmap #416.
- string/string_analysis_extensions
- string/string_ansi_extensions
- string/string_between_extensions
- string/string_case_acronym_extensions
- string/string_case_extensions
- string/string_character_extensions
- string/string_compare_extensions
- string/string_csv_extensions
- string/string_diacritics_extensions
- string/string_extensions
- string/string_folded_compare_extensions
- string/string_highlight_extensions
- string/string_indent_extensions
- string/string_key_value_extensions
- string/string_line_extensions
- string/string_lower_extensions
- string/string_manipulation_extensions
- string/string_mask_extensions
- string/string_more_extensions
- string/string_nullable_extensions
- string/string_number_extensions
- string/string_punctuation
- string/string_regex_extensions
- string/string_replace_n_extensions
- string/string_search_extensions
- string/string_slug_extensions
- string/string_split_extensions
- string/string_template_extensions
- string/string_text_extensions
- string/string_truncate_middle_extensions
- string/string_unicode_extensions
- string/string_utils
- string/string_wildcard_extensions
- string/string_words_extensions
- string/string_wrap_extensions
- string/template_engine_utils
- Simple template engine:
{{key}}substitution only, no eval β roadmap #413. - string/text_chunk_utils
- Text segmentation into chunks for indexing (size and sentence boundaries) β roadmap #430.
- string/text_diff_structured_utils
- Structured diff of two texts by sentences and by words β roadmap #415.
- string/text_direction_parse_utils
- Pure-Dart parser for the CSS/HTML/Unicode
ltr/rtldirection tokens. - string/text_fingerprint_utils
- Text fingerprinting (order-sensitive word-hash) β roadmap #417.
- string/text_fold_utils
- Quote-aware text folding/unfolding (email-reply style) β roadmap #412.
- string/text_normalize_pipeline_utils
- Text normalization pipeline (composable steps) β roadmap #408.
- string/text_similarity_utils
- Text similarity score (cosine similarity over TF vectors) β roadmap #437.
- string/tokenize_sentences_utils
- Tokenize text into sentences and words (roadmap #404).
- string/tokenizer_pipeline_utils
- Customizable tokenizer pipeline: ordered regex rules with keep/skip β roadmap #434.
- string/unicode_class_blocks
- string/unicode_class_type
- string/unicode_class_utils
- string/url_extract_utils
- URL/link extractor with context (roadmap #423).
- suite/crash_coverage_audit
- Saropa Suite β remediation coverage audit (Suite Integration plan, R3).
- suite/rule_remediation_map
- Saropa Suite β rule-to-remediation mapping (Suite Integration plan, R1).
- testing/debug_utils
- Testing/Debug: pretty-print, dump iterable, assert equals with tolerance, range, repeat, timed. Roadmap #366-375.
- typed_data/uint8list_extensions
- url/path_extension_utils
- url/path_join_utils
- url/path_more_utils
- url/uri_pattern_utils
- URI path-template matcher with typed params β roadmap #630.
- url/url_absolute_utils
- url/url_build_utils
- url/url_canonicalize_utils
- Canonicalize a URL so equivalent links compare equal. Roadmap #175.
- url/url_encode_utils
- URL encode/decode (component vs full). Safe decode. Roadmap #166, #171.
- url/url_extensions
- url/url_query_utils
- url/url_template_utils
- URI template expansion (RFC 6570 subset) β roadmap #629.
- uuid/uuid_utils
- uuid/uuid_v4_utils
- validation/cross_field_validation_utils
- Cross-field validation (start < end, one-of required) β roadmap #682.
- validation/data_redaction_utils
- Data redaction policies (masking per field path) β roadmap #692.
- validation/guard_utils
- Defensive coding helpers (guard patterns, invariants) β roadmap #700.
- validation/input_shaping_utils
- Input shaping: clamp/normalize numbers, trim/limit strings β roadmap #696.
- validation/ip_cidr_utils
- IP/CIDR utilities (subnet contains, range checks) β roadmap #686.
- validation/jwt_structure_utils
- JWT structural checks (no crypto) β roadmap #688.
- validation/password_strength_utils
- Password strength estimation (entropy heuristics) β roadmap #687.
- validation/path_validator_utils
- Robust file path validators (prevent traversal, normalize) β roadmap #693.
- validation/pii_detector_utils
- PII detector for free-form text β roadmap #691.
- validation/safe_parse_utils
- Safe parsing wrappers (no-throw, rich error) β roadmap #695.
- validation/safe_temp_name_utils
- Safe temp-file naming (randomized, collision-resistant) β roadmap #694.
- validation/typed_positive_utils
- Typed non-empty/positive wrappers with validation β roadmap #697.
- validation/validation_error_utils
- Normalized error model (code, message, details) for validation (roadmap #683).