### PushButton Example Source: https://github.com/macosui/macos_ui/blob/dev/README.md Demonstrates the basic usage of a PushButton. ```dart PushButton( child: Text('Click Me'), onPressed: () { // Handle button press }, ) ``` -------------------------------- ### ProgressBar Example Source: https://github.com/macosui/macos_ui/blob/dev/README.md Shows how to use ProgressBar for indicating progress. ```dart ProgressBar( value: 0.5, // For determinate progress // or use ProgressBar() for indeterminate ) ``` -------------------------------- ### MacosWindow with Sidebar Example Source: https://github.com/macosui/macos_ui/blob/dev/README.md Demonstrates how to implement a MacosWindow with a left sidebar and an optional right sidebar. The sidebar allows for navigation items and can be toggled. The example shows the setup for SidebarItems and handling changes. ```dart int pageIndex = 0; ... MacosWindow( sidebar: Sidebar( minWidth: 200, builder: (context, scrollController) { return SidebarItems( currentIndex: pageIndex, scrollController: scrollController, itemSize: SidebarItemSize.large, onChanged: (i) { setState(() => pageIndex = i); }, items: const [ SidebarItem( label: Text('Page One'), ), SidebarItem( label: Text('Page Two'), ), ], ); }, ), endSidebar: Sidebar( startWidth: 200, minWidth: 200, maxWidth: 300, shownByDefault: false, builder: (context, _) { return const Center( child: Text('End Sidebar'), ); }, ), ) ``` -------------------------------- ### MacosCheckbox Example Source: https://github.com/macosui/macos_ui/blob/dev/README.md Demonstrates the basic usage of a MacosCheckbox. ```dart bool _isChecked = false; MacosCheckbox( value: _isChecked, onChanged: (bool? newValue) { // Update state }, ) ``` -------------------------------- ### CapacityIndicator Example Source: https://github.com/macosui/macos_ui/blob/dev/README.md Demonstrates the usage of CapacityIndicator for showing capacity levels. ```dart CapacityIndicator( value: 3, max: 5, ) ``` -------------------------------- ### MacosSearchField Example Source: https://github.com/macosui/macos_ui/blob/dev/README.md Demonstrates the usage of MacosSearchField for search input. ```dart MacosSearchField( placeholder: 'Search...', onChanged: (String value) { // Perform search }, ) ``` -------------------------------- ### Basic PulldownButton Example Source: https://github.com/macosui/macos_ui/blob/dev/README.md Illustrates how to create a pull-down button with a title and a list of menu items. Includes examples of menu items, dividers, and disabled states. ```dart MacosPulldownButton( title: "Actions", // Or provide an icon to use as title: // icon: CupertinoIcons.ellipsis_circle, items: [ MacosPulldownMenuItem( title: const Text('Save'), onTap: () => debugPrint("Saving..."), ), MacosPulldownMenuItem( title: const Text('Save as...'), onTap: () => debugPrint("Opening Save As dialog..."), ), const MacosPulldownMenuDivider(), MacosPulldownMenuItem( enabled: false, title: const Text('Export'), onTap: () => debugPrint("Exporting"), ), ], ), ``` -------------------------------- ### HelpButton Example Source: https://github.com/macosui/macos_ui/blob/dev/README.md Illustrates how to use the HelpButton, typically for displaying help information. ```dart HelpButton( tooltip: 'Show help', onPressed: () { // Show help dialog or content }, ) ``` -------------------------------- ### MacosSwitch Example Source: https://github.com/macosui/macos_ui/blob/dev/README.md Shows how to use a MacosSwitch for toggling states. ```dart bool _isSwitched = false; MacosSwitch( value: _isSwitched, onChanged: (bool? newValue) { // Update state }, ) ``` -------------------------------- ### MacosSheet Example Source: https://github.com/macosui/macos_ui/blob/dev/README.md Demonstrates how to present a MacosSheet for additional content or actions. ```dart showMacosSheet( context: context, builder: (BuildContext context) { return MacosSheet( child: Center(child: Text('Sheet Content')), ); }, ); ``` -------------------------------- ### MacosDatePicker Example Source: https://github.com/macosui/macos_ui/blob/dev/README.md Provides an example of how to use the MacosDatePicker to allow users to select a date. The date picker can be configured with different styles (textual, graphical, combined) and supports custom date formatting and localization. ```dart MacosDatePicker( onDateChanged: (date) => debugPrint('$date'), ), ``` -------------------------------- ### MacosTooltip Example Source: https://github.com/macosui/macos_ui/blob/dev/README.md Shows how to attach a tooltip to a widget using MacosTooltip. ```dart MacosTooltip( message: 'This is a tooltip', child: Text('Hover over me'), ) ``` -------------------------------- ### MacosTextField Example Source: https://github.com/macosui/macos_ui/blob/dev/README.md Shows a basic MacosTextField for text input. ```dart MacosTextField( placeholder: 'Enter text', onChanged: (String value) { // Handle text changes }, ) ``` -------------------------------- ### RatingIndicator Example Source: https://github.com/macosui/macos_ui/blob/dev/README.md Shows how to use RatingIndicator for displaying ratings. ```dart RatingIndicator( rating: 4.5, maxRating: 5.0, ) ``` -------------------------------- ### MacosTimePicker Example Source: https://github.com/macosui/macos_ui/blob/dev/README.md Shows how to use MacosTimePicker for selecting a time. ```dart TimeOfDay? _selectedTime; MacosTimePicker( initialTime: TimeOfDay.now(), onTimeChanged: (TimeOfDay? newTime) { // Update state }, ) ``` -------------------------------- ### MacosAlertDialog Example Source: https://github.com/macosui/macos_ui/blob/dev/README.md Shows how to display a MacosAlertDialog with title, content, and actions. ```dart showMacosAlertDialog( context: context, builder: (BuildContext context) { return MacosAlertDialog( title: Text('Alert Title'), message: Text('This is the alert message.'), primary: MacosDialogAction( label: Text('OK'), onPressed: () { Navigator.of(context).pop(); }, ), secondary: MacosDialogAction( label: Text('Cancel'), onPressed: () { Navigator.of(context).pop(); }, ), ); }, ); ``` -------------------------------- ### Basic RadioButton Example Source: https://github.com/macosui/macos_ui/blob/dev/README.md Demonstrates the creation of a basic radio button. It shows how to manage the selected state and handle changes. ```dart bool selected = false; MacosRadioButton( value: selected, onChanged: (value) { setState(() => selected = value); }, ), ``` -------------------------------- ### PulldownButton Example Source: https://github.com/macosui/macos_ui/blob/dev/README.md Demonstrates how to create a PulldownButton with a list of items. ```dart PulldownButton( child: Text('Select Option'), items: [ PulldownMenuItem( title: Text('Option 1'), onPressed: () {}, ), PulldownMenuItem( title: Text('Option 2'), onPressed: () {}, ), ], ) ``` -------------------------------- ### PopupButton Example Source: https://github.com/macosui/macos_ui/blob/dev/README.md Shows how to use a PopupButton, often within a ToolBar. ```dart PopupButton( title: Text('File'), items: [ PulldownMenuItem( title: Text('New'), onPressed: () {}, ), ... ], ) ``` -------------------------------- ### MacosColorWell Example Source: https://github.com/macosui/macos_ui/blob/dev/README.md Demonstrates the usage of MacosColorWell for color selection. Note: Requires macOS. ```dart Color _selectedColor = Colors.blue; MacosColorWell( color: _selectedColor, onChanged: (Color newColor) { // Update state }, ) ``` -------------------------------- ### Setup macos_window_utils for Older macOS Versions Source: https://github.com/macosui/macos_ui/blob/dev/README.md Provides instructions for integrating the `macos_window_utils` plugin into older macOS projects (Monterey and earlier) to ensure compatibility. This involves modifying the `MainFlutterWindow.swift` file to include the necessary import and initialization code. ```swift import Cocoa import FlutterMacOS import macos_window_utils class MainFlutterWindow: NSWindow { override func awakeFromNib() { let windowFrame = self.frame let macOSWindowUtilsViewController = MacOSWindowUtilsViewController() self.contentViewController = macOSWindowUtilsViewController self.setFrame(windowFrame, display: true) /* Initialize the macos_window_utils plugin */ MainFlutterWindowManipulator.start(mainFlutterWindow: self) RegisterGeneratedPlugins(registry: macOSWindowUtilsViewController.flutterViewController) super.awakeFromNib() } } ``` ```diff import Cocoa import FlutterMacOS +import macos_window_utils class MainFlutterWindow: NSWindow { override func awakeFromNib() { - let flutterViewController = FlutterViewController.init() - let windowFrame = self.frame - self.contentViewController = flutterViewController - self.setFrame(windowFrame, display: true) - RegisterGeneratedPlugins(registry: flutterViewController) + let windowFrame = self.frame + let macOSWindowUtilsViewController = MacOSWindowUtilsViewController() + self.contentViewController = macOSWindowUtilsViewController + self.setFrame(windowFrame, display: true) + /* Initialize the macos_window_utils plugin */ + MainFlutterWindowManipulator.start(mainFlutterWindow: self) + RegisterGeneratedPlugins(registry: macOSWindowUtilsViewController.flutterViewController) super.awakeFromNib() } } ``` -------------------------------- ### MacosDatePicker Example Source: https://github.com/macosui/macos_ui/blob/dev/README.md Demonstrates how to use MacosDatePicker for selecting a date. ```dart DateTime? _selectedDate; MacosDatePicker( initialDate: DateTime.now(), firstDate: DateTime(2000), lastDate: DateTime(2100), onDateChanged: (DateTime? newDate) { // Update state }, ) ``` -------------------------------- ### Capacity Indicator Example Source: https://github.com/macosui/macos_ui/blob/dev/README.md Demonstrates how to create an interactive continuous capacity indicator. The `discrete` property can be set to `true` for a discrete indicator. ```dart double value = 30; CapacityIndicator( value: value, discrete: false, onChanged: (v) { setState(() => value = v); }, ), ``` -------------------------------- ### MacosTabView Structure Source: https://github.com/macosui/macos_ui/blob/dev/README.md Provides an example of how to implement a MacosTabView with multiple tabs. ```dart MacosTabView( tabs: [ MacosTab( label: Text('Tab 1') ), MacosTab( label: Text('Tab 2') ), ], shortcuts: [ // Shortcut definitions ], children: [ Center(child: Text('Content for Tab 1')), Center(child: Text('Content for Tab 2')), ] ) ``` -------------------------------- ### RadioButton Example Source: https://github.com/macosui/macos_ui/blob/dev/README.md Shows how to use RadioButton for selecting one option from a group. ```dart String? _selectedValue; Row( children: [ RadioButton( value: 'option1', groupValue: _selectedValue, onChanged: (String? value) { // Update state }, ), ... ] ) ``` -------------------------------- ### MacosListTile Example Source: https://github.com/macosui/macos_ui/blob/dev/README.md Demonstrates the usage of MacosListTile for displaying items in a list with optional leading and trailing widgets. ```dart MacosListTile( leading: MacosIcon(CupertinoIcons.folder), title: Text('Folder Name'), subtitle: Text('Last modified: ...'), trailing: MacosIcon(CupertinoIcons.ellipsis_circle), onPressed: () {}, ) ``` -------------------------------- ### Create Basic MacosTextField Source: https://github.com/macosui/macos_ui/blob/dev/README.md Provides an example of creating a simple text field with a placeholder. This is a fundamental input component for user text entry. ```dart MacosTextField( placeholder: 'Type some text here', ) ``` -------------------------------- ### MacosSegmentedControl Example Source: https://github.com/macosui/macos_ui/blob/dev/README.md Demonstrates how to use MacosSegmentedControl for selecting one option from a group. ```dart int _selectedSegment = 0; MacosSegmentedControl( tabs: [ Text('Option 1'), Text('Option 2'), Text('Option 3'), ], selected: _selectedSegment, onChanged: (int index) { // Update state }, ) ``` -------------------------------- ### ProgressCircle Example Source: https://github.com/macosui/macos_ui/blob/dev/README.md Demonstrates the usage of ProgressCircle for indeterminate or determinate progress indication. ```dart ProgressCircle( value: 0.75, // For determinate progress // or use ProgressCircle() for indeterminate ) ``` -------------------------------- ### Continuous Slider Example Source: https://github.com/macosui/macos_ui/blob/dev/README.md Shows how to create an interactive continuous slider. Sliders allow users to select a value from a range by moving a thumb. ```dart double value = 0.5; MacosSlider( value: value, onChanged: (v) { setState(() => value = v); }, ), ``` -------------------------------- ### PushButton Example Source: https://github.com/macosui/macos_ui/blob/dev/README.md Shows how to create a standard macOS push button. The `child` property typically contains a `Text` widget for the button's label. The `onPressed` callback is executed when the button is clicked, and `controlSize` can be used to adjust the button's size. ```dart PushButton( child: Text('button'), controlSize: ControlSize.regular, onPressed: () { print('button pressed'); }, ), ``` -------------------------------- ### Custom Toolbar Item Example Source: https://github.com/macosui/macos_ui/blob/dev/README.md Shows how to create a custom widget to be included as an item in a macOS toolbar. This allows for flexible UI elements, such as separators or custom controls, to be integrated into the toolbar. ```dart // Add a grey vertical line as a custom toolbar item: CustomToolbarItem( inToolbarBuilder: (context) => Padding( padding: const EdgeInsets.all(8.0), child: Container(color: Colors.grey, width: 1, height: 30), ), inOverflowedBuilder: (context) => Container(color: Colors.grey, width: 30, height: 1), ) ``` -------------------------------- ### Rating Indicator Example Source: https://github.com/macosui/macos_ui/blob/dev/README.md Illustrates how to create an interactive rating indicator. The `amount` property defines the total number of symbols, and `value` sets the current rating. The value is rounded to display complete symbols only. ```dart double value = 3; RatingIndicator( amount: 5, value: value, onChanged: (v) { setState(() => value = v); } ) ``` -------------------------------- ### MacosSwitch Example Source: https://github.com/macosui/macos_ui/blob/dev/README.md Illustrates the creation of a macOS switch (toggle) control. The `value` property determines the on/off state, and the `onChanged` callback is triggered when the user interacts with the switch. The `size` property can be set to `mini`, `small`, or `regular` to control the switch's dimensions. ```dart bool switchValue = false; MacosSwitch( value: switchValue, onChanged: (value) { setState(() => switchValue = value); }, ), ``` -------------------------------- ### MacosPopupButton Example Source: https://github.com/macosui/macos_ui/blob/dev/README.md Demonstrates how to create a basic pop-up button with a list of string values. The `value` property sets the currently selected item, and `onChanged` updates the state when a new item is selected. Each `MacosPopupMenuItem` represents an option in the menu. ```dart String popupValue = 'One'; MacosPopupButton( value: popupValue, onChanged: (String? newValue) { setState(() { popupValue = newValue!; }); }, items: ['One', 'Two', 'Three', 'Four'] .map>((String value) { return MacosPopupMenuItem( value: value, child: Text(value), ); }).toList(), ), ``` -------------------------------- ### Create Indeterminate ProgressCircle Source: https://github.com/macosui/macos_ui/blob/dev/README.md Example of an indeterminate progress circle, used when the duration or extent of a process is unknown. It visually indicates that an operation is ongoing. ```dart ProgressCircle( value: null, ) ``` -------------------------------- ### MacosWindow Configuration Source: https://github.com/macosui/macos_ui/blob/dev/README.md Demonstrates how to configure the MacosWindow, including setting the title bar style and toolbar. ```dart MacosWindow( sidebar: Sidebar(... child: MacosScaffold( ... children: [ ... ] ) ) ``` -------------------------------- ### Create MacosSearchField Source: https://github.com/macosui/macos_ui/blob/dev/README.md Shows how to implement a search field, optimized for searching within large datasets. It includes a placeholder, a list of results, and a callback for when a result is selected. ```dart MacosSearchField( placeholder: 'Search for a country...', results: countries.map((e) => SearchResultItem(e)).toList(), onResultSelected: (resultItem) { debugPrint(resultItem.searchKey); }, ) ``` -------------------------------- ### ToolBar Usage Source: https://github.com/macosui/macos_ui/blob/dev/README.md Shows how to create and populate a ToolBar with various widgets like buttons and popups. ```dart ToolBar( leading: ToolBarIconButton( icon: MacosIcon( CupertinoIcons.sidebar_left ), onPressed: () {}, ), children: [ ToolBarSpacer(), ToolBarPopupButton(... ... ] ) ``` -------------------------------- ### Show MacosSheet Source: https://github.com/macosui/macos_ui/blob/dev/README.md Illustrates how to present a macOS-style sheet. This function requires a BuildContext and a builder that returns the content for the sheet, such as MacosuiSheet. ```dart showMacosSheet( context: context, builder: (_) => const MacosuiSheet(), ); ``` -------------------------------- ### Show MacosAlertDialog Source: https://github.com/macosui/macos_ui/blob/dev/README.md Demonstrates how to display a macOS-style alert dialog with a primary action. Requires a BuildContext and a builder function that returns a MacosAlertDialog widget. ```dart showMacosAlertDialog( context: context, builder: (_) => MacosAlertDialog( appIcon: FlutterLogo(size: 64), title: Text( 'Alert Dialog with Primary Action', style: MacosTheme.of(context).typography.headline, ), message: Text( 'This is an alert dialog with a primary action and no secondary action', textAlign: TextAlign.center, style: MacosTypography.of(context).headline, ), primaryButton: PushButton( controlSize: ControlSize.large, child: Text('Primary'), onPressed: () {}, ), ), ); ``` -------------------------------- ### macOS UI Contribution Guidelines Source: https://github.com/macosui/macos_ui/blob/dev/CONTRIBUTING.md This section details the contribution process for the macos_ui project, including branch structure, commit conventions, and pull request requirements. It emphasizes targeting the 'dev' branch for contributions and adhering to semantic versioning. ```markdown # Contributing to macos_ui Thanks for checking out `macos_ui`! We appreciate your interest in contributing! Here are some basic things you'll need to know to get started. ## Branch structure The default branch for this project is `dev`. Your work should take place in a branch checked out from here. `stable` is reserved for releases to pub.dev. All pull requests should therefore target `dev`. `dev`, `stable`, and `customer_testing` are protected branches. ### The `stable` Branch This branch is solely for pub releases. Only authorized maintainers may make pull requests to this branch. ### The `customer_testing` branch This branch is the ***only*** branch in this repository based on Flutter's `master` channel; every other branch is based on Flutter's `stable` channel. This is so that `macos_ui` can be included in Flutter's [tests](https://github.com/flutter/tests) repo. It is beneficial for `macos_ui` to be included there so that if any changes are introduced to Flutter that break `macos_ui`, we will be informed and can make the appropriate changes. Only authorized maintainers may make pull requests to this branch. ## Commit style This repository uses [conventional commits](https://www.conventionalcommits.org/en/v1.0.0/). Please ensure that you use them! ## Pull Requests As mentioned above, all pull requests should target `dev`. Before opening your pull request, please ensure that the following requirements are met: * You have run `flutter pub get` at the package level * You have incremented the version number in `pubspec.yaml` properly * You have updated the `CHANGELOG.md` file accordingly * All code is properly formatted * There are no Dart analysis warnings * All tests pass A note for authorized maintainers: Pull requests should **always** be merged via GitHub and not via command-line. ### Versioning `macos_ui` uses semantic versioning. Please ensure your updates follow this method accordingly. ``` -------------------------------- ### Create MacosTooltip Source: https://github.com/macosui/macos_ui/blob/dev/README.md Demonstrates how to add a tooltip to a widget, providing contextual information on hover or long press. The tooltip message can be customized. ```dart MacosTooltip( message: 'This is a tooltip', child: Text('Hover or long press to show a tooltip'), ), ``` -------------------------------- ### Create a macOS Toolbar Source: https://github.com/macosui/macos_ui/blob/dev/README.md Demonstrates how to create a custom toolbar within a `MacosScaffold` widget. The toolbar can include various interactive elements like icon buttons and pulldown menus, enhancing user interaction. ```dart ToolBar( title: const Text('Untitled Document'), titleWidth: 200.0, leading: MacosBackButton( onPressed: () => debugPrint('click'), fillColor: Colors.transparent, ), actions: [ ToolBarIconButton( label: "Add", icon: const MacosIcon( CupertinoIcons.add_circled, ), onPressed: () => debugPrint("Add..."), showLabel: true, ), const ToolBarSpacer(), ToolBarIconButton( label: "Delete", icon: const MacosIcon( CupertinoIcons.trash, ), onPressed: () => debugPrint("Delete"), showLabel: false, ), ToolBarPullDownButton( label: "Actions", icon: CupertinoIcons.ellipsis_circle, items: [ MacosPulldownMenuItem( label: "New Folder", title: const Text("New Folder"), onTap: () => debugPrint("Creating new folder..."), ), MacosPulldownMenuItem( label: "Open", title: const Text("Open"), onTap: () => debugPrint("Opening..."), ), ], ), ] ) ``` -------------------------------- ### MacosScaffold Layout Source: https://github.com/macosui/macos_ui/blob/dev/README.md Illustrates the basic structure of a MacosScaffold, which includes a toolbar and main content area. ```dart MacosScaffold( toolBar: ToolBar( ... ), children: [ // Main content widgets ] ) ``` -------------------------------- ### HelpButton Source: https://github.com/macosui/macos_ui/blob/dev/README.md A circular button with a question mark icon, used for accessing app-specific help documentation. It can be customized using HelpButtonTheme, though Apple advises against altering its appearance. ```dart HelpButton( onPressed: () { print('pressed help button'); }, ) ``` -------------------------------- ### MacosIcon Usage Source: https://github.com/macosui/macos_ui/blob/dev/README.md Shows how to display icons using the MacosIcon widget, often with CupertinoIcons. ```dart MacosIcon( CupertinoIcons.add_circled_solid, size: 24.0, color: MacosColors. சிவப்பு, ) ``` -------------------------------- ### Create Determinate ProgressBar Source: https://github.com/macosui/macos_ui/blob/dev/README.md Illustrates the creation of a determinate progress bar, which displays the progress of a task as a horizontal bar. It requires a `value` to indicate the completion percentage. ```dart ProgressBar( value: 30, ) ``` -------------------------------- ### Service Worker Registration for Flutter Web Source: https://github.com/macosui/macos_ui/blob/dev/example/web/index.html This snippet demonstrates how to register a service worker for a Flutter web application. It checks for service worker support in the navigator and registers the 'flutter_service_worker.js' file upon the 'flutter-first-frame' event. ```javascript if ('serviceWorker' in navigator) { window.addEventListener('flutter-first-frame', function () { navigator.serviceWorker.register('flutter_service_worker.js'); }); } ``` -------------------------------- ### Create Determinate Progress Circle Source: https://github.com/macosui/macos_ui/blob/dev/README.md Shows how to create a determinate progress circle by providing a non-null value to the `value` property. This is used when the progress of an operation can be quantified. ```dart ProgressCircle( value: 0.5, // Example value between 0.0 and 1.0 ) ``` -------------------------------- ### Replace Launch Screen Images in Xcode Source: https://github.com/macosui/macos_ui/blob/dev/example/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md Instructions on how to replace launch screen images using Xcode. This involves opening the Xcode workspace, navigating to the Assets.xcassets catalog, and dropping in new images. ```shell open ios/Runner.xcworkspace ``` ```text Select Runner/Assets.xcassets in the Project Navigator and drop in the desired images. ``` -------------------------------- ### Set macOS Deployment Target Source: https://github.com/macosui/macos_ui/blob/dev/README.md Specifies the minimum macOS deployment version for a Flutter project when using CocoaPods. This ensures compatibility with features required by packages like macos_ui. ```podspec platform :osx, '10.14.6' ``` -------------------------------- ### MacosTabView Source: https://github.com/macosui/macos_ui/blob/dev/README.md A multipage interface widget for macOS applications that displays one page at a time. It requires a Stateful widget and allows control over tab placement via the 'position' property. ```dart final _controller = MacosTabController( initialIndex: 0, length: 3, ); ... MacosTabView( controller: _controller, tabs: const [ MacosTab( label: 'Tab 1', ), MacosTab( label: 'Tab 2', ), MacosTab( label: 'Tab 3', ), ], children: const [ Center( child: Text('Tab 1'), ), Center( child: Text('Tab 2'), ), Center( child: Text('Tab 3'), ), ], ) ``` -------------------------------- ### MacosTimePicker Usage Source: https://github.com/macosui/macos_ui/blob/dev/README.md Demonstrates how to use the MacosTimePicker widget to allow users to select a time. The widget supports textual, graphical, and combined display modes. The `onTimeChanged` callback is triggered when the selected time is updated. ```dart MacosTimePicker( onTimeChanged: (time) => debugPrint('$time'), ) ``` -------------------------------- ### Configure macOS Window Appearance Source: https://github.com/macosui/macos_ui/blob/dev/README.md Sets the macOS window toolbar style for a Flutter application. Requires the macos_window_utils package and a minimum macOS deployment target of 10.14.6. This configuration affects how the window title bar and toolbar elements are displayed. ```dart /// This method initializes macos_window_utils and styles the window. Future _configureMacosWindowUtils() async { const config = MacosWindowUtilsConfig( toolbarStyle: NSWindowToolbarStyle.unified, ); await config.apply(); } void main() async { await _configureMacosWindowUtils(); runApp(const YourAppHere()); } ``` ```dart Future _configureMacosWindowUtils() async { const config = MacosWindowUtilsConfig( toolbarStyle: NSWindowToolbarStyle.expanded, ); await config.apply(); } ``` -------------------------------- ### MacosListTile Source: https://github.com/macosui/macos_ui/blob/dev/README.md A widget that approximates Flutter's material ListTile, designed for macOS applications. It supports leading icons, titles, and subtitles with customizable styling. ```dart MacosListTile( leading: const Icon(CupertinoIcons.lightbulb), title: Text( 'A robust library of Flutter components for macOS', style: MacosTheme.of(context).typography.headline, ), subtitle: Text( 'Create native looking macOS applications using Flutter', style: MacosTheme.of(context).typography.subheadline.copyWith( color: MacosColors.systemGrayColor, ), ), ) ``` -------------------------------- ### SliverToolBar for Scrollable Widgets Source: https://github.com/macosui/macos_ui/blob/dev/README.md A toolbar compatible with scrollable widgets like CustomScrollView and NestedScrollView. It supports pinned, floating, and opacity effects for a native macOS App Store-like appearance. ```dart return CustomScrollView( controller: scrollController, slivers: [ SliverToolBar( title: const Text('SliverToolbar'), pinned: true, toolbarOpacity: 0.75, ), // Other slivers below ], ); ``` -------------------------------- ### MacosIcon Source: https://github.com/macosui/macos_ui/blob/dev/README.md A macOS-themed icon widget that functions identically to Flutter's standard Icon but respects the MacosTheme. ```dart MacosIcon( CupertinoIcons.add, // color: CupertinoColors.activeBlue.color, // size: 20, ) ``` -------------------------------- ### MacosColorWell Usage Source: https://github.com/macosui/macos_ui/blob/dev/README.md Shows how to implement the MacosColorWell widget, which enables users to select colors using the native macOS color picker. The `ColorPickerMode` enum can be used to specify the picker's appearance. This widget is exclusive to macOS. ```dart MacosColorWell( onColorSelected: (color) => debugPrint('$color'), ) ``` -------------------------------- ### MacosCheckbox Source: https://github.com/macosui/macos_ui/blob/dev/README.md A checkbox widget for macOS applications, allowing users to select between two states (on/off). Supports checked, unchecked, and mixed states. The mixed state is achieved by setting the 'value' to null. ```dart bool selected = false; MacosCheckbox( value: selected, onChanged: (value) { setState(() => selected = value); }, ) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.