flutter_widget_model library

Package that allows you to treat your models like widgets. Used with flutter_hooks.

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

Classes

AssetUnit<T extends Object>
Abstract class for handling assets. [...]
Auth
Abstract class for performing authentication. [...]
Collection<TChild extends IChild>
Abstract class that can create collections. [...]
CollectionModel<TCollection extends IDataCollection<IDataDocument<IDataField>>>
Create a data model that treats the data as a collection. [...]
Config
Class that manages the configuration of Masamune framework. [...]
ConfigField
Unit for storing data. [...]
Connectivity
Discover network connectivity configurations: Distinguish between WI-FI and cellular, check WI-FI status and more.
Const
String definition.
CountListener
Listener to listen to collection counts and reflect them in a particular field.
CSVCollection
Get data from CSV and get it as a collection. [...]
DataCollection
Collection class for storing data. [...]
DataDocument
Document that stores DataField with Key [...]
DataField
Unit for storing data. [...]
DataFieldModel
Data model for storing one-off data such as String, int, double and bool. [...]
Document<TChild extends IChild>
Abstract class that manages data with key-value pairs. [...]
DocumentModel<TDocument extends IDataDocument<IDataField>>
Create a data model that treats the data as a document. [...]
FieldModel<TField extends IDataField>
Data model for storing single-shot data such as String, int, and double. [...]
GeoData
Stores location data. [...]
Hook<R>
Hook is similar to a StatelessWidget, but is not associated to an Element. [...]
HookBuilder
A HookWidget that defer its build to a callback
HookState<R, T extends Hook<R>>
The logic and internal state for a HookWidget
HookWidget
A Widget that can use Hook [...]
IAbortable
Interruptible interface. [...]
IAsset
Interface for working with assets.
IAuth
Interface for handling authentication. [...]
ICacheable
Cacheable interface. [...]
ICastable
Interface where objects can be cast. [...]
IChild
Interface indicating that you are a child of the IPath object. [...]
IClonable
Interface where objects can be cloned. [...]
ICollection<TChild extends IChild>
Interface for using collections of data. [...]
IDataCollection<TDocument extends IDataDocument<IDataField>>
Interface for creating a DataDocument collection. [...]
IDataDocument<TField extends IDataField>
Document interface that stores IDataField by key. [...]
IDataField
Interface for saving data. [...]
IDebuggable
Interface where objects can be debugged. [...]
IDisposable
Interface that objects can be destroyed. [...]
IDoable
Interface that the object can execute. [...]
IDocument<TChild extends IChild>
Interface that can create the document of KeyValue pair. [...]
IErrorable
Interface that allows objects to be error managed. [...]
IGroupable
Interface for grouping objects. [...]
ILocalable
Interface for locating objects. [...]
ILockable
Object lockable interface. [...]
IModel
Interface for the model.
IObservable
Interface for monitoring objects. [...]
IOrderable
Interface where objects can be reordered. [...]
IParent
Interface indicating that you are a parent of the IPath object. [...]
IPath
Interface that can manage data by path. [...]
IProgressable
Interface that can track the progress. [...]
ISearchable
Interface to make it a searchable class.
ISortable
Interface to make it a sortable class.
ITask
Interface for performing tasks. [...]
IUnit<TValue extends Object>
Interface for defining the data part of the path. [...]
IWaitable
Interface where objects can wait. [...]
JoinableDataCollection
Class for adding new data to a data collection. [...]
JoinableDataDocument
Class for adding new data to a data document. [...]
Json
Json converter. [...]
LocalCollection
Get the Local collection. [...]
LocalCollectionModel
Data model with a data structure for collections. [...]
LocalDocument
Manage Local documents. [...]
LocalDocumentModel
Model for storing data in Key-Value-Pair document format. [...]
Localize
Class to translate. [...]
Log
Class that outputs logs. [...]
Math
Utility for numerical calculation.
Model<T extends IPath>
The base class of the model. [...]
ModelBuilder<T extends Model<IPath>>
Widget that displays loading if no data has been loaded.
ModelContext
Context for building a model. [...]
MultiDataCollection
It is a class that can store multiple collections and handle them as one collection. [...]
MultiDataDocument
Class that can handle multiple collections as one document. [...]
MultiDataDocumentScope
Scope setting used in MultiDataDocument.
ObjectCache<K, V>
Abstract class for creating an object cache. [...]
ObjectPool<T extends Object>
An abstract class for creating object pools. [...]
Observer
Object for monitoring. [...]
Path
Defines the path structure of the path system. [...]
PathFilter
Attach a data filter to the IPath object. [...]
PathList
List containing the path. [...]
PathListener
Monitor filter changes. [...]
PathMap
Manages pal system paths. [...]
Paths
Path-related utilities. [...]
PathTag
Class to set path tag. [...]
Prefs
Save and load data locally. [...]
Protocol
Define the protocol.
RefreshController
RuntimeCollection
Collection class for storing data. [...]
RuntimeCollectionModel
Data model with a data structure for collections on runtime. [...]
RuntimeDocument
Document that stores DataField with Key [...]
RuntimeDocumentModel
Model for storing data in Key-Value-Pair document format on runtime. [...]
ScheduleTask
Schedule at regular intervals and execute processing accordingly. [...]
SearchableLocalCollection
Search for a document through a specific key from a collection in your local database. [...]
SearchableMultiDataCollection
Create a searchable collection. [...]
SortedMap<K extends Object, V extends Object>
Map with added sorting function. [...]
StatefulHookWidget
A StatefulWidget that can use Hook [...]
Store<State, Action>
A state holder that allows mutations by dispatching actions.
Task<T extends Object>
Perform the task. [...]
TaskCollection<TChild extends IChild>
Collection class with task management function. [...]
TaskDocument<TChild extends IChild>
Document class with task management function. [...]
TaskList<T extends ITask>
Keep your tasks together and wait later. [...]
TaskQueue
Task queuing class. [...]
TaskUnit<T extends Object>
Abstract class for tasks. [...]
TemporaryCollection
Collection class for storing temporary data. [...]
TemporaryDocument
Document that stores TemporaryField with Key [...]
TemporaryField
Unit for storing temporary data. [...]
Texts
Text-related utility classes.
Unit<TValue extends Object>
Abstract class for defining Unit. [...]

