sunny_dart library

Classes

AsyncValueStream<T>
The AsyncValueStream is used as a clearing house when more than one consumer need to update a single value, but you want to control the lifecycle around updates, so that older updates that take longer to calculate don't clobber newer values. [...]
DeviceInfo
ErrorStack
File
FStream<T>
A value stream based where the first element is a future
Functions
FuturesStream
HeadedEntryStream<K, V>
HStream<T>
ListIndex<T>
Lists
Maps
Resolvable<T>
SafeCompleter<T>
SyncStream<T>
The SyncStream is used to control (and potentially debounce) updates to a single value, that are then dispatched as a single stream of updates
Tuple<A, B>
UpdateRequest<T>
UpdateResult<T>
ValueStream<T>
Interface representing a stream that has a current or initial value as well. [...]
ValueStreamController<T>
A class that tracks a single value as a stream, but can also provide the latest value;
WordBuilder

Mixins

Disposable
LoggingMixin

Extensions

AnyExtensions
AsyncMap
Alternatives to asyncMap. [...]
BoolExtension
CombineLatest
Utilities to combine events from multiple streams through a callback or into a list.
ComparableIterableExtension
Concatenate
Utilities to append or prepend to a stream.
CoreListExtension
DateTimeExtensions
DoubleExt
DurationExt
DurationExtensions
DynamicExtension
EnumValueExtensions
FutureExtensions
FutureIterableExt
FutureIterableStreamExtension
FutureOrExts
FutureOrIterableExt
IntList
IterableEntryExtensions
IterableExtension
IterableExtensions
IterableFutureExt
IterableIterableExtension
IterableOfDoubleExtensions
IterableOfIntExtensions
IterationPositionExtensions
ListExtension
LoggerExtensions
MapDebug
MapExtensions
MapListDebug
Merge
Utilities to interleave events from multiple streams.
ModelMapExtensions
Multiples
NestedFutureOr
NumExt
ObjectToListExtension
ObjectTupleExt
PlatformInfoFuture
RateLimit
Utilities to rate limit events. [...]
Scan
A utility similar to fold which emits intermediate accumulations.
SetExtension
StreamDisposableMixin
StreamIterableExtension
StreamSortSampleExtension
StreamToVStreamExtensions
StreamTxrExtensions
StringBufferExt
StringExtensions
StringListExtension
StringUriExtensions
Switch
A utility to take events from the most recent sub stream returned by a callback.
SwitchLatest
A utility to take events from the most recent sub stream.
TakeUntil
A utility to end a stream based on an external trigger.
Tap
A utility to chain extra behavior on a stream.
TextStyleExtensions
TimeSpanExtensions
TypeExtensions
UriTemplateExtensions
ValueStreamExtensions
ValueStreamFutureExtensions
ValueStreamIterableExtensions
ValueStreamIterableFutureExtensions
ValueStreamIterableMapEntryExtensions
ValueStreamOfMapExtensions
Where
Utilities to filter events.

Constants

