api_exports library
Classes
- AggregateApiReader
- ApiClient
-
ApiCreateSignal<
T> -
ApiDeleteSignal<
T> - ApiErrorItem
- ApiErrorPayload
- ApiKeyAuth
- ApiReader
- ApiRegistry
-
ApiSignal<
T> -
ApiUpdateSignal<
T> - AsciiCodec
- Encoding and decoding of ASCII characters.
- 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
closemethod. -
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
- Annotation on an immutable 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
- MEnumRegistry
- 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
- RecordUse
- Annotation on a statically resolved member or class whose usages will be recorded.
-
Repository<
V extends Entity> -
Base interface for defining persistence endpoints. Can be plugged into
SunnyStorefor convenient API access - RequestBuilder
- Required
- Annotation on a required named parameter.
-
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
- Annotation on function or property whose value must not be ignored.
- 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.
Extensions
- ApiReaderExt on ApiReader
-
ApiSignalStream
on Stream<
ApiSignal> ? - DateComponentsComparisons on FlexiDate
-
ErrorList
on List<
ValidationError> - FlexiDateExt on FlexiDate
- FlexiDateTimeExt on DateTime
- HasMMetaExt on HasMverseMeta
- MEntityEquality on MEntity
- MKeyExt on MKey
- MModelExt on MModel?
- MSchemaRefExtensions on MSchemaRef
- MSchemaRefFactoryExt on MSchemaRef
- NumExt on num
- ObjectBaseCodeExtension on Object?
- PropSchemaTypeExtensions on PropSchemaType
-
RepositoryExtensions
on Repository<
X> -
StateObserverAutoStream
on StreamSubscription<
T> -
StreamAutoReader
on Stream<
T> -
StreamDisposableMixin
on Stream<
X> - ThirdPartyCredsApis on _ThirdPartyCreds
- TimeSpanUnitExt on TimeSpanUnit?
Constants
- alwaysThrows → const Object
- Annotation marking a function as always throwing.
- ascii → const AsciiCodec
- An instance of the default implementation of the AsciiCodec.
- awaitNotRequired → const Object
- Annotation on asynchronous function whose Future can be ignored.
- base64 → const Base64Codec
- A base64 encoder and decoder.
- base64Url → const Base64Codec
- A base64url encoder and decoder.
- ChangeResultRef → const MSchemaRef
- chars → const String
- checked → const Object
- Annotation that no longer has any effect.
- doNotStore → const Object
- Annotation on function or property whose value must not be stored.
- doNotSubmit → const Object
- Annotation marking declaration that should be removed before publishing.
- emptyList → const List
- experimental → const Object
- Annotation marking declaration as experimental and subject to change.
- factory → const Object
- Annotation on a function that creates new objects.
- htmlEscape → const HtmlEscape
-
A
Stringconverter that converts characters to HTML entities. - immutable → const Immutable
- Annotation on an immutable class.
- internal → const Object
- Annotation on declaration that should not be used outside of its package.
- isTest → const Object
- Annotation on a test framework function that introduces a single test.
- isTestGroup → const Object
- Annotation on a test framework function that introduces 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 Object
-
Annotation on constructor that must be invoked with
constif possible. -
metaFields
→ const Set<
String> - Fields in the json payload that are metadata (not values)
- mustBeConst → const Object
- Annotation on a parameter whose arguments must be constants.
- mustBeOverridden → const Object
- Annotation on instance members that must be overridden by subclasses.
- mustCallSuper → const Object
- Annotation on instance member that overriding members must call.
- nonVirtual → const Object
- Annotation on instance member that must not be overridden.
- numberPattern → const String
- numbers → const String
- operation → const String
- optionalTypeArgs → const Object
- Annotation on type arguments that can safely be omitted.
- protected → const Object
- Annotation on instance member that should only be used by subclasses.
- redeclare → const Object
- Annotation on extension type members which redeclare superinterface members.
- reopen → const Object
- Annotation on declaration with less access restrictions than superinterface.
- required → const Required
- Annotation on named parameter that should always have an argument supplied.
- schema → const String
- sealed → const Object
- Annotation on class that must not be subclassed outside of its package.
- 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
- Annotation on function or property whose value must not be ignored.
- utf8 → const Utf8Codec
- An instance of the default implementation of the Utf8Codec.
- virtual → const Object
- Annotation which no longer has any effect.
- visibleForOverriding → const Object
- Annotation on declaration that should not be used outside of its package.
- visibleForTesting → const Object
- Annotation on a public declaration that should only be used in tests.
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
- mEnumRegistry → MEnumRegistry
-
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
bytesusing base64 encoding. -
base64UrlEncode(
List< int> bytes) → String -
Encodes
bytesusing 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
objectto 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
subscriptis 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() -
MEnumFactory<
M> = M Function(String literal) -
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.