DateTime Arg

The DateTime arg renders input fields in the Widgetbook UI where you can dynamically enter a DateTime value for a widget property.

Variants

The DateTime arg has two variants:

  • DateTimeArg: Allows you to enter a DateTime value. Does not accept null values.
  • NullableDateTimeArg: Allows you to enter a DateTime value or set it to null. Useful when the property is optional.

DateTimeArg

Example

Usage

my_widget.stories.dart
final $Default = _Story(
  args: _Args(
    dateTime: DateTimeArg(DateTime(2026)), 
  ),
);

NullableDateTimeArg

Example

Usage

my_widget.stories.dart
final $Default = _Story(
  args: _Args(
    dateTime: NullableDateTimeArg(null), 
  ),
);