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 ofT
, returnsx
cast toT
, otherwise returnsnull
. -
containsIgnoreCase(
String? s, String? needle) → bool -
Returns
true
ifs
contains theneedle
irrespective of case -
equalsIgnoreCase(
String? left, String? right) → bool -
Returns
true
ifleft
is equal toright
irrespective of case -
firstOrNull<
E> (Iterable< E> coll) → E? -
Returns the first element from the
coll
; ornull
if the thecoll
is empty -
identity<
T> (T x) → T - Returns its argument
-
isBlank(
String? v) → bool -
Returns
true
if the provided String valuev
isnull
or blank (whitespace only) -
isFalse(
bool? value) → bool -
Returns
true
if the booleanvalue
isfalse
. Use BoolExtensions instead -
isNotBlank(
String? v) → bool -
Returns
true
if the provided String valuev
is notnull
and is not blank (whitespaces) -
isNotNull(
Object? value) → bool -
Returns
true
if thevalue
is notnull
-
isNull(
Object? value) → bool -
Returns
true
if thevalue
isnull
-
isTrue(
bool? value) → bool -
Returns
true
if the booleanvalue
istrue
-
toString(
Object? x) → String? -
Calls
toString
onx
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.