pouch library

Generic Dart utilities and helper functions

Classes

Clock
An abstract representation of a Clock
DartClock
An implementation of Clock that is backed by the native Dart DateTime utilities
Date
A Basic representation of a Date since 1.4.0
MapUtil
Useful Map extensions
PollingWaiter
A polling implementation of Waiter
Predicates
Functional Predicate (boolean-valued function) Helpers and Utilities
Require
Util for checking
ResourceUtils
Resource and ResourceSync utils
StringUtil
String Helper Utilities
Time
A Basic representation of Time in 24 hour format since 1.4.0
Wait
Wait Helper Utilities
Waiter
Utility class that aids in waiting for a predicate to be met.

Mixins

Resource
A resource that needs to be disposed (cleaned up)
ResourceSync
Synchronous version of Resource

Extensions

BoolExtensions on bool
Extensions to bool
FutureBoolExtensions on Future<bool>
Extensions to Future
FutureIterableExtensions on Iterable<Future<V>>
Extends Iterable of Futures
FutureOrBoolExtensions on FutureOr<bool>
Extensions to FutureOr
IterableExtensions on Iterable<E>
Extends Iterables with some common helper properties and functions
MapExtentions on Map
Useful Map extensions
NestedIterableExtensions on Iterable<Iterable<E>>
Extends Iterables of Iterables
NullableBoolExtensions on bool?
Extensions to bool?
NullableIterableExtensions on Iterable<E>?
Extensions to Iterable
NullableMapExensions on Map<K, V>?
Extensions to Map?
NullableObjectExtensions on Object?
Extensions to Object?
NullableStringExtensions on String?
Extensions to String?
StreamExtensions on Stream<E>
Extends Streams with some common helper properties and functions

Functions

cast<T>(Object? x) → T?
If x is an instance of T, returns x cast to T, otherwise returns null.
containsIgnoreCase(String? s, String? needle) bool
Returns true if s contains the needle irrespective of case
equalsIgnoreCase(String? left, String? right) bool
Returns true if left is equal to right irrespective of case
firstOrNull<E>(Iterable<E> coll) → E?
Returns the first element from the coll; or null if the the coll is empty
identity<T>(T x) → T
Returns its argument
isBlank(String? v) bool
Returns true if the provided String value v is null or blank (whitespace only)
isFalse(bool? value) bool
Returns true if the boolean value is false. Use BoolExtensions instead
isNotBlank(String? v) bool
Returns true if the provided String value v is not null and is not blank (whitespaces)
isNotNull(Object? value) bool
Returns true if the value is not null
isNull(Object? value) bool
Returns true if the value is null
isTrue(bool? value) bool
Returns true if the boolean value is true
toString(Object? x) String?
Calls toString on x

Exceptions / Errors

KeyNotFoundException
Exception that can be thrown when a key is not found in a Map
RequireException
Default implementation of RequireException which carries a message.