CodelesslyWidgetController class
The provides advanced explicit control over the state of the instantiated CodelesslyWidget that it is attached to.
The SDK must be instantiated when using a CodelesslyWidget or CodelesslyWidgetController.
The SDK can be instantiated in several ways:
-
Using the global instance of the SDK by not passing any of the relevant parameters. Initialization of the global instance is done implicitly if not already initialized.
-
Using a custom codelessly instance, initialization of the codelessly instance must be done explicitly.
-
Using a custom config, which will be used to initialize the global codelessly instance.
- Inheritance
-
- Object
- ChangeNotifier
- CodelesslyWidgetController
Constructors
- CodelesslyWidgetController({String? layoutID, Codelessly? codelessly, CodelesslyConfig? config, PublishSource? publishSource, WidgetBuilder? loadingBuilder, CodelesslyWidgetErrorBuilder? errorBuilder, CodelesslyWidgetLayoutBuilder? layoutBuilder = _defaultLayoutBuilder, LayoutRetrieverBuilder? layoutRetrievalBuilder, AuthManager? authManager, DataManager? publishDataManager, DataManager? previewDataManager, DataManager? templateDataManager, CacheManager? cacheManager})
- Creates a CodelesslyWidgetController.
Properties
- authManager → AuthManager?
-
Optional auth manager for advanced control over the SDK's authentication
flow.
final
- cacheManager → CacheManager?
-
Optional cache manager for advanced control over the SDK's caching
behavior.
final
- codelessly ↔ Codelessly?
-
The Codelessly instance to use.
getter/setter pair
- config ↔ CodelesslyConfig
-
Holds initialization configuration options for the SDK.
latefinal
- createdIntrinsicCodelessly ↔ bool
-
A boolean that helps keep track of whether this controller created an
intrinsic Codelessly instance automatically.
latefinal
- dataManager → DataManager
-
Helper getter to retrieve the active data manager being used by
the Codelessly instance.
no setter
- didInitialize ↔ bool
-
A boolean that helps keep track of the state of this controller's
initialization.
getter/setter pair
- effectiveCodelessly → Codelessly
-
A convenience getter that returns the provided codelessly instance, or,
if it's null, returns the global Codelessly.instance.
no setter
- errorBuilder → CodelesslyWidgetErrorBuilder?
-
Optional placeholder widget to show if the layout fails to load.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- isGlobalInstance → bool
-
A convenience getter that decides whether this controller is configured
to use an explicitly-controlled Codelessly instance, or to use the
global Codelessly.instance.
no setter
- layoutBuilder → CodelesslyWidgetLayoutBuilder?
-
Optional widget builder to wrap the rendered layout widget with for
advanced control over the layout's behavior.
final
- layoutID ↔ String?
-
The ID of the layout provided from your Codelessly dashboard.
This represents a single screen or canvas.
getter/setter pair
- layoutRetrievalBuilder → LayoutRetrieverBuilder?
-
Returns a widget that decides how to load nested layouts of a rendered
node.
final
- loadingBuilder → WidgetBuilder?
-
Optional placeholder widget to show while the layout is loading.
final
- previewDataManager → DataManager?
-
Optional preview data manager for advanced control over the SDK's
preview data flow.
final
- publishDataManager → DataManager?
-
Optional publish data manager for advanced control over the SDK's
publish data flow.
final
- publishModel → SDKPublishModel?
-
Helper getter to retrieve the active publish model being used by
the Codelessly instance.
no setter
-
publishModelStream
→ Stream<
SDKPublishModel?> -
Helper getter to retrieve the active publish model stream being used by
the Codelessly instance.
no setter
- publishSource → PublishSource
-
Helper getter to retrieve the publish source being used by
the Codelessly instance.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- templateDataManager → DataManager?
-
Optional template data manager for advanced control over the SDK's
template data flow.
final
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
copyWith(
{String? layoutID, Codelessly? codelessly, CodelesslyConfig? config, PublishSource? publishSource, AuthManager? authManager, DataManager? publishDataManager, DataManager? previewDataManager, DataManager? templateDataManager, CacheManager? cacheManager, WidgetBuilder? loadingBuilder, CodelesslyWidgetErrorBuilder? errorBuilder, CodelesslyWidgetLayoutBuilder? layoutBuilder, LayoutRetrieverBuilder? layoutRetrievalBuilder, FirebaseApp? firebaseApp}) → CodelesslyWidgetController - Creates a copy of this controller with the provided parameters. If no parameters are provided, then the current parameters are used. Note that some fields are nullable, so setting some values here to null may not have the desired effect.
-
dispose(
) → void -
Discards any resources used by the object. After this is called, the
object is not in a usable state and should be discarded (calls to
addListener will throw after the object is disposed).
override
-
initialize(
{String? layoutID}) → void - Listens to the SDK's status. If the SDK is done, then we can start listening to the data manager's status for layout updates.
-
log(
String message) → void -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited