core library Core

General purpose utilities for every Dart program.

Annotations

Annotations that express intent, similar to those in package:meta.

Comparables & Equality

Mixins that simplify implementation of Comparable, utilities for working with Comparable, and determining deep equality of inbuilt collections.

Mixin for implementing Comparable:

Comparable & Comparator utilities:

Deep equality:

Functions & Monads

Type definitions for common functions, and monads.

Function type definitions:

Monads:

Primitives

Utilities for manipulating primitive types, i.e. bool and String.

Miscellaneous

Classes

Disposable
A Disposable holds resources such as sockets and streams that need to be manually disposed.
Failure<S extends Object, F extends Object>
Represents a failure.
NotTested
Denotes that the annotated element is not tested.
Possible
Denotes that an annotated element may return the given error codes or throw the given exceptions.
Result<S extends Object, F extends Object>
A Result represents the result of an operation. It is a Success or Failure.
Success<S extends Object, F extends Object>
Represents a success.

Mixins

Orderable<T extends Orderable<T>>
Simplifies implementation of naturally ordered types.

Extensions

Bools on bool
Provides functions for working with booleans.
Comparators on Comparator<T>
Provides functions for working with Comparators.
DeepEqualityIterable on Iterable<Object?>
Provides functions for determining the deep equality of Iterables.
DeepEqualityMap on Map<Object?, Object?>
Provides functions for determining the deep equality of Maps.
DeepEqualityMapEntry on MapEntry<Object?, Object?>
Provides functions for determining the deep equality of MapEntrys.
Equality on Never
Provides functions that determine the deep equality of objects.
HashCodes on Never
Provides functions that compute the deep hashcodes of objects.
NullableObjects on Object?
Provides functions for casting nullable Objects.
StringBuffers on StringBuffer
Provides functions for working with StringBuffers.
Strings on String
Provides functions that manipulate Strings.

Constants

lazy → const _Lazy
Denotes that the annotated element is lazy.

Functions

max<T>(T a, T b, {Select<T, Comparable<Object>>? by}) → T
Returns the greater of a and b.
min<T>(T a, T b, {Select<T, Comparable<Object>>? by}) → T
Returns the lesser of a and b.

Typedefs

Callback = void Function()
A callback that has no arguments and returns nothing.
Consume<T> = void Function(T value)
An operation that accepts a single argument and returns nothing.
Predicate<T> = bool Function(T value)
A predicate (boolean-valued function) of one argument.
Select<T, R> = R Function(T value)
A selector of one argument.
Supply<T> = T Function()
A supplier of Ts.