Mixins

ClonableModelMixin<TClonable extends IClonable>
DataDocumentMixin<TField extends IDataField>
Mixin for setting up data documents. [...]
HookElement
An Element that uses a HookWidget as its configuration.
PathModelMixin<TPath extends IPath>
SortableDataCollectionMixin<T extends IDataDocument<IDataField>>
Abstract class for mixin that gives sorting function to collection that handles DataDocument. [...]
TaskMixin
Mixin class to add processing for task. [...]

Extensions

BoolExtension
Bool extension methods.
CollectionListenerExtension
Collection listener extension methods
CollectionListenerFutureExtension
Collection listener extension methods
DateTimeExtension
DateTime extension methods.
DoubleExtention
Double extension methods.
FutureExtension
Future extension methods
FutureIDebuggableExtension
Future extension methods for IDebuggable.
FutureITaskExtension
Extension method for asynchronous processing.
FutureITaskListExtension
Extension method for asynchronous processing.
FutureJoinableDataCollectionExtension
Class that extends Future.
FutureJoinableDataDocumentExtension
Class that extends Future.
ICastableExtension
Extension method of ICastable class.
IntExtention
Int extension methods.
IParentSetExtension
IParent extension methods.
ITaskListExtension
Extension method for task list.
IterableExtension
Iterable extension methods.
IterableFutureExtension
Iterable future extension methods.
JoinableDataCollectionExtension
Class that extends IDataCollection.
JoinableDataDocumentExtension
Class that extends IDataDocument.
ListExtension
List extension methods.
ListPool
List object pool. [...]
LocalizeDateTimeExtension
DateTime extension methods.
LocalizeStringExtension
String extension methods.
MapExtension
Extends the Map class.
MapPool
Map object pool [...]
ObjectExtension
Object extension methods.
PathFilterExtension
Path filter extension methods
PathFilterFutureExtension
Path filter extension methods
PathListenerExtension
Path listener extension methods
PathListenerFutureExtension
Path listener extension methods
PathTabExtension
Path extension methods.
QueuePool
Queue object pool. [...]
RandomExtension
Random extension methods.
SetPool
Sets object pool. [...]
SortedMapExtension
Extends the SortedMap class.
SortedMapPool
SortedMap object pool. [...]
StringExtension
String extension methods.
StringMapExtension
Map extension methods.

Constants

useTextEditingController → const _TextEditingControllerHookCreator
Creates a TextEditingController, either via an initial text or an initial TextEditingValue. [...]
_TextEditingControllerHookCreator()

Properties

debugHotReloadHooksEnabled bool
Wether to behave like in release mode or allow hot-reload for hooks. [...]
read / write
uuid String
Get UUID. [...]
read-only

