api_exports library

Classes

AggregateApiReader
ApiClient
ApiCreateSignal<T>
ApiDeleteSignal<T>
ApiErrorItem
ApiErrorPayload
ApiKeyAuth
ApiReader
ApiRegistry
ApiSignal<T>
ApiUpdateSignal<T>
AsciiCodec
An AsciiCodec allows encoding strings as ASCII bytes and decoding ASCII bytes to strings.
AsciiDecoder
Converts ASCII bytes to string.
AsciiEncoder
Converts strings of only ASCII characters to bytes.
Authentication
AuthUserProfile
The combination of a firebase user + a reliveit user profile. Most places in the app want to subscribe to auth events after the user profile has been loaded to distinguish from an account that's in the process of being created.
Base64Codec
A base64 encoder and decoder.
Base64Decoder
Decoder for base64 encoded data.
Base64Encoder
Base64 and base64url encoding converter.
BearerAuthentication
ByteConversionSink
The ByteConversionSink provides an interface for converters to efficiently transmit byte data.
ChangeResult
ChangeResultBase
ChangeResultFields
ChangeResultPaths
ChunkedConversionSink<T>
A ChunkedConversionSink is used to transmit data more efficiently between two converters during chunked conversions.
ClientIdSecretCredentials
ClosableStringSink
A ClosableStringSink extends the StringSink interface by adding a close method.
Codec<S, T>
A Codec encodes and (if supported) decodes data.
CollectionAwareApiReader
Converter<S, T>
A Converter converts data from one representation into another.
DatePart
DateParts
DefaultFlexiDateParser
DefaultMEntity
DefaultMModelList<M>
Definition
Definitions
DeleteResponse
Encoding
Open-ended set of encodings.
Entity
EntityExtensions
ErrorStack
FlexiDate
FlexiDateData
A flexible container for date components that provides a robust parsing/building mechanism. If the input type is known to be a String, Map or DateTime, then use the corresponding constructors.
FlexiDateParser
Functions
HasBaseCode
HasDisposers
HasMverseMeta
HtmlEscape
Converter which escapes characters with special meaning in HTML.
HtmlEscapeMode
HTML escape modes.
HttpBasicAuthentication
Immutable
Used to annotate a class.
InvalidFlexiDate
Represents a date that's couldn't be parsed.
ISchemaProperty
JsonCodec
A JsonCodec encodes JSON objects to strings and decodes strings to JSON objects.
JsonDecoder
This class parses JSON strings and builds the corresponding objects.
JsonEncoder
This class converts JSON objects to strings.
JsonUtf8Encoder
Encoder that encodes a single object as a UTF-8 encoded JSON string.
Latin1Codec
A Latin1Codec encodes strings to ISO Latin-1 (aka ISO-8859-1) bytes and decodes Latin-1 bytes to strings.
Latin1Decoder
This class converts Latin-1 bytes (lists of unsigned 8-bit integers) to a string.
Latin1Encoder
This class converts strings of only ISO Latin-1 characters to bytes.
LineSplitter
A StreamTransformer that splits a String into individual lines.
ListDelegateMixin<T>
Lists
MapModel
Maps
MArtifactRef
MBaseModel
MEntity
Represents an entity defined by a json-schema that's backed by json value using the wrapped field. A MModel is a non-persisted entity, where as MEntity represents a persisted entity that has an ID
Contains all registered enum types to support deserialization.
MKey
Inside the sunny datastore, each record is identified by a key that provides 3 parts:
MMeta
MModel
Represents an entity defined by a json-schema.
MModelList<M>
MModelRegistry
Contains all registered MBaseModel types to support deserialization. The registry reads the mtype property in the json object, and finds the appropriate factory method.
MModelRegistryReader
MModuleRef
MOperationRef
A reference that points to a versioned json-schema for an operation or action
MSchemaRef
A reference that points to a versioned json-schema for an entity
MSchemaTypes
OAuth
PrimitiveApiReader
QueryParams
RecordKey
Repository<V extends Entity>
Base interface for defining persistence endpoints. Can be plugged into SunnyStore for convenient API access
RequestBuilder
Required
Used to annotate a named parameter p in a method or function f.
SafeCompleter<T>
StringConversionSink
A sink for converters to efficiently transmit String data.
StringJoiner
SunnyApi<M extends Entity>
ThirdPartyApi<C>
TimeSpan
Represents a user-defined duration. Unlike Duration, this class does not normalize down to microseconds value, but preserves the original precision.
UserDetails
UseResult
See useResult for more details.
Utf8Codec
A Utf8Codec encodes strings to utf-8 code units (bytes) and decodes UTF-8 code units to strings.
Utf8Decoder
This class converts UTF-8 code units (lists of unsigned 8-bit integers) to a string.
Utf8Encoder
This class converts strings to their UTF-8 code units (a list of unsigned 8-bit integers).
ValidationError
WordBuilder
ZipList<T>

Mixins

