ModBloc<In extends ModBaseDTO, Out> class abstract

Base class for business logic components (BLoC's). Opens data channel with binded widget.

Uses parametric types for both input and output types:

  • In: data type used for bloc data input
  • Out: data type returned by operation. Will be wrapped inside an ResourceResult when sent to UI

Child classes must override abstract methods.

Implementers

Constructors

ModBloc()

Properties

controller StreamController<ModResourceResult<Out>?>
Stream controller
final
dataStream Stream<ModResourceResult<Out>?>
Data stream (pipe) with binded widget
no setter
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

buildResult({Out? data = null, int code = -1}) ModResourceResult<Out>
Encapsulate build result objects creation to avoid inconsistencies
dispose() → void
Free resources
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
performOperation(In dto) → void
Abstraction to perform some operation using params received. Must be overriden by children.
processData(ModResourceResult<Out>? data) → void
Send data to binded widget automatically triggering a rebuild
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited