flutter_kore library

Classes

ApiAnnotation
Annotate class as api that holds server requests
AppNavigation
Annotation to mark app navigation interactor
AsyncConnectorCall<InstanceType, InputStateType>
Async callable proxy class for Connector
AsyncPartConnectorCall<InstanceType, InputStateType>
Callable proxy class for PartConnector
BaseDeepLinksInteractor<MState>
Base interactor for handling links in app
BaseIndependentView<KWidget extends StatefulWidget>
Main class for independent flutter_kore view Contains dependencies, event bus subscription and parts, receives WidgetsBinding post frame callback and manages AutomaticKeepAliveClientMixin for this view
BaseInstancePart<Input, T extends KoreInstance>
Base class for parts Parts are smallest kore instances They do not have state or dependencies But they can receive events and contain other parts inside Part also contain reference to parent instance and root parent instance of parts tree You can specify input type for part Parts must be annotated with instancePart annotation You also can execute requests and cancel them automatically when part will be disposed with ApiCaller.executeAndCancelOnDispose method
BaseInteractor<State, Input>
Main class to extend to create interactor
BaseKoreInstance<Input>
Base class for kore instances
BaseNavigationInteractor<IState, Input, AppTabType, RoutesClassType extends RoutesBase, DialogClassType extends RoutesBase, BottomSheetClassType extends RoutesBase, RouteType, DialogType, BottomSheetType, DeepLinksInteractorType extends BaseDeepLinksInteractor>
Base class for navigation interactor Contains state and input parameters as every other interactor Also you need to specify type parameters for tabs, routes, dialogs and bottom sheets
BaseRequest<T, I, B, F>
Main class for http requests
BaseScopes
Default scopes for app
BaseView<KWidget extends BaseWidget, ScreenState, ViewModel extends BaseViewModel<KWidget, ScreenState>>
Main class for flutter_kore view It holds reference to view model, receives WidgetsBinding post frame callback and manages AutomaticKeepAliveClientMixin for this view. It also can receive events
BaseViewModel<KWidget extends StatefulWidget, MState>
Main class to extend to create view models Contains dependencies, event bus subscription, state and parts
BaseWidget
Base class for Stateful widget with view model
BaseWrapper<Input>
Base class that wraps logic for working with third party dependency
BottomSheetLinkHandler
Link handler for bottom sheets
Connector
Class containing instance type to connect to given instance
ConnectorCall<InstanceType, InputStateType>
Callable proxy class for Connector
Debouncer
Utility class to debounce actions
DefaultConnector<T>
DefaultNavigationRouteBuilder
Default route builder used by navigation interactor
DependentKoreInstanceConfiguration
Model class describing confifuration for dependent kore instance
DialogLinkHandler
Link handler for dialogs
DioRequest<T>
Main implementation for Http requests using dio.Dio
EnsureCloseRequestedEvent
Event for navigation used to prevent screen from close if UIRouteSettings.needToEnsureClose is true
ErrorData<T>
StatefulData indicating error state for underlying object holds error object or null
ErrorFieldState
Type of FieldValidationState indicating that field contains error
EventBus
Basic Event bus implementation
FieldValidationState
Sealed class with possible input field states
GenericLinkHandler
Generic link handler used for regexes parsing
Widget that initializes global navigation container
IgnoredFieldState
Type of FieldValidationState indicating that field is ignored
IndependentNavigationView<KWidget extends StatefulWidget>
Base independent view state if app uses navigation Must be extended by any independent view if navigation used
Instance
Annotate class as custom kore instance
InstanceCollection
Main class to store instances of kore elements
InstancesModule
Class describing set of dependencies that need to be initialized if instance depending on this module is created
KoreApp<NavigationInteractorType extends BaseNavigationInteractor<dynamic, dynamic, dynamic, RoutesBase, RoutesBase, RoutesBase, dynamic, dynamic, dynamic, BaseDeepLinksInteractor>>
Main class for flutter_kore application
KoreInstanceConfiguration
Model class describing configuration for basic kore instance
Annotation describing link parameters for given route
LinkHandler
Class describing parser for link and mapping to route
LinkMapper
Class describing mapper of url parameters to route
LinkParams
Simple model class with link params
LoadingData<T>
StatefulData indicating loading state for underlying object
MainApiAnnotation
Annotate class as main Api holder
MainApp
Annotate main app class
Class describing app navigation settings
Class describing how to open app routes You can override builders for bottom sheets, dialogs and routes
Base view state if app uses navigation Must be extended by any view if navigation used
Base view model if app uses navigation Must be extended by any view if navigation used
Observable<T>
Base class for observable object
ObservableChange<T>
Simple model class describing object change - next and previous values
PartConnector
Class containing instance part type to connect to given instance
PartConnectorCall<InstanceType, InputStateType>
Callable proxy class for PartConnector
RequestCollection
Collection of currently running requests
RequestSettings<I>
Settings for BaseRequest
Response<ItemType>
Main class to hold http response
RestrictedInstancePart<Input, T extends KoreInstance>
BaseInstancePart that applies to given KoreInstance subtype
ResultState<T extends Object>
Helper class that holds result of function execution
RouteLinkHandler
Link handler for routes
RoutesAnnotation
Annotation to mark class containing abstract routes description
RoutesBase
Base class for route declarations
ScopedContainer<T>
Simple class to count references for objects
SimulateResponse
Class to simulate server response
StatefulData<T>
Sealed class that holds either loading state, some typed data or error
StateFulInstanceSettings
Settings for stateful instance. Contain state restore flags and state id
StateStream<T>
Wrapper class for state updates for StateFulInstanceSettings
Store<State>
Store is providing access to State for current containing class
StoreChange<Value>
Class to hold store change
SuccessData<T>
StatefulData indicating success state for underlying object holds result or null
SyncFuture
Helper class to call any Future with addition of timeout handling
TabNavigationInitializer
Widget that initializes global navigation container
UIBottomSheetRouteSettings
Class describing bottom sheet route settings
UIDialogRouteSettings
Class describing dialog route settings
UINavigationSettings
Class containing settings for app navigation
UIRoute<T>
Class describing route for navigation interactor methods Used as input for BaseNavigationInteractor.routeTo, BaseNavigationInteractor.showDialog and BaseNavigationInteractor.showBottomSheet You need to specify type of name field can be BottomSheetNames, DialogNames or RouteNames or anything else
UIRouteModel
Class describing route data in navigation stack
UIRouteSettings
Class describing route settings
UniversalInstancePart<Input>
BaseInstancePart that applies to every KoreInstance subtype
ValidFieldState
Type of FieldValidationState indicating valid input field state

