WidgetbookInstance constructor

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

Creates a new instance of WidgetbookInstance

Implementation

WidgetbookInstance(
    {required AppInfoInstance appInfoInstance,
    required List<WidgetbookCategoryInstance> categories,
    ThemeInstance? lightThemeInstance,
    ThemeInstance? darkThemeInstance,
    ThemeModeInstance? defaultThemeInstance,
    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 (defaultThemeInstance != null)
            Property(key: 'defaultTheme', instance: defaultThemeInstance),
          if (devices.isNotEmpty)
            Property(
              key: 'devices',
              instance: ListInstance(instances: devices),
            ),
          Property(
            key: 'categories',
            instance: ListInstance(instances: categories),
          ),
        ],
      );