dartx
1.2.0, released 3 years ago by simc.dev
Collection of useful static extension methods for Dart core types.
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.
- fast_immutable_collections
Fast immutable lists, sets, maps, and multimaps for Dart
91Compare - nb_utils
Collection of Widgets and helpful Methods that every developer needs.
72Compare - strings
Large collection of String functions extending the String class and supporting nullable Strings safely.
83Compare - awesome_extensions
A comprehensive collection of Dart and Flutter extensions to reduce boilerplate code.
82Compare
Works with
Packages commonly used together with dartx: ones it builds on, ones built on it, and its own family.
- cryptodartx depends on itProvides SHA, MD5, and HMAC hashing functions for Dart.
- charactersdartx depends on itUnicode and grapheme cluster aware string manipulation operations for Dart.
- timedartx depends on itType-safe DateTime and Duration calculations, powered by extensions.
- isar_community_generatorBuilt on dartxCode generator for the Isar Database to find and process classes annotated with @Collection.
- downloadsfolderBuilt on dartxRetrieve download folder paths and copy files into downloads on mobile and desktop.
- spotBuilt on dartxToolkit for Flutter widget tests with chainable selectors and automatic timeline reports.
- sidekick_coreBuilt on dartxShared sidekick commands, plugin engine, migrations, templates, and utilities for custom CLIs.