WidgetbookInstance constructor
WidgetbookInstance({
- required AppInfoInstance appInfoInstance,
- required List<
WidgetbookCategoryInstance> categories, - ThemeInstance? lightThemeInstance,
- ThemeInstance? darkThemeInstance,
- ThemeModeInstance? defaultThemeInstance,
- 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),
),
],
);