### Changelog entry example for FSelect Source: https://github.com/duobaseio/forui/blob/main/CONTRIBUTING.md Example of a changelog entry for a widget, showing the required ordering: additions, changes, removals, fixes. Breaking changes must start with **Breaking**. ```markdown ### `FSelect` * Add `FSelect.search(...)`. * **Breaking** Rename `FSelectStyle.selectFieldStyle` to `FSelectStyle.fieldStyle`. * **Breaking** Remove `FSelectStyle.iconStyle`. Use `FSelectStyle.fieldStyle.iconStyle` instead. * Fix `FSelect` still allowing tags to be removed when disabled. ``` -------------------------------- ### Install flutter_hooks and forui_hooks Source: https://github.com/duobaseio/forui/blob/main/docs/content/docs/reference/hooks.mdx Run these commands from your Flutter project directory to install the required packages. ```bash flutter pub add flutter_hooks flutter pub add forui_hooks ``` -------------------------------- ### Bootstrap the project with make Source: https://github.com/duobaseio/forui/blob/main/CONTRIBUTING.md Bootstraps the project by installing dependencies and generating required files. The 'make bs' command is a shorthand for 'make bootstrap'. ```shell make bootstrap make bs # shorthand ``` -------------------------------- ### Basic Multi Select Example Source: https://github.com/duobaseio/forui/blob/main/docs/content/docs/widgets/form/multi-select.mdx Shows the basic usage of the Forui MultiSelect widget within a form. This example is from the Preview/Code tab and demonstrates the default configuration. ```dart // Example code is loaded externally from external snippet files. // The actual code is not shown in this source file. // Content from: @/snippets/examples/form/multi-select/default.json ``` -------------------------------- ### FOverlay constructor usage Source: https://github.com/duobaseio/forui/blob/main/docs/content/docs/widgets/foundation/overlay.mdx Usage example for the FOverlay constructor, showing how to instantiate the widget. ```dart // Code snippet from overlayUsage.json ``` -------------------------------- ### Install Forui Lucide with flutter pub add Source: https://github.com/duobaseio/forui/blob/main/docs/content/docs/reference/icon-library.mdx Run this command in your Flutter project directory to install the Forui Lucide package. Forui Lucide is bundled with the forui package, so you don't need to install it separately if you already installed forui. ```bash flutter pub add forui_lucide ``` -------------------------------- ### Generate adaptive dialog with CLI Source: https://github.com/duobaseio/forui/blob/main/docs/content/docs/widgets/overlay/dialog.mdx Use the Forui CLI to create an adaptive dialog snippet. This is the first step to get a starting point for customization. ```shell dart run forui snippet create adaptive-dialog ``` -------------------------------- ### Run development server with npm, pnpm, or yarn Source: https://github.com/duobaseio/forui/blob/main/docs/README.md Starts the development server. The commands are alternatives; choose one based on your package manager. After running, open http://localhost:3000 to view the result. ```bash npm run dev # or pnpm dev # or yarn dev ``` -------------------------------- ### Example widget with @RoutePage and @Options Source: https://github.com/duobaseio/forui/blob/main/docs_snippets/AGENTS.md Full runnable Flutter widget example. Must extend StatelessWidget, StatefulWidget, StatelessExample, or StatefulExample, be annotated with @RoutePage(), and included in main.dart's routes. The @Options annotation controls additional code inclusion. ```dart const fruits = ['Apple', 'Banana', 'Blueberry']; @RoutePage() @Options(include: [fruits]) // fruits will be included in generated snippet class CollapsiblePage extends StatefulExample { CollapsiblePage({@queryParam super.theme}); @override State createState() => _State(); } class _State extends StatefulExampleState { @override Widget example(BuildContext _) => FButton(onPress: () {}, child: Text('Click')); } @RoutePage() @Options(inline: _Accordion) // _Accordion's build method will be shown class AccordionPage extends Example { @override Widget example(BuildContext _) => const _Accordion(); } class _Accordion extends StatelessWidget { @override Widget build(BuildContext _) => FAccordion(...); // This is what gets shown } ``` -------------------------------- ### FOverlay default example Source: https://github.com/duobaseio/forui/blob/main/docs/content/docs/widgets/foundation/overlay.mdx Example of using FOverlay to composite content relative to a child widget. This is a low-level primitive typically used to build higher-level widgets. ```dart // Code snippet from overlayDefault.json ``` -------------------------------- ### Generated style file example Source: https://github.com/duobaseio/forui/blob/main/design_docs/shipped/style_generation_cli.md Example of a generated Dart file containing custom FTextFieldStyle and FLabelStyles extensions. This is the output of the style generation command. ```dart extension CustomFTextFieldStyle on Never { static FTextFieldStyle textFieldStyle({ required FColorScheme colorScheme, required FTypography typography, required FStyle style, }) => FTextFieldStyle( keyboardAppearance: colorScheme.brightness, labelLayoutStyle: _labelStyles(style: style).verticalStyle.layout, clearButtonStyle: _buttonStyles( colorScheme: colorScheme, typography: typography, style: style, ).ghost.transform( (ghost) => ghost.copyWith( iconContentStyle: ghost.iconContentStyle.copyWith( enabledStyle: IconThemeData( color: colorScheme.mutedForeground, size: 17, ), ), ), ), enabledStyle: _textFieldStateStyle( contentColor: colorScheme.primary, hintColor: colorScheme.mutedForeground, focusedBorderColor: colorScheme.primary, unfocusedBorderColor: colorScheme.border, formFieldStyle: style.enabledFormFieldStyle, typography: typography, style: style, ), disabledStyle: _textFieldStateStyle( contentColor: colorScheme.disable(colorScheme.primary), hintColor: colorScheme.disable(colorScheme.border), focusedBorderColor: colorScheme.disable(colorScheme.border), unfocusedBorderColor: colorScheme.disable(colorScheme.border), formFieldStyle: style.disabledFormFieldStyle, typography: typography, style: style, ), errorStyle: _textFieldErrorStyle( contentColor: colorScheme.primary, hintColor: colorScheme.mutedForeground, focusedBorderColor: colorScheme.error, unfocusedBorderColor: colorScheme.error, formFieldErrorStyle: style.errorFormFieldStyle, typography: typography, style: style, ), ); static FLabelStyles _labelStyles({required FStyle style}) => FLabelStyles( horizontalStyle: ( layout: const FLabelLayoutStyle( childPadding: EdgeInsets.symmetric(horizontal: 8), descriptionPadding: EdgeInsets.only(top: 2), errorPadding: EdgeInsets.only(top: 2), ), state: _labelStateStyles(style: style), ), verticalStyle: ( layout: const FLabelLayoutStyle( labelPadding: EdgeInsets.only(bottom: 5), descriptionPadding: EdgeInsets.only(top: 5), errorPadding: EdgeInsets.only(top: 5), ), state: _labelStateStyles(style: style), ), ); static FLabelStateStyles _labelStateStyles({required FStyle style}) => FLabelStateStyles( enabledStyle: style.enabledFormFieldStyle, disabledStyle: style.disabledFormFieldStyle, errorStyle: style.errorFormFieldStyle, ); } ``` -------------------------------- ### Proxy controller example Source: https://github.com/duobaseio/forui/blob/main/CONTRIBUTING.md Example of a proxy controller that delegates operations to external callbacks. It overrides toggle to call _onChange instead of managing state internally. ```dart @internal class ProxyMyWidgetController extends FMyWidgetController { bool Function(int index) _supply; void Function(int index, bool value) _onChange; ProxyMyWidgetController(this._supply, this._onChange); void update(bool Function(int index) supply, void Function(int index, bool value) onChange) { _supply = supply; _onChange = onChange; } @override Future toggle(int index) async { _onChange(index, !_supply(index)); return true; } } ``` -------------------------------- ### Explanation of specificity by match count Source: https://github.com/duobaseio/forui/blob/main/design_docs/shipped/styling_2.0.md Illustrates how the most-specific constraint matches the fewest state sets, using a two-state example. ```text Given 2 states: hovered, focused Possible sets: {}, {h}, {f}, {h,f} hovered → 2 matches: {h}, {h,f} hovered & focused → 1 match: {h,f} Fewer matches = more specific For {h,f}, resolve to the constraint matching fewest sets: hovered & focused ``` -------------------------------- ### Create Card Snippet Source: https://github.com/duobaseio/forui/blob/main/docs/content/docs/widgets/data/card.mdx Run this command in the terminal to generate a new Card snippet. It creates a basic card example that can be customized. ```shell dart run forui snippet create card ``` -------------------------------- ### CLI create subcommand help Source: https://github.com/duobaseio/forui/blob/main/design_docs/shipped/style_generation_cli.md Shows help for the 'create' subcommand, including options for all, force, and output. The output defaults to '/lib/styles'. ```shell Usage: forui style create [styles] -h, --help Print this usage information. -a, --all Create all styles. -f, --force Overwrite existing files if they exist. -o, --output The output directory or file. (defaults to "/lib/styles") Run "forui help" to see global options. ``` -------------------------------- ### Getting Started with FTheme Source: https://github.com/duobaseio/forui/blob/main/docs/content/docs/concepts/themes.mdx Forui does not manage theme brightness automatically; you must specify the theme explicitly in FTheme(...). This snippet shows the basic usage. ```dart FTheme(...) ``` -------------------------------- ### CLI help output Source: https://github.com/duobaseio/forui/blob/main/design_docs/shipped/style_generation_cli.md Displays the top-level help for the forui style command, listing available subcommands: create and ls. ```shell Usage: forui style [arguments] -h, --help Print this usage information. Available subcommands: create Create Forui widget style file(s). ls List all Forui widget styles. Run "forui help" to see global options. ``` -------------------------------- ### Install Forui Phosphor with flutter pub add Source: https://github.com/duobaseio/forui/blob/main/docs/content/docs/reference/icon-library.mdx Run this command in your Flutter project directory to install the Forui Phosphor package. This is an alternative to installing Forui Lucide. ```bash flutter pub add forui_phosphor ``` -------------------------------- ### Generate a theme with `dart run forui theme create` Source: https://github.com/duobaseio/forui/blob/main/docs/content/docs/guides/customizing-themes.mdx Run this command to generate a theme directory with a theme.dart and four part files (colors.dart, typography.dart, style.dart, icons.dart). The colors.dart and style.dart part files include starter App
extensions for custom tokens. ```shell dart run forui theme create ``` -------------------------------- ### CMake project configuration for Flutter Windows example Source: https://github.com/duobaseio/forui/blob/main/forui/example/windows/CMakeLists.txt This CMakeLists.txt configures the build for a Flutter Windows application. It sets the project name, binary name, build modes, and compiler settings. It also includes Flutter's managed build rules and defines installation steps to copy the executable, Flutter library, ICU data, plugins, native assets, and assets into the build directory. ```cmake # Project-level configuration. cmake_minimum_required(VERSION 3.14) project(example LANGUAGES CXX) # The name of the executable created for the application. Change this to change # the on-disk name of your application. set(BINARY_NAME "example") # Explicitly opt in to modern CMake behaviors to avoid warnings with recent # versions of CMake. cmake_policy(VERSION 3.14...3.25) # Define build configuration option. get_property(IS_MULTICONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) if(IS_MULTICONFIG) set(CMAKE_CONFIGURATION_TYPES "Debug;Profile;Release" CACHE STRING "" FORCE) else() if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES) set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Flutter build mode" FORCE) set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Profile" "Release") endif() endif() # Define settings for the Profile build mode. set(CMAKE_EXE_LINKER_FLAGS_PROFILE "${CMAKE_EXE_LINKER_FLAGS_RELEASE}") set(CMAKE_SHARED_LINKER_FLAGS_PROFILE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE}") set(CMAKE_C_FLAGS_PROFILE "${CMAKE_C_FLAGS_RELEASE}") set(CMAKE_CXX_FLAGS_PROFILE "${CMAKE_CXX_FLAGS_RELEASE}") # Use Unicode for all projects. add_definitions(-DUNICODE -D_UNICODE) # Compilation settings that should be applied to most targets. # # Be cautious about adding new options here, as plugins use this function by # default. In most cases, you should add new options to specific targets instead # of modifying this function. function(APPLY_STANDARD_SETTINGS TARGET) target_compile_features(${TARGET} PUBLIC cxx_std_17) target_compile_options(${TARGET} PRIVATE /W4 /WX /wd"4100") target_compile_options(${TARGET} PRIVATE /EHsc) target_compile_definitions(${TARGET} PRIVATE "_HAS_EXCEPTIONS=0") target_compile_definitions(${TARGET} PRIVATE "$<$:_DEBUG>") endfunction() # Flutter library and tool build rules. set(FLUTTER_MANAGED_DIR "${CMAKE_CURRENT_SOURCE_DIR}/flutter") add_subdirectory(${FLUTTER_MANAGED_DIR}) # Application build; see runner/CMakeLists.txt. add_subdirectory("runner") # Generated plugin build rules, which manage building the plugins and adding # them to the application. include(flutter/generated_plugins.cmake) # === Installation === # Support files are copied into place next to the executable, so that it can # run in place. This is done instead of making a separate bundle (as on Linux) # so that building and running from within Visual Studio will work. set(BUILD_BUNDLE_DIR "$") # Make the "install" step default, as it's required to run. set(CMAKE_VS_INCLUDE_INSTALL_TO_DEFAULT_BUILD 1) if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) set(CMAKE_INSTALL_PREFIX "${BUILD_BUNDLE_DIR}" CACHE PATH "..." FORCE) endif() set(INSTALL_BUNDLE_DATA_DIR "${CMAKE_INSTALL_PREFIX}/data") set(INSTALL_BUNDLE_LIB_DIR "${CMAKE_INSTALL_PREFIX}") install(TARGETS ${BINARY_NAME} RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}" COMPONENT Runtime) install(FILES "${FLUTTER_ICU_DATA_FILE}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) install(FILES "${FLUTTER_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) if(PLUGIN_BUNDLED_LIBRARIES) install(FILES "${PLUGIN_BUNDLED_LIBRARIES}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) endif() # Copy the native assets provided by the build.dart from all packages. set(NATIVE_ASSETS_DIR "${PROJECT_BUILD_DIR}native_assets/windows/") install(DIRECTORY "${NATIVE_ASSETS_DIR}" DESTINATION "${INSTALL_BUNDLE_LIB_DIR}" COMPONENT Runtime) # Fully re-copy the assets directory on each build to avoid having stale files # from a previous install. set(FLUTTER_ASSET_DIR_NAME "flutter_assets") install(CODE " file(REMOVE_RECURSE \"${INSTALL_BUNDLE_DATA_DIR}/${FLUTTER_ASSET_DIR_NAME}\") " COMPONENT Runtime) install(DIRECTORY "${PROJECT_BUILD_DIR}/${FLUTTER_ASSET_DIR_NAME}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" COMPONENT Runtime) # Install the AOT library on non-Debug builds only. install(FILES "${AOT_LIBRARY}" DESTINATION "${INSTALL_BUNDLE_DATA_DIR}" CONFIGURATIONS Profile;Release COMPONENT Runtime) ``` -------------------------------- ### Generate main.dart with `dart run forui init` Source: https://github.com/duobaseio/forui/blob/main/docs/content/docs/guides/customizing-themes.mdx Run this command in your project directory to generate a main.dart file where you will add your generated theme. ```shell dart run forui init ``` -------------------------------- ### Create Media Card Snippet Source: https://github.com/duobaseio/forui/blob/main/docs/content/docs/widgets/data/card.mdx Run this command to generate a Card snippet with a media variant, showing how to include media content in the card. ```shell dart run forui snippet create media-card ``` -------------------------------- ### Example of most-specific-wins resolution Source: https://github.com/duobaseio/forui/blob/main/design_docs/shipped/styling_2.0.md Shows a simple example where a set of states resolves to the most specific constraint, demonstrating order-independence. ```text hovered: A(), hovered & focused: B(), ``` -------------------------------- ### FVariants class definition and creation examples Source: https://github.com/duobaseio/forui/blob/main/design_docs/shipped/styling_2.0.md Shows the proposed FVariants class with a base field and variants map, along with two creation examples: using concrete values and using deltas. The delta example uses .delta and .value constructors. ```dart class FVariants implements FVariantsDelta, FVariantsValueDelta { final V base; final Map variants; FVariants(this.base, {required Map, V> variants}); FVariants.from(this.base, {required Map, D> variants}); const FVariants.all(this.base) : variants = const {}; } // Creation using concrete values FooStyle( spacing: FVariants( 16, variants: { [.compact]: 8, [.md]: 16, // Explicit entry for the default semantic variant [.expanded]: 24, }, ), ); // Creation using deltas FTappableStyle( decoration: FVariants.from( BoxDecoration( color: Colors.white, borderRadius: BorderRadius.circular(8), ), variants: { [.hovered, .pressed]: .delta(color: Colors.grey), [.disabled]: .value(BoxDecoration(color: Colors.red)), }, ), ); ``` -------------------------------- ### Changelog entry example for FButton and FSelect Source: https://github.com/duobaseio/forui/blob/main/AGENTS.md Shows the required format for changelog entries, including widget headings, category ordering, and breaking change markers. Use this as a template when adding entries to the unreleased section. ```markdown ### `FButton` * Add `FButtonStyles.primary` getter. * **Breaking** Remove `FButtonSizes` typedef. Use `FButtonSizeStyles` instead. ### `FSelect` & `FMultiSelect` * Add `FSelect.search(...)`. * **Breaking** Rename `FSelectStyle.selectFieldStyle` to `FSelectStyle.fieldStyle`. * **Breaking** Remove `FSelectStyle.iconStyle`. Use `FSelectStyle.fieldStyle.iconStyle` instead. * Fix `FSelect` still allowing tags to be removed when disabled. ``` -------------------------------- ### CLI: Create Tooltip Style Source: https://github.com/duobaseio/forui/blob/main/docs/content/docs/widgets/overlay/tooltip.mdx Run this command to generate a specific tooltip style for customization. ```shell dart run forui style create tooltip ``` -------------------------------- ### CLI: Create Header Action Style Source: https://github.com/duobaseio/forui/blob/main/docs/content/docs/widgets/navigation/header.mdx Run this command to generate a specific style for header action customization. ```shell dart run forui style create header-action ``` -------------------------------- ### Usage for forui init command Source: https://github.com/duobaseio/forui/blob/main/docs/content/docs/reference/cli.mdx Shows the usage for the init command. The -f or --force flag overwrites existing files, -p or --preset specifies a theme's code, and -t or --template selects the main.dart template, defaulting to "basic" with options [basic, router]. ```shell Usage: forui init -h, --help Print this usage information. -f, --force Overwrite existing files if they exist. -p, --preset A theme's code. -t, --template The main.dart template to generate. Defaults to "basic". [basic, router] ``` -------------------------------- ### Example of match operation with FVariants.from Source: https://github.com/duobaseio/forui/blob/main/design_docs/shipped/styling_2.0.md Shows how .match({.hovered, .focused}, delta) affects constraints satisfied by the given set. The example includes comments indicating which constraints match and which do not. ```dart final decoration = FVariants.from( BoxDecoration(color: Colors.white), variants: { [.hovered]: .delta(color: Colors.blue), // ✓ hovered ⊆ {hovered, focused} [.hovered.and(.focused)]: .delta(color: Colors.darkBlue), // ✓ hovered & focused ⊆ {hovered, focused} [.focused]: .delta(color: Colors.green), // ✓ focused ⊆ {hovered, focused} [.hovered.and(.pressed)]: .delta(color: Colors.red), // ✗ pressed ∉ {hovered, focused} [.disabled]: .value(BoxDecoration(color: Colors.grey)), // ✗ disabled ∉ {hovered, focused} }, ); ``` -------------------------------- ### FVariants creation and modification example Source: https://github.com/duobaseio/forui/blob/main/design_docs/shipped/styling_2.0.md Shows the current FVariants creation with explicit variant mappings and the modification pattern that requires resolving the base variant. The modification example demonstrates the need to explicitly include the .any mapping. ```dart // Creation FTappableStyle( decoration: FVariants({ [.hovered, .pressed]: BoxDecoration(color: Colors.grey, borderRadius: BorderRadius.circular(8)), [.any]: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(8)), }), ); // Modification FTappable( style: (style) { final base = style.decoration.resolve({WidgetState.any})!; return style.copyWith( decoration: FVariants({ [.hovered]: base.copyWith(color: Colors.blue), [.pressed]: base.copyWith(color: Colors.darkBlue), [.any]: base, }), ); }, ) ``` -------------------------------- ### Generate Resizables style with CLI Source: https://github.com/duobaseio/forui/blob/main/docs/content/docs/widgets/layout/resizable.mdx Run this command to generate a specific style for customization. It creates a resizables style file. ```shell dart run forui style create resizables ``` -------------------------------- ### Data driven fixes YAML example for FButton Source: https://github.com/duobaseio/forui/blob/main/AGENTS.md Example of a fix_data YAML file for FButton, showing the structure for rename and remove parameter fixes. Place this in `/lib/fix_data` with one file per public widget. ```yaml # Example: button.yaml - All FButton-related fixes in one file version: 1 transforms: # FButton - title: 'Rename FButton(onStateChange: ...) to FButton(onVariantChange: ...)' date: 2026-01-26 element: uris: [ 'package:forui/forui.dart' ] constructor: '' inClass: FButton changes: - kind: renameParameter oldName: 'onStateChange' newName: 'onVariantChange' - title: 'Rename FButton.icon(onStateChange: ...) to FButton.icon(onVariantChange: ...)' date: 2026-01-26 element: uris: [ 'package:forui/forui.dart' ] constructor: 'icon' inClass: FButton changes: - kind: renameParameter oldName: 'onStateChange' newName: 'onVariantChange' # FButtonController - title: 'Rename FButtonController.state to FButtonController.variant' date: 2026-01-26 element: uris: [ 'package:forui/forui.dart' ] getter: 'state' inClass: FButtonController changes: - kind: rename newName: 'variant' # FButtonStyle - title: 'Remove FButtonStyle(iconStyle: ...)' date: 2026-01-26 element: uris: [ 'package:forui/forui.dart' ] constructor: '' inClass: FButtonStyle changes: - kind: removeParameter name: 'iconStyle' ``` -------------------------------- ### Generate tile style with CLI Source: https://github.com/duobaseio/forui/blob/main/docs/content/docs/widgets/tile/tile.mdx Run this command to generate a style for the 'tile' component. ```shell dart run forui style create tile ``` -------------------------------- ### CLI: Generate Button Sizes style Source: https://github.com/duobaseio/forui/blob/main/docs/content/docs/widgets/form/button.mdx Run this command to generate the 'Button Sizes' style for customization. ```shell dart run forui style create button-sizes ``` -------------------------------- ### FCollapsible Constructor Usage Source: https://github.com/duobaseio/forui/blob/main/docs/content/docs/widgets/foundation/collapsible.mdx Usage example for the FCollapsible constructor, showing how to instantiate the widget. ```dart // Code snippet content from collapsibleUsage.json ``` -------------------------------- ### Generate tile-content style with CLI Source: https://github.com/duobaseio/forui/blob/main/docs/content/docs/widgets/tile/tile.mdx Run this command to generate a style for the 'tile-content' component. ```shell dart run forui style create tile-content ``` -------------------------------- ### Same-tier tiebreaker example Source: https://github.com/duobaseio/forui/blob/main/design_docs/shipped/styling_2.0.md Shows the final tiebreaker: lexicographic comparison after sorting operands alphabetically. ```text // Same-tier tiebreaker (operand count, then lexicographic): hovered & focused: A(), → tier 1, count 2 focused & pressed: B(), → tier 1, count 2 // Sort: hovered & focused → ["focused", "hovered"] focused & pressed → ["focused", "pressed"] // Lexicographic comparison: [0]: "focused" == "focused" → continue [1]: "hovered" < "pressed" → winner → resolves to A() ``` -------------------------------- ### CLI: Create Sidebar Style Source: https://github.com/duobaseio/forui/blob/main/docs/content/docs/widgets/navigation/sidebar.mdx Run this command to generate a sidebar style for customization. ```shell dart run forui style create sidebar ``` -------------------------------- ### Generate Forui app with router template Source: https://github.com/duobaseio/forui/blob/main/docs/content/docs/getting-started.mdx Run this command to generate a Forui app structure with the router template. ```bash dart run forui init --template=router ``` -------------------------------- ### Tier-based resolution example Source: https://github.com/duobaseio/forui/blob/main/design_docs/shipped/styling_2.0.md Shows how tier precedence determines resolution when comparing constraints from different tiers. ```text // Tier-based resolution: disabled → tier 2 (1 operand) hovered & focused & pressed → tier 1 (3 operands) → resolves to disabled (tier 2 > tier 1, regardless of operand count) ``` -------------------------------- ### Autocomplete default example Source: https://github.com/duobaseio/forui/blob/main/docs/content/docs/widgets/form/autocomplete.mdx Basic usage of the Autocomplete widget. The code is displayed in a tabbed interface with a preview. ```dart // Code for the default autocomplete example ``` -------------------------------- ### Line Calendar Code Example Source: https://github.com/duobaseio/forui/blob/main/docs/content/docs/widgets/data/line-calendar.mdx Displays the code for the Line Calendar widget as shown in the Code tab. ```dart // Code snippet from defaultSnippet ``` -------------------------------- ### Create style command Source: https://github.com/duobaseio/forui/blob/main/design_docs/shipped/style_generation_cli.md Run this command in the project root to generate a Forui widget style file. The CLI is available on the feature/cli branch and is bundled with Forui. ```shell dart run forui style create [styles] ``` -------------------------------- ### Tier-2 operand count example Source: https://github.com/duobaseio/forui/blob/main/design_docs/shipped/styling_2.0.md Shows how operand count within the highest tier breaks ties when tiers are equal. ```text // Tier-2 operand count: disabled & selected → tier 2 (2 operands) disabled & hovered → tier 2 (1 operand) + tier 1 (1 operand) → resolves to disabled & selected (2 tier-2 operands > 1 tier-2 operand) ``` -------------------------------- ### Create adaptive media dialog snippet Source: https://github.com/duobaseio/forui/blob/main/docs/content/docs/widgets/overlay/dialog.mdx Run this command to generate the code snippet for the adaptive dialog with media. The snippet is used in the 'Adaptive' > 'Media' section. ```shell dart run forui snippet create adaptive-media-dialog ``` -------------------------------- ### CLI: Create Sidebar Item Style Source: https://github.com/duobaseio/forui/blob/main/docs/content/docs/widgets/navigation/sidebar.mdx Run this command to generate a sidebar-item style for customization. ```shell dart run forui style create sidebar-item ``` -------------------------------- ### CLI: Create Headers Style Source: https://github.com/duobaseio/forui/blob/main/docs/content/docs/widgets/navigation/header.mdx Run this command to generate a specific style for headers customization. ```shell dart run forui style create headers ``` -------------------------------- ### Managed Control Example Source: https://github.com/duobaseio/forui/blob/main/docs/content/docs/concepts/controls.mdx Shows a managed control where the widget manages its own state, either internally or via an external controller. ```dart // Managed control example // (Code not shown in source; snippet is loaded from external file) ``` -------------------------------- ### Usage for forui style create command Source: https://github.com/duobaseio/forui/blob/main/docs/content/docs/reference/cli.mdx Shows the usage for the style create command. The -a or --all flag generates all styles, -f or --force overwrites existing files, and -o or --output specifies the output directory or file, defaulting to "lib/theme/styles". ```shell Usage: forui style create [style...] -h, --help Print this usage information. -a, --all Generate all styles. -f, --force Overwrite existing files if they exist. -o, --output The output directory or file, relative to the project directory. (defaults to "lib/theme/styles") ```