WidgetbookInstance constructor

WidgetbookInstance({
  1. required AppInfoInstance appInfoInstance,
  2. required List<CategoryInstance> categories,
  3. ThemeInstance? lightThemeInstance,
  4. ThemeInstance? darkThemeInstance,
  5. List<DeviceInstance> devices = const <DeviceInstance>[],
})

Creates a new instance of WidgetbookInstance

Implementation

WidgetbookInstance({
  required AppInfoInstance appInfoInstance,
  required List<CategoryInstance> categories,
  ThemeInstance? lightThemeInstance,
  ThemeInstance? darkThemeInstance,
  List<DeviceInstance> devices = const <DeviceInstance>[],
}) : super(
        name: 'Widgetbook',
        properties: [
          Property(key: 'appInfo', instance: appInfoInstance),
          if (lightThemeInstance != null)
            Property(key: 'lightTheme', instance: lightThemeInstance),
          if (darkThemeInstance != null)
            Property(key: 'darkTheme', instance: darkThemeInstance),
          if (devices.isNotEmpty)
            Property(
              key: 'devices',
              instance: ListInstance(instances: devices),
            ),
          Property(
            key: 'categories',
            instance: ListInstance(instances: categories),
          ),
        ],
      );