Functions

isEmpty(Object object) bool
Empty character check. [...]
isNotEmpty(Object object) bool
Empty character check. [...]
openURL(String url) Future
Open a new external URL. [...]
use<R>(Hook<R> hook) → R
Register a Hook and returns its value [...]
useAnimation<T>(Animation<T> animation) → T
Subscribes to an Animation and return its value. [...]
useAnimationController({Duration duration, String debugLabel, double initialValue: 0, double lowerBound: 0, double upperBound: 1, TickerProvider vsync, AnimationBehavior animationBehavior: AnimationBehavior.normal, List<Object> keys}) AnimationController
Creates an AnimationController automatically disposed. [...]
useCollection({List<Map<String, dynamic>> initialData, OrderBy orderBy: OrderBy.none, OrderBy thenBy: OrderBy.none, String orderByKey, String thenByKey}) IDataCollection<IDataDocument<IDataField>>
You can use the Collection only within HookWidget. [...]
useContext() BuildContext
Obtain the BuildContext of the building HookWidget.
useDocument({Map<String, dynamic> initialData}) IDataDocument<IDataField>
You can use the Document only within HookWidget. [...]
useEffect(Dispose effect(), [List<Object> keys]) → void
Useful for side-effects and optionally canceling them. [...]
useFocusNode({String debugLabel, FocusOnKeyCallback onKey, bool skipTraversal: false, bool canRequestFocus: true, bool descendantsAreFocusable: true}) FocusNode
Creates and dispose of a FocusNode. [...]
useFuture<T>(Future<T> future, {T initialData, bool preserveState: true}) AsyncSnapshot<T>
Subscribes to a Future and return its current state in an AsyncSnapshot. [...]
useIsMounted() IsMounted
Returns an IsMounted object that you can use to check if the State is mounted. [...]
useListenable<T extends Listenable>(T listenable) → T
Subscribes to a Listenable and mark the widget as needing build whenever the listener is called. [...]
useMemoized<T>(T valueBuilder(), [List<Object> keys = const <dynamic>[]]) → T
Cache the instance of a complex object. [...]
usePath<T extends Object>(String path, [T defaultValue]) → T
You can use the Collection only within HookWidget. [...]
usePrevious<T>(T val) → T
Returns the previous argument called to usePrevious.
useReassemble(VoidCallback callback) → void
Runs the callback on every hot reload similar to reassemble in the Stateful widgets [...]
useReducer<State extends Object, Action>(Reducer<State, Action> reducer, {State initialState, Action initialAction}) Store<State, Action>
An alternative to useState for more complex states. [...]
useRefresh() RefreshController
Hook to update the screen.
useScrollController({double initialScrollOffset: 0.0, bool keepScrollOffset: true, String debugLabel, List<Object> keys}) ScrollController
Creates and disposes a ScrollController. [...]
useSingleTickerProvider({List<Object> keys}) TickerProvider
Creates a single usage TickerProvider. [...]
useState<T>([T initialData]) ValueNotifier<T>
Create variable and subscribes to it. [...]
useStream<T>(Stream<T> stream, {T initialData, bool preserveState: true}) AsyncSnapshot<T>
Subscribes to a Stream and return its current state in an AsyncSnapshot. [...]
useStreamController<T>({bool sync: false, VoidCallback onListen, VoidCallback onCancel, List<Object> keys}) StreamController<T>
Creates a StreamController automatically disposed. [...]
useTabController({int initialLength, TickerProvider vsync, int initialIndex: 0, List<Object> keys}) TabController
Creates and disposes a TabController. [...]
useValueChanged<T, R>(T value, R valueChange(T oldValue, R oldResult)) → R
Watches a value and calls a callback whenever the value changed. [...]
useValueListenable<T>(ValueListenable<T> valueListenable) → T
Subscribes to a ValueListenable and return its value. [...]
useValueNotifier<T>([T intialData, List<Object> keys]) ValueNotifier<T>
Creates a ValueNotifier automatically disposed. [...]

Enums

AssetType
Defines the type of asset.
ConnectivityResult
Connection status check result.
ErrorLevel
Error level definition.
LocationAuthorizationStatus
The status of the location service authorization.
OrderBy
Define the order. [...]
Timing
When to perform the following tasks.

Typedefs

Dispose() → void
IsMounted() bool
Reducer<State, Action>(State state, Action action) → State
Composes an Action and a State to create a new State. [...]