onInit method

  1. @override
void onInit(
  1. WidgetbookState state
)
override

Gets called on first launch of Widgetbook with the initial state.

Implementation

@override
void onInit(WidgetbookState state) {
  if (state.effectiveAddons == null) return;

  final addonsJson = state.effectiveAddons! //
      .map((addon) => addon.toJson())
      .toList();

  notifyCloud('addons', addonsJson);
}