layrzPreviewLightTheme function
Creates a LayrzPreviewTheme with default light-mode design tokens.
This function is a top-level tear-off that returns a PreviewThemeData suitable
for use as the theme: parameter in @Preview annotations. The widget-preview
code generator can only serialize top-level function tear-offs (not static methods
on a class), so this top-level function is the working pattern for @Preview.
Use this in your @Preview annotations:
import 'package:flutter/widget_previews.dart';
import 'package:layrz_ui/preview.dart';
@Preview(
name: 'Light',
theme: layrzPreviewLightTheme,
)
Widget previewMyWidget() => MyWidget(/* ... */);
On each call, it constructs a new LayrzPreviewTheme wrapping a fresh LayrzThemeData.light(), ensuring previewed widgets render with the complete layrz_ui light-mode theme (including LayrzTheme, DefaultTextStyle, IconTheme, and background color).
Implementation
PreviewThemeData layrzPreviewLightTheme() => LayrzPreviewTheme(data: LayrzThemeData.light());