Skip to main content

duskmoon_widgets 2.2.0 copy "duskmoon_widgets: ^2.2.0" to clipboard
duskmoon_widgets: ^2.2.0 copied to clipboard

Adaptive widget library for DuskMoon Design System

duskmoon_widgets #

Adaptive widget library for the DuskMoon Design System. Includes platform-aware widgets plus chat components for LLM-style conversations.

Installation #

flutter pub add duskmoon_widgets

Usage #

import 'package:duskmoon_widgets/duskmoon_widgets.dart';

// Buttons
DmButton(
  variant: DmButtonVariant.filled,
  onPressed: () {},
  child: const Text('Submit'),
);

// Inputs
DmTextField(placeholder: 'Enter text');
DmSwitch(value: true, onChanged: (v) {});

// Navigation
DmAppBar(title: const Text('Home'));

// Chat
DmChatView(
  messages: const [],
  onSend: (text, attachments) {},
);

DmChatView includes a leading rail with one tick per user message. Click a tick to jump to that turn, or hover/focus it to preview the prompt and reply. The rail stays vertically centered with compact spacing that adapts to the message count and available height. Very long conversations can scroll the rail independently. Keyboard activation is supported. Set showMessageNavigation: false to hide it.

Platform Resolution #

Three-tier resolution order:

  1. Widget override — platformOverride parameter on each widget
  2. DmPlatformOverride — InheritedWidget for app-level override
  3. Theme.of(context).platform — automatic platform detection
// Override globally
DmPlatformOverride(
  style: DmPlatformStyle.cupertino,
  child: MyApp(),
);

// Override per widget
DmButton(
  platformOverride: DmPlatformStyle.material,
  onPressed: () {},
  child: const Text('Always Material'),
);

Available Widgets #

Category Widgets
Scaffold DmScaffold, DmActionList
Buttons DmButton, DmIconButton, DmFab
Inputs DmTextField, DmCheckbox, DmSwitch, DmSlider
Layout DmCard, DmDivider
Navigation DmAppBar, DmBottomNav, DmTabBar, DmDrawer
Data Display DmBadge, DmChip, DmAvatar
Chat DmChatView, DmChatInput, DmChatBubble, DmChatTheme

License #

MIT for DuskMoon code. The private Markdown parser retains the Dart authors' BSD-3-Clause license. The private native math renderer retains its Apache-2.0 license and KaTeX MIT notices, including bundled fonts. See THIRD_PARTY_LICENSES, Markdown provenance and math renderer provenance.