katana_model_firestore library

Firestore plugin for katana_model. A package that models data into documents and collections and allows Firestore, local DB, and data mocks to be handled in the same interface.

To use, import package:katana_model_firestore/katana_model_firestore.dart.

Classes

AllowCreateModelValidationQuery
Define the validation query to be used by DatabaseValidator.
AllowDeleteModelValidationQuery
Allows only document deletion.
AllowReadCollectionModelValidationQuery
Allows reading (collections only).
AllowReadDocumentModelValidationQuery
Allows reading (documents).
AllowReadModelValidationQuery
Allow all reads (documents and collections).
AllowUpdateModelValidationQuery
Allows only document updates.
AllowWriteModelValidationQuery
Allows only document creation.
Api
Provides static methods for making HTTP requests.
AsyncAggregateValue<T>
This class is used to asynchronously retrieve values returned from CollectionBase.aggregate, etc.
CollectionBase<TModel extends DocumentBase>
Define a collection model that includes DocumentBase as an element.
CollectionModelQuery
Query class for defining Model.
DatabaseValidator
An object that validates information in the database.
DateDuration
A class that represents a date period.
DateFormat
DateFormat is for formatting and parsing dates in a locale-sensitive manner.
DocumentBase<T>
Define a document model for storing T types that inherit from ChangeNotifier.
DocumentModelQuery
Query class for defining Model.
DynamicModelInitialCollection
ModelInitialCollection using DynamicMap.
DynamicModelInitialDocument
ModelInitialDocument using DynamicMap.
FirebaseCore
Initialize Firebase.
FirebaseOptions
The options used to configure a Firebase app.
FirestoreBasicConverter
Normal FirestoreConverter.
FirestoreEnumConverter
FirestoreConverter for Enum.
FirestoreModelAdapter
Model adapter with Firebase Firestore available.
FirestoreModelAdapterBase
Base class for implementing FirestoreModelAdapter.
FirestoreModelBatchRef
ModelBatchRef for FirestoreModelAdapter.
FirestoreModelCommandBaseConverter
FirestoreConverter for ModelServerCommandBase.
FirestoreModelCounterConverter
FirestoreConverter for ModelCounter.
FirestoreModelDateConverter
FirestoreConverter for ModelDate.
FirestoreModelFieldValueConverter
Base class for converting ModelFieldValue for use in Firestore.
FirestoreModelGeoValueConverter
FirestoreConverter for ModelGeoValue.
FirestoreModelImageUriConverter
FirestoreConverter for ModelImageUri.
FirestoreModelLocaleConverter
FirestoreConverter for ModelLocale.
FirestoreModelLocalizedValueConverter
FirestoreConverter for ModelLocalizedValue.
FirestoreModelRefConverter
FirestoreConverter for ModelRef.
FirestoreModelSearchConverter
FirestoreConverter for ModelSearch.
FirestoreModelTimestampConverter
FirestoreConverter for ModelTimestamp.
FirestoreModelTokenConverter
FirestoreConverter for ModelToken.
FirestoreModelTransactionRef
ModelTransactionRef for FirestoreModelAdapter.
FirestoreModelUriConverter
FirestoreConverter for ModelUri.
FirestoreModelVideoUriConverter
FirestoreConverter for ModelVideoUri.
FirestoreNullConverter
FirestoreConverter for Null.
GeoValue
Data to store location information.
Immutable
Used to annotate a class.
ListenableFirestoreModelAdapter
Model adapter with Firebase Firestore available.
ListenableListener<T extends Listenable>
A widget that monitors changes in Listenable and updates the contents of builder when there is a change.
LocalizedLocaleValue<T>
Class for restricting the types of values that can be stored in LocalizedValue.
LocalizedValue<T>
Class for storing translation data.
ModelAccessQuery
Stores information for accessing the server.
ModelAdapter
You can implement adapters that define the internal specifications of the model.
ModelAdapterCollectionQuery
Query class to be passed when executing each function of ModelAdapter.
ModelAdapterDocumentQuery
Query class to be passed when executing each function of ModelAdapter.
ModelAdapterScope
Widget for setting ModelAdapter.
ModelAggregateQuery<TValue extends AsyncAggregateValue>
A query to output an aggregate of the documents in a collection.
ModelBatchCollectionBuilder<TModel extends DocumentBase>
Builder for batch processing.
ModelBatchDocument<T>
Documentation class for batch.
ModelBatchDocumentBuilder<T>
Builder for batch processing.
ModelBatchRef
Reference class for batching.
ModelCounter
Define the field as a counter.
ModelCounterConverter
ModelFieldValueConverter to enable automatic conversion of ModelCounter as ModelFieldValue.
ModelCounterFilter
Filter class to make ModelCounter available to ModelQuery.filters.
ModelDate
Define the field as a date.
ModelDateConverter
ModelFieldValueConverter to enable automatic conversion of ModelDate as ModelFieldValue.
ModelDateFilter
Filter class to make ModelDate available to ModelQuery.filters.
ModelFieldValue<T>
Class for defining special field values.
ModelFieldValueConverter<T extends ModelFieldValue>
Use this when registering special classes in ModelFieldValue.
ModelFieldValueFilter<T extends ModelFieldValue>
Adapter class for determining the behavior of ModelFieldValue in ModelQuery.filters.
ModelGeoValue
Define a model GeoValue that stores location information.
ModelGeoValueConverter
ModelFieldValueConverter to enable automatic conversion of ModelGeoValue as ModelFieldValue.
ModelGeoValueFilter
Filter class to make ModelGeoValue available to ModelQuery.filters.
ModelImageUri
Define the field as an image URI.
ModelImageUriConverter
ModelFieldValueConverter to enable automatic conversion of ModelImageUri as ModelFieldValue.
ModelImageUriFilter
Filter class to make ModelImageUri available to ModelQuery.filters.
ModelInitialCollection<T>
Data to be passed to data of various ModelAdapter.
ModelInitialDocument<T>
Data to be passed to data of various ModelAdapter.
ModelInitialValue<T>
Base class for data to be passed to various ModelAdapter data.
ModelLocale
Define a model Locale that stores the locale.
ModelLocaleConverter
ModelFieldValueConverter to enable automatic conversion of ModelLocale as ModelFieldValue.
ModelLocaleFilter
Filter class to make ModelLocale available to ModelQuery.filters.
ModelLocalizedValue
Define a model LocalizedValue that stores locale and text pairs.
ModelLocalizedValueConverter
ModelFieldValueConverter to enable automatic conversion of ModelLocalizedValue as ModelFieldValue.
ModelLocalizedValueFilter
Filter class to make ModelLocalizedValue available to ModelQuery.filters.
ModelQuery
Query class for defining Model.
ModelQueryFilter
Definition class for filtering data.
ModelRefBase<T>
Class for defining relationships between models.
ModelRefBuilder<TSource, TResult>
Builder for granting relationships between models and loading data.
ModelRefBuilderBase<TSource>
Base class for defining ModelRefBuilder.
ModelRefConverter
ModelFieldValueConverter to enable automatic conversion of ModelRefBase as ModelFieldValue.
ModelRefDocumentBase<T>
Define a document base including ModelRefBase and DocumentBase.
ModelRefFilter
Filter class to make ModelRefBase available to ModelQuery.filters.
ModelRefListBuilder<TSource, TResult>
Builder for granting relationships between models and loading data.
ModelRefMapBuilder<TSource, TResult>
Builder for granting relationships between models and loading data.
ModelRefPath<T>
Class for generating ModelRefBase by specifying the path.
ModelSearch
Define searchable fields.
ModelSearchConverter
ModelFieldValueConverter to enable automatic conversion of ModelSearch as ModelFieldValue.
ModelSearchFilter
Filter class to make ModelSearch available to ModelQuery.filters.
ModelServerCommandBase
Define commands to work with the server.
ModelServerCommandBaseConverter
ModelFieldValueConverter to enable automatic conversion of ModelServerCommandBase as ModelFieldValue.
ModelServerCommandBaseFilter
Filter class to make ModelServerCommandBase available to ModelQuery.filters.
ModelServerCommandCondition
Condition class used in ModelServerCommandBase.
ModelServerCommandField
Field specification class used in ModelServerCommandBase.
ModelTimestamp
Define the field as a timestamp.
ModelTimestampConverter
ModelFieldValueConverter to enable automatic conversion of ModelTimestamp as ModelFieldValue.
ModelTimestampFilter
Filter class to make ModelTimestamp available to ModelQuery.filters.
ModelToken
Class for storing multiple tokens.
ModelTokenConverter
ModelFieldValueConverter to enable automatic conversion of ModelToken as ModelFieldValue.
ModelTokenFilter
Filter class to make ModelToken available to ModelQuery.filters.
ModelTransactionCollectionBuilder<TModel extends DocumentBase>
Builder for transactions.
ModelTransactionDocument<T>
Document class for transactions.
ModelTransactionDocumentBuilder<T>
Builder for transactions.
ModelTransactionRef
Reference class for performing transactions.
ModelUpdateNotification
This class contains data for change notifications.
ModelUri
Define the field as a URI.
ModelUriConverter
ModelFieldValueConverter to enable automatic conversion of ModelUri as ModelFieldValue.
ModelUriFilter
Filter class to make ModelUri available to ModelQuery.filters.
ModelValidationQuery
Define the validation query to be used by DatabaseValidator.
ModelVideoUri
Define the field as a video URI.
ModelVideoUriConverter
ModelFieldValueConverter to enable automatic conversion of ModelVideoUri as ModelFieldValue.
ModelVideoUriFilter
Filter class to make ModelVideoUri available to ModelQuery.filters.
NoSqlDatabase
Class for building a NoSql database model within an application.
NumRange<TNum extends num>
A class that represents a range of numbers.
RectRange<TNum extends num>
A class that represents a range of numbers.
Required
Used to annotate a named parameter p in a method or function f.
RuntimeModelAdapter
Model adapter that uses a database that runs only in the memory of the application. All data will be reset when the application is re-launched.
RuntimeModelBatchRef
ModelBatchRef for RuntimeModelAdapter.
RuntimeModelTransactionRef
ModelTransactionRef for RuntimeModelAdapter.
TestModelAdapterScope
Test scope for ModelAdapter.