CachingApiReaderMixin
Disposable
LoggingMixin
MBaseModelMixin
MModelFactoryRegistry
SignalingApiMixin<V extends Entity>
This mixin is applied to auto-generated apis, and ensures that the modification events are propagated and can be listened to.

Constants

alwaysThrows → const _AlwaysThrows
Used to annotate a function f. Indicates that f always throws an exception. Any functions that override f, in class inheritance, are also expected to conform to this contract.
ascii → const AsciiCodec
An instance of the default implementation of the AsciiCodec.
base64 → const Base64Codec
A base64 encoder and decoder.
base64Url → const Base64Codec
A base64url encoder and decoder.
ChangeResultRef → const MSchemaRef
chars → const String
checked → const _Checked
Used to annotate a parameter of an instance method that overrides another method.
doNotStore → const _DoNotStore
Used to annotate a method, getter or top-level getter or function to indicate that the value obtained by invoking it should not be stored in a field or top-level variable. The annotation can also be applied to a class to implicitly annotate all of the valid members of the class, or applied to a library to annotate all of the valid members of the library, including classes. If a value returned by an element marked as doNotStore is returned from a function or getter, that function or getter should be similarly annotated.
emptyList → const List
experimental → const _Experimental
Used to annotate a library, or any declaration that is part of the public interface of a library (such as top-level members, class members, and function parameters) to indicate that the annotated API is experimental and may be removed or changed at any-time without updating the version of the containing package, despite the fact that it would otherwise be a breaking change.
factory → const _Factory
Used to annotate an instance or static method m. Indicates that m must either be abstract or must return a newly allocated object or null. In addition, every method that either implements or overrides m is implicitly annotated with this same annotation.
htmlEscape → const HtmlEscape
A String converter that converts characters to HTML entities.
immutable → const Immutable
Used to annotate a class C. Indicates that C and all subtypes of C must be immutable.
internal → const _Internal
Used to annotate a declaration which should only be used from within the package in which it is declared, and which should not be exposed from said package's public API.
isTest → const _IsTest
Used to annotate a test framework function that runs a single test.
isTestGroup → const _IsTestGroup
Used to annotate a test framework function that runs a group of tests.
json → const JsonCodec
An instance of the default implementation of the JsonCodec.
kday → const String
kmonth → const String
kyear → const String
latin1 → const Latin1Codec
An instance of the default implementation of the Latin1Codec.
literal → const _Literal
Used to annotate a const constructor c. Indicates that any invocation of the constructor must use the keyword const unless one or more of the arguments to the constructor is not a compile-time constant.
metaFields → const Set<String>
Fields in the json payload that are metadata (not values)
mustBeOverridden → const _MustBeOverridden
Used to annotate an instance member m declared on a class or mixin C. Indicates that every subclass of C, concrete or abstract, must directly override m.
mustCallSuper → const _MustCallSuper
Used to annotate an instance member (method, getter, setter, operator, or field) m. Indicates that every invocation of a member that overrides m must also invoke m. In addition, every method that overrides m is implicitly annotated with this same annotation.
nonVirtual → const _NonVirtual
Used to annotate an instance member (method, getter, setter, operator, or field) m in a class C or mixin M. Indicates that m should not be overridden in any classes that extend or mixin C or M.
numberPattern → const String
numbers → const String
operation → const String
optionalTypeArgs → const _OptionalTypeArgs
Used to annotate a class, mixin, extension, function, method, or typedef declaration C. Indicates that any type arguments declared on C are to be treated as optional.
protected → const _Protected
Used to annotate an instance member in a class or mixin which is meant to be visible only within the declaring library, and to other instance members of the class or mixin, and their subtypes.
redeclare → const _Redeclare
Used to annotate an instance member of an extension type that redeclares a member from a superinterface.
reopen → const _Reopen
Annotation for intentionally loosening restrictions on subtyping that would otherwise cause lint warnings to be produced by the implicit_reopen lint.
required → const Required
Used to annotate a named parameter p in a method or function f. Indicates that every invocation of f must include an argument corresponding to p, despite the fact that p would otherwise be an optional parameter.
schema → const String
sealed → const _Sealed
Annotation marking a class as not allowed as a super-type.
spanPattern → const String
unicodeBomCharacterRune → const int
The Unicode Byte Order Marker (BOM) character U+FEFF.
unicodeReplacementCharacterRune → const int
The Unicode Replacement character U+FFFD (�).
useResult → const UseResult
Used to annotate a method, field, or getter within a class, mixin, or extension, or a or top-level getter, variable or function to indicate that the value obtained by invoking it should be used. A value is considered used if it is assigned to a variable, passed to a function, or used as the target of an invocation, or invoked (if the result is itself a function).
utf8 → const Utf8Codec
An instance of the default implementation of the Utf8Codec.
virtual → const _Virtual
Used to annotate a field that is allowed to be overridden in Strong Mode.
visibleForOverriding → const _VisibleForOverriding
Used to annotate an instance member that was made public so that it could be overridden but that is not intended to be referenced from outside the defining library.
visibleForTesting → const _VisibleForTesting
Used to annotate a declaration that was made public, so that it is more visible than otherwise necessary, to make code testable.

