Skip to content
pubscout

dartx

1.2.0, released 3 years ago by simc.dev

Collection of useful static extension methods for Dart core types.

WASM-ready
$ flutter pub add dartx
Source repository

What it does

Adds a rich set of Kotlin-inspired extension methods to common Dart classes like Iterable, String, int, num, Function, File, and Directory. It simplifies common data manipulation tasks such as slicing, sorting by multiple properties, string capitalization, and file path handling.

AI-written summary of version 1.2.0, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You want Kotlin-style collection and string operations in Dart.
  • You need convenient utilities for files, directories, and time manipulation.

Skip it when

  • You prefer to keep your dependencies minimal and write small custom extension methods yourself.
  • You only need standard Dart library methods.

Strengths

  • Extensive collection of helpful extension methods for built-in types.
  • Includes time utilities and file system helpers.
  • Easy to integrate with zero configuration.

Weaknesses

  • Adds global extensions to core types which might cause naming collisions if not imported carefully.
  • Large surface area for a utility package.

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
6
import 'package:dartx/dartx.dart';

final slice = [1, 2, 3, 4, 5].slice(1, -2); // [2, 3, 4]

Alternatives

Packages that do the same job and could replace dartx.

Works with

Packages commonly used together with dartx: ones it builds on, ones built on it, and its own family.