Sugar - Syntax Sugar for Dart

Sugar Build Pub Dev Documentation

Sugar is Forus Labs' common library for Dart. It contains frequently used utilities.

Please view the stable brunch for a production version.

dependencies:
  sugar: ^1.0.0

Core

  • Monads (i.e. Result<T, E>, Union<L, R>)
  • Utilities to simplify implementation of == and other comparisons
  • Utilities for maths, numerics and strings

Collection

  • More Iterable functions
  • Utilities for comparing the contents of Collections
  • Tuples (Pair, Triple and Quad)

Time

  • Distinct local and UTC date-time types
  • Distinct date and time types
  • Utilities for conversion between time units and rounding date-times
  • Serialization and deserialization of weekdays

Libraries

sugar
Contains the sugar collection, core and time libraries.
sugar.collection
Classes and utilities that supplement the collections in dart:core.
sugar.core
Basic utilities to manipulate common data-types, skeleton types to simplify equality and comparison operations, and monads.
sugar.time
Date-time types and utilities to manipulate date-times.