Properties

apiClient ApiClient
no setter
apiRegistry ApiRegistry
no setter
dateUnits List<TimeSpanUnit>
final
defaultLabels Map<TimeSpanUnit, String>
final
durationPattern String
final
durationRegex RegExp
final
equalsChecker → DeepCollectionEquality
final
inputSchemaPath JsonPath
final
knownSpans Map<String, TimeSpan>
final
knownSpanUnits Map<String, TimeSpanUnit>
final
no setter
mmodelRegistry MModelRegistry
no setter
notLetterOrNumber Pattern
final
phoneNumberSplitCharacters Pattern
final
shortLabels Map<TimeSpanUnit, String?>
final
spanRegex RegExp
Not used for the ISO parsing, but this helps us in our parsing to find tokens like "3y"
final
ThirdPartyCreds → _ThirdPartyCreds
final
timeUnits List<TimeSpanUnit>
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
badArgument<T>({dynamic value, String? name, String? message}) → T
base64Decode(String source) Uint8List
Decodes base64 or base64url encoded bytes.
base64Encode(List<int> bytes) String
Encodes bytes using base64 encoding.
base64UrlEncode(List<int> bytes) String
Encodes bytes using base64url encoding.
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>
cloneDate(DateTime orig, {int? year, int? month, int? day, int? hour, int? minute, int? second, int? millisecond, int? microsecond}) DateTime
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>
extractMverseType(Map<String, dynamic> map) String?
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?
flexiDateOf(dynamic dyn) FlexiDate?
groupBy<K, V>(List<V> values, K mappedBy(V item)) Map<K, List<V>>
hasTime(DateTime time) bool
ifEmpty<T>(Iterable<T>? list, {T? then}) List<T?>
illegalArg<T>(String prop, [String? message]) → T
illegalState<T>([String? message]) → T
initializeMEnumRegistry(MEnumRegistry registry) → dynamic
initializeMModelRegistry(MModelRegistry registry) → dynamic
initials(dynamic from, {int max = 2}) String?
isFuture(DateTime? time) bool
isNullOrBlank(String? input) bool
isPast(DateTime? time) bool
isPhone(String input) bool
joinOrNull(Iterable<String?>? items, {String separator = " "}) String?
joinString(void builder(StringJoiner buffer), [String? separator]) String
jsonDecode(String source, {Object? reviver(Object? key, Object? value)?}) → dynamic
Parses the string and returns the resulting Json object.
jsonEncode(Object? object, {Object? toEncodable(Object? nonEncodable)?}) String
Converts object to a JSON string.
jsonLiteral(dynamic element) → dynamic
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
parseTimeSpans(String query) List<TimeSpan>
parseUris(dynamic uris) List<Uri>
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?>
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>
timeSpanOf(String duration) TimeSpan?
timeSpanUnitOf(dynamic input) TimeSpanUnit?
todo<T>([String? message]) → T
tokenizePhoneNumber(String? phoneNumber) Iterable<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
tryParseTimeSpanUnit(dynamic input) List<TimeSpanUnit>
uncapitalize(String source) String
uncapitalizeNull(String? source) String?
uriOf(dynamic json) Uri?
uuid() String
uuidb() List<int?>
withoutTime(DateTime time) DateTime
withString<R>(Iterable<String?> strings, R handler(String string)) → R?
wrongType<T>(String name, dynamic value, List<Type> accepted) → T

Typedefs

ByteConversionSinkBase = ByteConversionSink
This class provides a base-class for converters that need to accept byte inputs.
Deserializer = dynamic Function(dynamic input)
Disposer = FutureOr Function()
Func<R> = R Function()
MModelFactory<M extends MBaseModel> = M Function(dynamic json)
Given json, produces an MBaseModel of that type
MModelFactoryResolver<M extends MBaseModel> = MModelFactory<M>? Function(String type)
Given a string, returns a function that knows how to instantiate objects of that type
MModelInstantiator<M extends Entity> = M Function([dynamic json])
PersistenceLifecycleEvent<T> = dynamic Function(T input)
Predicate<T> = bool Function(T input)
StringConversionSinkBase = StringConversionSink
This class provides a base-class for converters that need to accept String inputs.
StringConversionSinkMixin = StringConversionSink
This class provides a mixin for converters that need to accept String inputs.
TimeSpanValue = num Function(TimeSpan span)
TypeExtractor = String? Function(Map<String, dynamic> json)
Attempts to determine the entity type

Exceptions / Errors

ApiException
ApiResponseException
ApiSocketException
ApiWrappedException
BadRequestException
JsonCyclicError
Reports that an object could not be stringified due to cyclic references.
JsonUnsupportedObjectError
Error thrown by JSON serialization if an object cannot be serialized.