Skip to content
pubscout

dart_extensions_methods

2.0.0, released 5 years ago by an unverified publisher

Kotlin-style extension methods for Dart types including String, bool, Iterable, and List.

WASM-ready
$ flutter pub add dart_extensions_methods
Source repository

What it does

Provides utility extension methods and helper classes similar to Kotlin's standard library for Dart primitive and collection types. Includes extensions for String, bool, Iterable, and List, plus global utilities like Pair, let, also, and run.

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

Use it when

  • You want Kotlin-style scoping functions (let, also, run) in Dart.
  • You need convenient extension methods on Strings, booleans, and iterables.

Skip it when

  • You prefer to write your own custom extensions to keep dependencies minimal.
  • You only need standard Dart collection utilities.

Strengths

  • Brings familiar Kotlin utility functions and methods to Dart.
  • Null safety supported in version 2.0.0.

Weaknesses

  • Small feature set limited to basic types.
  • No documentation on some features beyond a brief list.

Setup

Kind
Pure Dart
Effort
Low
Code generation
No
Direct dependencies
0
Pair<int, String> pair = Pair();

String text = "hello";
if (text.isNullOrEmpty) {
  // do something
}

Alternatives

Packages that do the same job and could replace dart_extensions_methods.