duskmoon_widgets library
Adaptive widget library for the DuskMoon Design System.
Provides platform-aware widgets that render Material or Cupertino variants based on the current platform or an explicit override.
Classes
- AdaptiveLayout
- Layout an app that adapts to different screens using predefined slots.
- Breakpoint
- A class to define the conditions that distinguish between types of screens.
- Breakpoints
- A group of standard breakpoints built according to the material specifications for screen width size.
- DmAction
- A single action entry used by DmActionList.
- DmActionList
- Renders a list of DmActions in one of three visual sizes.
- DmAdaptiveScaffold
- Implements the basic visual layout structure for Material Design 3 that adapts to a variety of screens.
- DmAppBar
- An adaptive app bar that renders Material AppBar or Cupertino navigation bar.
- DmAvatar
- An adaptive circular avatar that renders Material or Cupertino styles.
- DmBadge
- An adaptive badge indicator that renders Material or Cupertino styles.
- An adaptive bottom navigation bar (Material NavigationBar / Cupertino tab bar).
- DmButton
- An adaptive button that renders Material, Cupertino, or Fluent styles.
- DmCard
- An adaptive card container that renders Material or Cupertino styles.
- DmChatAttachment
- A file/image attachment tied to a chat message or pending input composition.
- DmChatAttachmentBlock
- Attachment block — one or more files/images.
- DmChatAttachmentBlockView
- Renders a DmChatAttachmentBlock — image thumbnails for image MIME types, file chips otherwise, with upload progress and retry affordances.
- DmChatBlock
- Base class for message content blocks. Use pattern matching on subclasses.
- DmChatBubble
- Renders a single chat message. Stateful so each block can own per-stream subscriptions without losing state across rebuilds.
- DmChatCustomBlock
-
Extensible custom block. Renderer is resolved via
DmChatTheme.customBuilders[kind]. - DmChatInput
- Chat composer — wraps DmMarkdownInput with Send/Stop/Attach controls.
- DmChatMessage
- A single chat message composed of ordered content blocks.
- DmChatTextBlock
- Markdown text block. Provide exactly one of text or stream.
- DmChatTheme
- Theme extension controlling chat visual conventions.
- DmChatThinkingBlock
- Reasoning / thinking block. Provide exactly one of text or stream.
- DmChatThinkingBlockView
- Collapsible thinking block. Auto-expands while streaming; auto-collapses when the sibling text block starts emitting; user taps override auto.
- DmChatToolCallBlock
- Tool-call block — chip-style renderer with expand-on-tap input/output.
- DmChatToolCallBlockView
- Compact status chip for a tool call. Tap expands to show input/output.
- DmChatUploadAdapter
- Adapter implemented by consumers to upload local attachments.
- DmChatView
- Composed chat view — reverse list + pinned auto-scroll + input bar.
- DmCheckbox
- An adaptive checkbox that renders Material or Cupertino styles.
- DmChip
- An adaptive chip that renders as a FilterChip or plain Chip.
- DmCodeEditor
- A code editor widget that integrates with the DuskMoon design system.
- DmCodeEditorTheme
- Derives an EditorTheme from the ambient DuskMoon theme.
- DmDivider
- An adaptive horizontal divider that renders Material or Cupertino styles.
- DmDrawer
- An adaptive side drawer that renders Material Drawer or Cupertino panel.
-
DmDropdown<
T> - An adaptive dropdown that renders Material, Cupertino, or Fluent styles.
-
DmDropdownItem<
T> - A selectable item for use in DmDropdown.
- DmFab
- An adaptive floating action button (Material FAB / Cupertino filled).
- DmIconButton
- An adaptive icon button that renders Material, Cupertino, or Fluent styles.
- DmMarkdown
- A standalone read-only markdown renderer.
- DmMarkdownConfig
- Configuration for DmMarkdown rendering features.
- DmMarkdownInput
- A markdown editor with write/preview tabs, syntax highlighting, and keyboard shortcuts.
- DmMarkdownInputController
- The public controller for DmMarkdownInput.
- DmMarkdownScrollController
- A ScrollController with heading-anchor navigation support.
- DmMermaidView
- A single destination entry used by DmBottomNav.
- DmPlatformOverride
- An InheritedWidget that overrides the platform style for its subtree.
- DmScaffold
- A convenience wrapper around DmAdaptiveScaffold that exposes named breakpoint constants and shorter parameter names for breakpoints.
- DmSlider
- An adaptive slider that renders Material or Cupertino styles.
- DmSwitch
- An adaptive toggle switch that renders Material or Cupertino styles.
- DmTab
- A single tab entry used by DmTabBar.
- DmTabBar
- An adaptive tab bar (Material TabBar / Cupertino segmented control).
- DmTextField
- An adaptive text input that renders Material or Cupertino styles.
- DuskmoonApp
- App-level platform-style provider for DuskMoon adaptive widgets.
- EditorState
- The immutable state of the code editor.
- EditorTheme
- EditorViewController
-
Consumer-facing controller that wraps
EditorViewwith convenience methods. - MermaidLayoutConfig
- MermaidRenderOptions
- MermaidTheme
- SlotLayout
- A Widget that takes a mapping of SlotLayoutConfigs to Breakpoints and adds the appropriate Widget based on the current screen size.
- SlotLayoutConfig
- Defines how SlotLayout should display under a certain Breakpoint.
Enums
- DmActionSize
- Controls how DmActionList renders its actions.
- DmButtonVariant
- Visual style variants for DmButton.
- DmChatAttachmentStatus
- Lifecycle status of an attachment.
- DmChatMessageStatus
- Lifecycle status of a chat message.
- DmChatRole
- Role of a chat message participant.
- DmChatSubmitShortcut
- Submission keyboard shortcut for DmChatInput.
- DmChatToolCallStatus
- Status of a tool-call block.
- DmFrontMatterMode
- Controls how YAML front matter at the start of a Markdown document is shown.
- DmMarkdownTab
- The active tab in a DmMarkdownInput.
- DmPlatformStyle
- The three platform rendering styles supported by adaptive widgets.
Mixins
- AdaptiveWidget
- Mixin that gives a StatelessWidget platform-adaptive rendering.
Constants
-
dmFluentLocalizationsDelegates
→ const List<
LocalizationsDelegate> - Localization delegates required for Fluent UI widgets.
- kMaterialCompactMargin → const double
- Margin value of the compact breakpoint according to the material design 3 spec.
- kMaterialCompactSpacing → const double
- Spacing value of the compact breakpoint according to the material 3 design spec.
- kMaterialMediumAndUpMargin → const double
- Margin value of the medium breakpoint according to the material design 3 spec.
- kMaterialMediumAndUpSpacing → const double
- Spacing value of the medium and up breakpoint according to the material 3 design spec.
- kMaterialPadding → const double
- Padding value of the compact breakpoint according to the material design 3 spec.
- Padding value of the default padding for the navigation rail
Functions
-
resolvePlatformStyle(
BuildContext context, {DmPlatformStyle? widgetOverride}) → DmPlatformStyle - Resolves the DmPlatformStyle for the current context.
Typedefs
- DmChatAvatarBuilder = Widget? Function(BuildContext context, DmChatRole role)
-
Avatar fallback signature — used when
DmChatView.avatarBuilderis null. - DmChatCustomBlockBuilder = Widget Function(BuildContext context, DmChatCustomBlock block)
- Custom-block renderer signature.
- DmChatRetryCallback = void Function(DmChatMessage message)
- Optional retry callback exposed on DmChatView for error recovery.
-
DmChatSendCallback
= void Function(String markdown, List<
DmChatAttachment> attachments) - Signature of the send callback — current markdown text and the set of completed pending attachments.
- Signature for a builder used by DmAdaptiveScaffold.navigationRailDestinationBuilder that converts a NavigationDestination to a NavigationRailDestination.