aggresiveTokenizer → const String
"(,|\\/|_|\\.|-|\\s)"
buildMode → const BuildMode
const bool.fromEnvironment('dart.vm.product') ? BuildMode.release : kDebugMode ? BuildMode.debug : BuildMode.profile
chars → const String
"abcdefghijklmnopqrstuvwxyz"
digits → const Set<String>
const {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'}
emptyList → const List
const []
numbers → const String
"0123456789"
spaceTokenizer → const String
"(\s)"

Properties

aggresiveTokenizerPattern RegExp
final
canPlatformReadFiles bool
read-only
canReadFiles bool
read-only
currencyFormat NumberFormat
final
deviceInfo FutureOr<DeviceInfo>
read / write
environment Map<String, String>
read-only
isAndroid bool
read-only
isIOS bool
read-only
isLetters RegExp
final
isLinux bool
read-only
isMacOS bool
read-only
isPlatformAndroid bool
read-only
isPlatformIOS bool
Since dart:io doesn't work on the web, this library creates an abstraction of the most common access point in io, and causes them to silently fail on the web
read-only
isPlatformLinux bool
read-only
isPlatformMacOS bool
read-only
isPlatformWeb bool
read-only
isPlatformWindows bool
read-only
isWeb bool
read-only
isWindows bool
read-only
newLinesPattern RegExp
final
notLetterOrNumber Pattern
final
operatingSystem String
read-only
phoneNumberSplitCharacters Pattern
final
platformEnvironment Map<String, String>
read-only
platformName String
read-only
spaceTokenizerPattern RegExp
final
typeParameters RegExp
final
upToLastDot RegExp
final
wordSeparator RegExp
final

Functions

alwaysFalse<T>(T input) bool
alwaysTrue<T>(T input) bool
anyMatch(String subject, List<String> potentials, {bool caseSensitive: true}) bool
assertNotNull<T>(T value) → T
awaitBoth<A, B>(FutureOr<A> a, FutureOr<B> b) Future<Tuple<A, B>>
badArgument<T>({dynamic value, String name, String message}) → T
buildString(void builder(StringBuffer buffer)) String
capitalize(String source) String
catching<I, O>(O execute(I input), {String debugLabel, Logger logger}) Mapping<I, O>
chopList<T>(Iterable<T> items) List<T>
colorFromHex(String hexString) Color
String is in the format "aabbcc" or "ffaabbcc" with an optional leading "#".
colorToHex(Color color, {bool leadingHashSign: true}) String
Prefixes a hash sign if leadingHashSign is set to true (default is true).
compact<T>(Iterable<T> list) List<T>
compareBool<T>(bool toBool(T input)) Comparator<T>
convert<F, T>(F obj, {Transformer<F, T> converter, Predicate<F> predicate}) → T
create<T>(Factory<T> factory) → T
createIf<T>(bool condition, Factory<T> factory) → T
deepClone(dynamic _in) → dynamic
This assumes that the data coming in is a map, list, or primitive (json).
deepCloneList(Iterable _in) List
This assumes that the data coming in is a map, list, or primitive (json).
deepCloneMap(Map _in) Map<String, dynamic>
This assumes that the data coming in is a map, list, or primitive (json).
defaultIfEmpty(String primary, String ifBlank) String
delay([Duration duration = const Duration(milliseconds: 300)]) Future
distinctBy<T>(Iterable<T> list, dynamic by(T input)) Iterable<T>
filterKeys<K, V>(Map<K, V> source, bool filter(K key)) Map<K, V>
filterValues<K, V>(Map<K, V> source, bool filter(V value)) Map<K, V>
find<T>(Map<String, T> container, String id) → T
findInitials(List sources) String
firstNonEmpty(Iterable<String> strings) String
firstNonNull<T>([T a, T b, T c, T d, T e, T f]) → T
formatPhoneNumber(String phoneNumber, {String isoCode: ''}) Future<String>
groupBy<K, V>(List<V> values, K mappedBy(V item)) Map<K, List<V>>
ifEmpty<T>(Iterable<T> list, {T then}) List<T>
illegalArg<T>(String prop, [String message]) → T
illegalState<T>([String message]) → T
initials(dynamic from, {int max: 2}) String
isNullOrBlank(String input) bool
isPhone(String input) bool
joinOrNull(Iterable<String> items, {String separator: " "}) String
loadPlatformInfo() Future<DeviceInfo>
loggerNameOf(Type type) String
Converts a type name to snake case
mapExceptFirst<T>(Iterable<T> list, T map(T t)) List<T>
mapExceptLast<T>(Iterable<T> list, T map(T t)) List<T>
mapIndexed<R, T>(Iterable<T> input, R mapper(T item, int index)) Iterable<R>
mapOf<K, V>(Iterable<V> values, {K keyOf(V item)}) Map<K, V>
matchAll<T>() Predicate<T>
md5(Uint8List bytes) String
nonBlank(String input) String
notImplemented<T>() → T
notNull<T>() Predicate<T>
notNullOrBlank() Predicate<String>
nullPointer<T>(String property) → T
properCase(String source) String
raise<T>(String message) → T
randomString(int length, {bool numbersOnly, Random rnd}) String
rangeOf(int low, int high) Iterable<int>
removeElement<T>(Iterable<T> elements, T toRemove) List<T>
repeat(String source, int times) String
returnNull<T>() Factory<T>
sort<T>(Iterable<T> list, Comparator<T> comparator) Iterable<T>
splitSnakeCase(String source) String
startsWith(String first, String second, {bool ignoreCase: true}) bool
sunnyLogger(Type type, {Type subscript}) Logger
Produces a logger using snake case naming conventions. If subscript is provided, it will be appended to the name in square brackets, eg sunny_listcontact
timed<R>(R block(), {dynamic result(R result, Duration time)}) → R
timedAsync<R>(FutureOr<R> block(), {dynamic result(R result, Duration time)}) Future<R>
todo<T>([String message]) → T
tokenizePhoneNumber(String phoneNumber) Iterable<String>
tokenizeString(String input, {bool splitAll: false, Pattern splitOn}) List<String>
toList<T>(dynamic value, DynTransformer<T> txr) List<T>
Converts a dynamic json value into a list, using the provided transformer to convert
toMap<T>(dynamic value, DynTransformer<T> txr) Map<String, T>
Converts a dynamic json value into a map, using the provided transformer to convert
trim(String target, List<String> chars, {bool trimWhitespace: true}) String
uncapitalize(String source) String
uuid() String
widgetIf(bool condition, Factory<Widget> factory) Widget
withString<R>(Iterable<String> strings, R handler(String string)) → R
wrongType<T>(String name, dynamic value, List<Type> accepted) → T

Enums

BuildMode
ClearingHouseMode
IterationPosition

Typedefs

Consumer<T>(T input) → dynamic
Converter<T>(String input) → T
Disposer() FutureOr
DynTransformer<T>(dynamic from) → T
Factory<T>() → T
Formatter<T>(T from) String
Func<R>() → R
Getter<T>() → T
ListFactory<T>() List<T>
Loader<K, T>(K key) FutureOr<T>
Mapping<F, T>(F from) → T
Predicate<T>(T input) bool
Producer<T>() FutureOr<T>
Transformer<F, T>(F from) → T