Skip to content
pubscout

dartlin

0.6.3, released 4 years ago by wolfenrain.dev

Helper library adding readable control-flow and data manipulation extensions

WASM-ready
$ flutter pub add dartlin

What it does

Dartlin provides extension methods for control flow (iff, when, tryy) and data manipulation (range, zipWithNext, etc.) to make Dart code more readable.

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

Use it when

  • cleaning up complex ternary expressions
  • replacing switch statements with expression-based when
  • creating numeric ranges with range()

Skip it when

  • performance-critical code where benchmarks are needed
  • code that requires fine-grained control over execution order beyond what extensions provide

Strengths

  • Kotlin-inspired readable syntax
  • wide range of extensions for collections, control flow, and data manipulation
  • no external dependencies
  • actively maintained

Weaknesses

  • not performance-optimized, no benchmarks
  • adds runtime overhead via closures
  • may duplicate existing Dart collection operators

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
0
import 'package:dartlin/dartlin.dart';

final x = iff(a < b, () => a).elseIf(a == b, () => 0).orElse(() => b);

Alternatives

Packages that do the same job and could replace dartlin.