Enums

DayOfWeek
Day of the week.
FirebaseRegion
Specify the Firebase region.
ModelAccessQueryType
Define the type of access to the server.
ModelAggregateQueryType
Query type for outputting an aggregate of the documents in a collection.
ModelFieldValueSource
Defines where the source of the ModelFieldValue is located.
ModelQueryFilterType
Define the filter type for ModelQuery.
ModelUpdateNotificationStatus
Defines the change status of each model.
ModelValidationQueryPermissionType
Specifies the permission type for validation.
ModelValidationQueryUserType
Specify the target user for which you want to specify ModelValidationQueryPermissionType.

Mixins

ModelFieldValueAsMapMixin<T>
Mix-in to allow Json serialization and deserialization of ModelFieldValue.
ModelRefLoaderMixin<T>
It is available by mixing in when using ModelRefBase in DocumentBase.value.
ModelRefMixin<T>
A mix-in to define that it is a relationship between models in DocumentBase, etc.
SearchableCollectionMixin<TModel extends SearchableDocumentMixin>
Mix-ins to create collections for which search functions are available.
SearchableDocumentMixin<T>
Mix-in to make documents searchable.
SearchableInitialCollectionMixin<T>
Mix-in to search for ModelInitialCollection.

Extensions

BooleanExtensions on bool
Provides extended methods for bool.
DateTimeExtensions on DateTime
Provides extended methods for DateTime.
DateTimeIterableExtensions on Iterable<DateTime>
Provides extended methods for DateTime arrays.
DoubleExtensions on double
Provides extended methods for double.
DoubleIterableExtensions on Iterable<double>
Provides extended methods for double arrays.
DurationExtensions on Duration
Provides extended methods for Duration.
DynamicMapExtensions on Map<String, dynamic>
Provides extended methods for DynamicMap.
DynamicMapModelFieldValueExtensions on DynamicMap
Provides extension methods for DynamicMap for ModelFieldValue.
InterableOfIterableExtensions on Iterable<Iterable<T>>
Provides extended methods for Iterable arrays.
IntExtensions on int
Provides extended methods for int.
IntIterableExtensions on Iterable<int>
Provides extended methods for int arrays.
IterableExtensions on Iterable<T>
Provides extended methods for T arrays.
JsonDynamicListExtensions on DynamicList
Provides Json extension methods for DynamicList.
JsonDynamicMapExtensions on DynamicMap
Provides Json extension methods for DynamicMap.
ListenableIterableExtensions on Iterable<T>
Provides an extension method for Iterable that includes Listenable as an element.
ListExtensions on List<T>
Provides extended methods for List in T.
MapExtensions on Map<K, V>
Provides extended methods for Map.
NullableDoubleExtensions on double?
Provides an extension method for double that is nullable.
NullableIntExtensions on int?
Provides an extension method for int that is nullable.
NullableIterableExtensions on Iterable<T>?
Provides an extension method for Iterable that is nullable.
NullableListExtensions on List<T>?
Provides an extension method for List that is nullable.
NullableMapExtensions on Map<K, V>?
Provides an extension method for Map that is nullable.
NullableNumExtensions on num?
Provides an extension method for num that is nullable.
NullableObjectExtensions on Object?
Provides an extension method for List that is nullable.
NullableSetExtensions on Set<T>?
Provides an extension method for Set that is nullable.
NullableStringExtensions on String?
Provides an extension method for String that is nullable.
NullableUriExtensions on Uri?
Provides an extension method for Uri that is nullable.
NullableValueIterableExtensions on Iterable<T?>
Provides an extension method for Iterable whose value is nullable.
RandomExtensions on Random
Provides extended methods for Random.
SetExtensions on Set<T>
Provides extended methods for Set.
StringExtensions on String
Provides extended methods for String.
UriExtensions on Uri
Provides extended methods for Uri.

