sunny_dart library Null safety

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. [...]
Debouncer
DeviceInfo
FStream<T>
A value stream based where the first element is a future
Functions
FuturesStream
GeoPoint
HasDisposers
HeadedEntryStream<K, V>
HStream<T>
InfoX
JsonPath<T>
Represents a json-pointer - can be used to do json-pointer operations on MModel instances. [...]
Keyed<K, V>
Limiter
ListDelegateMixin<T>
ListIndex<T>
Lists
MapModel
Maps
MLiteral<T>
SafeCompleter<T>
StringJoiner
SunnyDart
Makes it easier to import
SunnyGet
Base interface for doing service lookups. This can work with the provider package, or a injector framework like kiwi
SunnyLocalization
Based on the timezone package - provides the user's timezone and location (not GPS, just generalized)
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
Throttler
Token
Tokenizer
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
ZipList<T>

Mixins

Disposable
LoggingMixin
TupleMixin<A, B>

Extensions

AnyExtensions
AnyFutureExtensions
AnyFutureNullableExtensions
AsyncMap
Alternatives to asyncMap. [...]
BoolExtension
BoolNullableExtension
CombineLatest
Utilities to combine events from multiple streams through a callback or into a list.
ComparableIterXX
Concatenate
Utilities to append or prepend to a stream.
CoreListExtension
CoreListNullableExtension
DateTimeNullableExtensions
DateTimeNullableXX
DateTimeXX
DoubleExt
DurationExt
DurationExtensions
DynamicExtension
DynamicMapExtensionMap
EnumValueExtensions
FutureExtensions
FutureIterableExt
FutureIterableStreamExtension
FutureNullableExtensions
FutureOrExts
FutureOrIterableExt
FutureOrIterableNullExt
FutureOrNullableExts
IntList
IterableEntryExtensions
IterableFutureExt
IterationPositionExtensions
IterDynXX
IterIterXX
IterMapEntryXX
IterObjXX
IterOfNullableXX
IterOfNumNullableXX
JsonPathOperatorExtensions
JsonPathOperatorNullExtensions
ListStringXX
LocalizationDateTimeExt
LoggerExtensions
MapDebug
MapExtensions
MapListDebug
MapNullableExtensions
MapValueNullXX
MapXX
Merge
Utilities to interleave events from multiple streams.
ModelMapExtensions
Multiples
NestedFuture
NestedFutureOr
NestedNullableFutureOr
NullIterXX
NullListXX
NullSetXX
NumXX
NumXXNullable
ObjectAsListExtension
ObjectExtension
ObjectToListExtension
ObjectTupleExt
PlatformInfoFuture
RateLimit
Utilities to rate limit events. [...]
SafeStreamController
Scan
A utility similar to fold which emits intermediate accumulations.
SetNullableExtension
StateObserverStream
StreamDisposableMixin
StreamExt
StreamIterableExtension
StreamNullableExt
StreamReader
StreamSortSampleExtension
StreamToVStreamExtensions
StreamTxrNullableExtensions
StringBufferExt
StringNullableXX
StringTitleExt
StringUriExtensions
StringXX
SunnyIterableExtensionExt
SunnyIterableExtensions
SunnyIterableSafeExtensionExt
SunnyLocalizationExt
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.
TimeSpanExtensions
TimeSpanNullableExtensions
TypeExtensions
UriTemplateExtensions
ValueStreamExtensions
ValueStreamFutureExtensions
ValueStreamIterableExtensions
ValueStreamIterableFutureExtensions
ValueStreamIterableMapEntryExtensions
ValueStreamOfMapExtensions
Where
Utilities to filter events.

Constants

aggresiveTokenizer → const String
"(,|\\/|_|\\.|-|\\s)"
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
compactFormat NumberFormat
final
currencyFormat NumberFormat
final
infoX InfoX
read-only
isLetters RegExp
final
nameSeparator RegExp
final
newLinesPattern RegExp
final
notLetterOrNumber Pattern
final
phoneNumberSplitCharacters Pattern
final
spaceTokenizerPattern RegExp
final
sunny SunnyGet
read / write
sunnyLocalization SunnyLocalization
Global getter for the sunny localization object. Requires that the instance has been registered with a SunnyGet container somewhere.
read-only
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>
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?
dateTimeOf(dynamic json) DateTime?
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?
groupBy<K, V>(List<V> values, K mappedBy(V item)) Map<K, List<V>>
hashFromList(Iterable<Object?>? arguments) int
Combine the Object.hashCode values of an arbitrary number of objects from an Iterable into one value. This function will return the same value if given null as if given an empty list.
hashOf(Object? arg01, Object? arg02, [Object? arg03 = _hashEnd, Object? arg04 = _hashEnd, Object? arg05 = _hashEnd, Object? arg06 = _hashEnd, Object? arg07 = _hashEnd, Object? arg08 = _hashEnd, Object? arg09 = _hashEnd, Object? arg10 = _hashEnd, Object? arg11 = _hashEnd, Object? arg12 = _hashEnd, Object? arg13 = _hashEnd, Object? arg14 = _hashEnd, Object? arg15 = _hashEnd, Object? arg16 = _hashEnd, Object? arg17 = _hashEnd, Object? arg18 = _hashEnd, Object? arg19 = _hashEnd, Object? arg20 = _hashEnd]) int
Combine up to twenty objects' hash codes into one value. [...]
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?
joinString(void builder(StringJoiner buffer), [String? separator]) String
locationOf(dynamic name) Location
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, {required 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?
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?>
simpleNameOfType(Type type) String
sort<T>(Iterable<T> list, Comparator<T> comparator) Iterable<T>
splitSnakeCase(String? source) String?
startsWith(String? first, String? second, {bool ignoreCase = true}) bool
streamOfNullableFuture<T>(Future<T?>? nullable) Stream<T>
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>
timeSpanOf(String duration) TimeSpan?
timeZoneOf(dynamic name) TimeZone
todo<T>([String? message]) → T
tokenizePhoneNumber(String? phoneNumber) Iterable<String>
tokenizeString(String? input, {bool splitAll = false, Tokenizer? tokenizer}) 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?
trying<O>(O execute(), {Logger? log}) → O
uncapitalize(String source) String
uncapitalizeNull(String? source) String?
uriOf(dynamic json) Uri?
uuid() String
uuidb() List<int?>
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> = dynamic Function(T input)
Converter<T> = T Function(String input)
Disposer = FutureOr Function()
DynTransformer<T> = T Function(dynamic from)
Factory<T> = T Function()
Formatter<T> = String Function(T from)
Func<R> = R Function()
Getter<T> = T Function()
ListFactory<T> = List<T> Function()
Loader<K, T> = FutureOr<T> Function(K key)
Mapping<F, T> = T Function(F from)
Predicate<T> = bool Function(T input)
Producer<T> = FutureOr<T> Function()
Transformer<F, T> = T Function(F from)