Enums

RequestMethod
Http request method

Mixins

ApiCaller<Input>
Mixin containing logic to collect requests in collection and cancel them in a batch when BaseKoreInstance.dispose called
DependentKoreInstance<Input>
Mixin that contains declarations of instance dependencies
EventBusReceiver
Mixin that subscribe to event bus events
FormViewModelMixin<Widget extends StatefulWidget, State>
Mixin with helper methods to create form views
KoreInstance<T>
Base mixin for kore instance
StatefulKoreInstance<State, Input>
Base class for storing data
SynchronizedKoreInstance<Input>
Base class for executing operations in queue, enabling to sync operations if needed
UseDisposableMixin<KWidget extends StatefulWidget>
Mixin with methods to create disposable instances that will be disposed when instance is disposed

Constants

api → const ApiAnnotation
Annotate class as api that holds server requests
appNavigation → const AppNavigation
Annotation to mark app navigation interactor
asyncBasicInstance → const Instance
Annotate class as async default kore instance
asyncInstancePart → const Instance
Annotate class as async kore instance part
asyncLazySingleton → const Instance
Annotate class as async lazy singleton kore instance
asyncSingleton → const Instance
Annotate class as async singleton kore instance
basicInstance → const Instance
Annotate class as default kore instance
bottomSheets → const RoutesAnnotation
Annotation to mark class containing bottom sheet routes description
dialogs → const RoutesAnnotation
Annotation to mark class containing dialog routes description
instancePart → const Instance
Annotate class as kore instance part
lazySingleton → const Instance
Annotate class as lazy singleton kore instance
mainApi → const MainApiAnnotation
Annotate class as main Api holder
mainApp → const MainApp
Annotate main app class
routes → const RoutesAnnotation
Annotation to mark class containing routes description
singleton → const Instance
Annotate class as singleton kore instance

Typedefs

AuthHandler = void Function(Dio dio)
Function that handles authorization for given BaseRequest
DatabaseGetDelegate<ItemType> = Future Function(Map? headers)
DatabasePutDelegate<ItemType> = Future Function(ItemType parsedItem)
DefaultInputType = Map<String, dynamic>
EventBusSubscriber<T> = void Function(T event)
LocaleCacheGetDelegate = String? Function(String name)
LocaleCachePutDelegate = Future<bool> Function(String name, String data)
ResponseParser<ItemType> = Future<ItemType> Function(dynamic result, Map? headers)
RetryHandler = Future Function()
Function that handles retry for given BaseRequest
StateUpdater<State> = void Function(State state)
StoreMapper<Value, State> = Value Function(State state)
ValidatorsMap = Map<GlobalKey<State<StatefulWidget>>, Future<FieldValidationState> Function()>

Exceptions / Errors

IllegalArgumentException
Default exception indicating that instances throughout kore app is being used with wrong arguments
IllegalStateException
Default exception indicating that instances throughout kore app is being used in wrong state
NotRecognizedHttpException
Default exception indicating that http request failed with unknown error