Constants

kDefaultSearchableFieldKey → const String
Default field key to form a searchable field.
kTimeFieldKey → const String
Field key to store the document update time.
kTypeFieldKey → const String
Field key to save the type of the special object in the field.
kUidFieldKey → const String
Field key to store the last part of the document path (ddd for aaa/bbb/ccc/ddd).
nullOfBool → const bool?
A null object with a defined type of bool?
nullOfDouble → const double?
A null object with a defined type of double?
nullOfDynamicList → const DynamicList?
A null object with a defined type of DynamicList?
nullOfDynamicMap → const DynamicMap?
A null object with a defined type of DynamicMap?
nullOfInt → const int?
A null object with a defined type of int?
nullOfNum → const num?
A null object with a defined type of num?
nullOfString → const String?
A null object with a defined type of String?
zeroOfNum → const num
A 0 object with a defined type of num?

Properties

sprintf ↔ PrintFormat
getter/setter pair

Functions

generateCode(int length, {int seed = 0, String charSet = "23456789abcdefghjkmnpqrstuvwxy"}) String
Generates and returns a random string with the number of characters given by length.
initializeDateFormatting([String? locale, String? ignored]) Future<void>
This should be called for at least one locale before any date formatting methods are called. It sets up the lookup for date symbols. Both the locale and ignored parameter are ignored, as the data for all locales is directly available.
jsonDecodeAsList<T extends Object?>(String json, [List<T> defaultValue = const []]) List<T>
Converts json to a Json-decoded List
jsonDecodeAsMap<T extends Object?>(String json, [Map<String, T> defaultValue = const {}]) Map<String, T>
Converts json to a Json-decoded Map<String, dynamic> object.
jsonEncodable(Object? o) bool
If this object is Json encodable, true is returned.
nullOfList<T>() List<T>?
A null object with a defined type of List<T>?
nullOfMap<K, V>() Map<K, V>?
A null object with a defined type of Map<K, V>?
nullOfSet<T>() Set<T>?
A null object with a defined type of Set<T>?
uuid({DateTime? baseTime, bool reverse = false}) String
Generate and retrieve the UUID for Version 7.
wait(Iterable futures) Future<void>
Wait until all Futures given in futures are completed.

Typedefs

ApiResponse = Response
An HTTP response where the entire response body is known in advance.
ApiResquest = Request
An HTTP request where the entire request body is known in advance.
DynamicList = List
Represents the type of List<dynamic>.
DynamicMap = Map<String, dynamic>
Represents the type of Map<String, dynamic>.
ModelRef<T> = ModelRefBase<T>?
Class for defining relationships between models.

Exceptions / Errors

DatabaseValidationExcepction
Defines errors during database validation.