Codelessly class

The entry point for accessing the Codelessly SDK.

Usage:

// Initialize SDK Codelessly.instance.initializeSDK(CodelesslyConfig(authToken: XXX));

// Get global instance Codelessly.instance;

Look at CodelesslyConfig for more information on available configuration options.

Constructors

Codelessly({CodelesslyConfig? config, Map<String, String>? data, Map<String, CodelesslyFunction>? functions, CacheManager? cacheManager, AuthManager? authManager, DataManager? publishDataManager, DataManager? previewDataManager, DataManager? templateDataManager})
Creates a new instance of Codelessly.

Properties

authManager AuthManager
Returns the authentication manager that is responsible for managing auth token validation and project ID retrieval.
no setter
cacheManager CacheManager
Returns the cache manager that is responsible for providing an interface to the local device's cache.
no setter
cloudDatabase CloudDatabase?
Provides access to the cloud storage of this SDK instance. If it is null, it means it has not yet been initialized.
no setter
config CodelesslyConfig?
Returns the configuration options provided to this SDK.
no setter
data Map<String, dynamic>
A map of data that is passed to loaded layouts for nodes to replace their property values with.
final
dataManager DataManager
A helper getter to retrieve the active DataManager based on the PublishSource provided by the CodelesslyConfig.
no setter
errorHandler → CodelesslyErrorHandler
Returns the error handler that is responsible for capturing and reporting errors to the Codelessly servers for this instance of the SDK.
no setter
firebaseApp → FirebaseApp
Returns the local instance of the Firebase SDK that this instance of the Codelessly SDK is using.
no setter
firebaseAuth → FirebaseAuth
Returns the local instance of the FirebaseAuth SDK. Used by the auth manager to retrieve auth data.
no setter
firebaseFirestore → FirebaseFirestore
Returns the local instance of the Firestore SDK. Used by the data manager to retrieve server data.
no setter
functions Map<String, CodelesslyFunction>
A map of functions that is passed to loaded layouts for nodes to call when they are triggered.
final
hashCode int
The hash code for this object.
no setterinherited
localDatabase LocalDatabase
Provides access to the local storage of this SDK instance.
no setter
previewDataManager DataManager
Returns the data manager that is responsible for retrieving layout information from the Codelessly servers or the local device's cache.
no setter
publishDataManager DataManager
Returns the data manager that is responsible for retrieving layout information from the Codelessly servers or the local device's cache.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
status CStatus
Returns the current status of this SDK instance.
no setter
statusStream Stream<CStatus>
Returns a stream of status updates for this SDK instance.
no setter
templateDataManager DataManager
Returns the data manager that is responsible for retrieving layout information from the Codelessly servers or the local device's cache.
no setter

Methods

addBreakpointsListener(BreakpointsListener callback) → void
Adds a global listener for navigation.
addNavigationListener(NavigationListener callback) → void
Adds a global listener for navigation.
configure({CodelesslyConfig? config, Map<String, String>? data, Map<String, CodelesslyFunction>? functions, CacheManager? cacheManager, AuthManager? authManager, DataManager? publishDataManager, DataManager? previewDataManager, DataManager? templateDataManager}) CStatus
Configures this instance of the SDK with the provided configuration options. This will mark the SDK as ready to be initialized.
dispose({bool sealCache = true}) → void
Disposes this instance of the SDK permanently along with all of its managers.
initErrorHandler({required bool automaticallySendCrashReports}) → void
Initializes the internal Firestore instance used by this SDK and configures the error handler to use it.
initFirebase({required CodelesslyConfig config}) Future<void>
Initializes the internal Firebase instance used by this SDK. This will only fully run once if the FirebaseApp instance is not already initialized. If it is initialized, this is ignored.
initialize({CodelesslyConfig? config, Map<String, dynamic>? data, Map<String, CodelesslyFunction>? functions, CacheManager? cacheManager, AuthManager? authManager, DataManager? publishDataManager, DataManager? previewDataManager, DataManager? templateDataManager, bool initializeDataManagers = true}) Future<CStatus>
Initializes this instance of the SDK.
log(String message, {bool largePrint = false}) → void
logError(String message, {required Object? error, required StackTrace? stackTrace}) → void
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyBreakpointsListener(BuildContext context, Breakpoint breakpoint) → void
Calls navigation listeners when navigation happens. Provided context must be of the destination widget. This context can be used to retrieve new CodelesslyContext.
notifyNavigationListeners(BuildContext context) → void
Calls navigation listeners when navigation happens. Provided context must be of the destination widget. This context can be used to retrieve new CodelesslyContext.
removeBreakpointsListener(BreakpointsListener callback) → void
Removes a global navigation listener.
removeNavigationListener(NavigationListener callback) → void
Removes a global navigation listener.
reset({bool clearCache = false}) FutureOr<void>
Resets the state of the SDK. This is useful for resetting the data without disposing the instance permanently.
toString() String
A string representation of this object.
inherited

Operators

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

Static Properties

instance Codelessly
Returns the global singleton instance of the SDK. Initialization is needed before formal usage.
no setter