nullx
0.1.17, released 2 years ago by shtanko.dev
Collection of extensions for handling null types in Dart.
What it does
Provides utility extension methods and functions to work with nullable types, collections, maps, and futures in Dart, enabling cleaner null-checking and error handling.
AI-written summary of version 0.1.17, based on the package's README and metadata. Report an inaccuracy
Use it when
- You want concise extension methods for safe handling of nullable values, strings, lists, and maps.
- You need functional-style operations like letNonNull or mapNonNull on nullable collections.
Skip it when
- You prefer standard Dart null-aware operators without adding third-party extension libraries.
Strengths
- Simplifies working with nullable types and collections.
- Provides intuitive helper extensions like isNullOrEmpty, orZero, and mapNonNull.
Weaknesses
- Adds an external dependency for features largely covered by standard Dart null safety features.
- Documentation outside the README is minimal.
Setup
- Kind
- Pure Dart
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 2
not documented
import 'package:nullx/nullx.dart';
void main() {
final list = [1, null, 3, null];
list.mapNonNull((item) => item * 2); // prints: [2, 6]
}Alternatives
Packages that do the same job and could replace nullx.
- mime
Utilities to resolve MIME types from file names, magic bytes, and to parse multipart streams.
92Compare - result_type
A Result type representing success or failure in Dart
50Compare - time
Type-safe DateTime and Duration calculations, powered by extensions.
70Compare - rename_app
A CLI tool to change your Flutter app display name across multiple platforms.
62Compare
Works with
Packages commonly used together with nullx: ones it builds on, ones built on it, and its own family.