You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -150,23 +149,9 @@ class CodelesslyWidgetController extends ChangeNotifier {
150
149
151
150
/// Listens to the SDK's status. If the SDK is done, then we can start
152
151
/// listening to the data manager's status for layout updates.
153
-
voidinitialize({
154
-
CodelesslyConfig? config,
155
-
String? layoutID,
156
-
}) {
157
-
assert(
158
-
(config ==null) != (this.config ==null),
159
-
config ==null
160
-
?'A [config] must be provided. Please provide one either in the initialize() function, or the constructor of this controller, or in the Codelessly instance.'
161
-
:'A config was already provided from '
162
-
'${effectiveCodelessly.config == null ? 'the constructor of this controller.' : 'from the configured Codelessly instance.'}'
163
-
' You cannot specify it again in the initialize function of this controller.',
log('[CodelesslyWidgetController] [$layoutID]: Verifying and listening to data manager stream.');
263
240
264
241
notifyListeners();
@@ -280,38 +257,15 @@ class CodelesslyWidgetController extends ChangeNotifier {
280
257
);
281
258
});
282
259
}
283
-
284
-
// DataManager is initialized. If the layoutID is not null, then we need
285
-
// to signal to the data manager that we want to download the layout.
286
-
// If the config has preloading set to true, then the DataManager is already
287
-
// taking care of this layout and we just need to wait. But if the config
288
-
// has preloading set to false, then we need to manually request the layout
289
-
// from the data manager on-demand.
290
-
elseif (config!.preload ==false&&
291
-
layoutID !=null&&
292
-
loadingStep ==null) {
293
-
log('[CodelesslyWidgetController] [$layoutID]: Config preloading is false.');
294
-
log('[CodelesslyWidgetController] [$layoutID]: Requesting layout [$layoutID] from data manager since preloading is false, we need to manually request it.');
295
-
log('[CodelesslyWidgetController] [$layoutID]: Using publish source $publishSource.');
@@ -335,5 +297,15 @@ class CodelesslyWidgetController extends ChangeNotifier {
335
297
);
336
298
});
337
299
}
300
+
301
+
// At this point in the execution, layoutID is null, slug is not specified.
302
+
// Preloading must be true, so this controller can only wait...
303
+
else {
304
+
if (layoutID !=null) {
305
+
log('[CodelesslyWidgetController] [$layoutID]: LayoutID specified, but preload is set to ${config.preload}, skipping to let data manager to download everything');
306
+
} else {
307
+
log('[CodelesslyWidgetController] [$layoutID]: LayoutID is null, skipping to let data manager to download everything.');
0 commit comments