macos_ui library

Flutter widgets and themes implementing the current macOS design language.

To use, import 'package:macos_ui/macos_ui.dart';

This library is designed for apps that run on macOS. While it will work on other Flutter-supported platforms, we encourage the use of the following libraries for apps that run on other desktop platforms:

Classes

CapacityIndicator
A capacity indicator illustrates the current level in relation to a finite capacity. Capacity indicators are often used when communicating factors like disk and battery usage. Mail, for example, uses a capacity indicator to show the percentage of data used in relation to an email account’s quota.
CapacityIndicatorCell
The cell CapacityIndicator uses to draw itself.
ContentArea
The widget that fills the rest of the body of the macOS MacosScaffold.
CustomToolbarItem
A custom widget for the toolbar.
DatePickerFieldElement
HelpButton
A help button appears within a view and opens app-specific help documentation when clicked. For help documentation creation guidance, see Help. All help buttons are circular, consistently sized buttons that contain a question mark icon. Whenever possible, open a help topic related to the current context. For example, the Rules pane of Mail preferences includes a help button. When clicked, it opens directly to a Rules preferences help topic.
HelpButtonState
HelpButtonTheme
Overrides the default style of its HelpButton descendants.
HelpButtonThemeData
A style that overrides the default appearance of HelpButtons when it's used with HelpButtonTheme or with the overall MacosTheme's MacosThemeData.helpButtonTheme.
Label
A label is a static text field that describes an onscreen interface element or provides a short message. Although people can’t edit labels, they can sometimes copy label contents.
MacosAlertDialog
A macOS-style AlertDialog.
MacosApp
An application that uses macOS design.
MacosBackButton
A macOS style back button.
MacosBackButtonState
MacosCheckbox
A checkbox is a type of button that lets the user choose between two opposite states, actions, or values. A selected checkbox is considered on when it contains a checkmark and off when it's empty. A checkbox is almost always followed by a title unless it appears in a checklist.
MacosColor
An immutable 32 bit color value in ARGB format.
MacosColors
A collection of color values lifted from the macOS system color picker.
MacosColorWell
A control that displays a color value and lets the user change that color value.
MacosDatePicker
{template macosDatePicker} A MacosDatePicker lets the user choose a date.
MacosDatePickerTheme
Overrides the default style of its MacosDatePicker descendants.
MacosDatePickerThemeData
A style that overrides the default appearance of MacosDatePickers when it's used with MacosDatePickerTheme or with the overall MacosTheme's MacosThemeData.datePickerTheme.
MacosDisclosureButton
A macOS style disclosure button.
MacosDisclosureButtonState
MacosFontWeight
The thickness of the glyphs used to draw the text.
MacosIcon
An Icon widget that respects a macOS icon theme.
MacosIconButton
A macOS-style icon button.
MacosIconButtonState
MacosIconButtonTheme
Overrides the default style of its MacosIconButton descendants.
MacosIconButtonThemeData
A style that overrides the default appearance of MacosIconButtons when it's used with MacosIconButtonTheme or with the overall MacosTheme's MacosThemeData.iconButtonTheme.
MacosIconTheme
Controls the default color, opacity, and size of icons in a widget subtree.
MacosIconThemeData
Defines the color, opacity, and size of icons.
MacosImageIcon
An icon that comes from an ImageProvider, e.g. an AssetImage.
MacosListTile
A widget that aims to approximate the ListTile widget found in Flutter's material library.
MacosOverlayFilter
Applies a blur filter to its child to create a macOS-style "frosted glass" effect.
MacosPopupButton<T>
A macOS-style pop-up button.
MacosPopupButtonTheme
Overrides the default style of its MacosPopupButton descendants.
MacosPopupButtonThemeData
A style that overrides the default appearance of MacosPopupButtons when it is used with MacosPopupButtonTheme or with the overall MacosTheme's MacosThemeData.MacosPopupButtonTheme.
MacosPopupMenuItem<T>
An item in a menu created by a MacosPopupButton.
MacosPulldownButton
A macOS-style pull-down button.
MacosPulldownButtonTheme
Overrides the default style of its MacosPulldownButton descendants.
MacosPulldownButtonThemeData
A style that overrides the default appearance of MacosPulldownButtons when it is used with MacosPulldownButtonTheme or with the overall MacosTheme's MacosThemeData.MacosPulldownButtonTheme.
MacosPulldownMenuDivider
A divider (horizontal line) in a menu created by a MacosPulldownButton.
MacosPulldownMenuEntry
An entry in a menu created by a MacosPulldownButton. It can be either a MacosPulldownMenuItem or a MacosPulldownMenuDivider.
MacosPulldownMenuItem
An item in a menu created by a MacosPulldownButton, typically a Text widget.
MacosRadioButton<T>
A radio button is a small, circular button followed by a title. Typically presented in groups of two to five, radio buttons provide the user a set of related but mutually exclusive choices. A radio button’s state is either on (a filled circle) or off (an empty circle).
MacosScaffold
A macOS page widget.
MacosScrollbar
A macOS-style scrollbar.
MacosScrollbarTheme
Applies a scrollbar theme to descendant MacosScrollbar widgets.
MacosScrollbarThemeData
Defines default property values for descendant MacosScrollbar widgets.
MacosScrollBehavior
Describes how Scrollable widgets behave for MacosApps.
MacosSearchField<T>
A macOS-style search field.
MacosSearchFieldTheme
Overrides the default style of its MacosSearchField descendants.
MacosSearchFieldThemeData
A style that overrides the default appearance of MacosSearchFields when it is used with MacosSearchFieldTheme or with the overall MacosTheme's MacosThemeData.MacosSearchFieldTheme.
MacosSegmentedControl
Displays one or more navigational tabs in a single horizontal group.
MacosSheet
A modal dialog that’s attached to a particular window and prevents further interaction with the window until the sheet is dismissed.
MacosSlider
A slider is a horizontal track with a control, called a thumb, that people can adjust between a minimum and maximum value.
MacosSwitch
A switch is a control that offers a binary choice between two mutually exclusive states — on and off.
MacosSwitchKnobPainter
Paints a macOS-style switch knob.
MacosTab
A macOS-style navigational button used to move between the views of a MacosTabView.
MacosTabController
Coordinates tab selection for MacosSegmentedControl and MacosTabView.
MacosTabView
A multipage interface that displays one page at a time.
MacosTextField
An macos-style text field.
MacosTheme
Applies a macOS-style theme to descendant macOS widgets.
MacosThemeData
Defines the configuration of the overall visual MacosTheme for a MacosApp or a widget subtree within the app.
MacosTimePicker
{template macosTimePicker} A MacosTimePicker lets the user choose a time.
MacosTimePickerTheme
Overrides the default style of its MacosTimePicker descendants.
MacosTimePickerThemeData
A style that overrides the default appearance of MacosTimePickers when it's used with MacosTimePickerTheme or with the overall MacosTheme's MacosThemeData.timePickerTheme.
MacosTooltip
Tooltips, succinctly describe how to use controls without shifting people’s focus away from the primary interface. Tooltips appear when the user positions the pointer over a control for a few seconds. A tooltip remains visible for 10 seconds, or until the pointer moves away from the control.
MacosTooltipTheme
Overrides the default style of its MacosTooltip descendants.
MacosTooltipThemeData
A style that overrides the default appearance of MacosTooltips when it's used with MacosTooltipTheme or with the overall MacosTheme's MacosThemeData.tooltipTheme.
MacosTypography
macOS typography.
MacosWindow
A basic frame layout.
MacosWindowScope
A MacosWindowScope serves as a scope for its descendants to rely on values needed for the layout of the descendants.
MacosWindowUtilsConfig
A class for configuring macOS window properties.
NSAppPresentationOptions
Constants that control the presentation of the app, typically for fullscreen apps such as games or kiosks.
NSWindowDelegate
A set of optional methods that a window’s delegate can implement to respond to events, such as window resizing, moving, exposing, and minimizing.
NSWindowDelegateHandle
NSWindowDelegateHandler
A class that handles NSWindowDelegates and their appropriate method channel.
ProgressBar
A ProgressBar that shows progress in a horizontal bar.
ProgressCircle
A ProgressCircle that shows progress in a circular form, either as a spinner or as a circle that fills in as progress continues.
PushButton
A control that initiates an action.
PushButtonState
PushButtonTheme
Overrides the default style of its PushButton descendants.
PushButtonThemeData
A style that overrides the default appearance of PushButtons when it's used with PushButtonTheme or with the overall MacosTheme's MacosThemeData.pushButtonTheme.
RatingIndicator
A rating indicator uses a series of horizontally arranged graphical symbols to communicate a ranking level. The default symbol is a star.
RelevanceIndicator
A relevance indicator communicates relevancy using a series of vertical bars. It often appears in a list of search results for reference when sorting and comparing multiple items.
ResizablePane
A widget that can be resized horizontally or vertically.
ResolvedMacosDynamicColor
SearchResultItem
An item to show in the search results of a search field.
A macOS-style side bar at left side of the MacosScaffold.
SidebarItem
A macOS style navigation-list item intended for use in a Sidebar
SidebarItems
A scrollable widget that renders SidebarItems.
SliverToolBar
A variant of ToolBar that is compatible with slivers.
TextInputType
The type of information for which to optimize the text input control.
TimePickerFieldElement
TitleBar
A title bar to use for a MacosWindow.
TitlebarSafeArea
ToolBar
A toolbar to use in a MacosScaffold.
ToolBarDivider
A macOS-styled divider for the toolbar.
ToolBarIconButton
An icon button suitable for the toolbar.
ToolbarItem
An individual action displayed within a Toolbar. Sub-class this to build a new type of widget that appears inside of a toolbar. It knows how to build an appropriate widget for the given ToolbarItemDisplayMode during build time.
ToolbarOverflowButton
A button to show at the far right side of the toolbar.
ToolbarOverflowMenu
A menu that includes all overflowed toolbar actions.
ToolbarOverflowMenuItem
A menu-item that belongs in the toolbar overflowed actions menu.
ToolbarPopup<T>
A popup widget for the toolbar.
ToolbarPopupState<T>
ToolBarPullDownButton
A pulldown button suitable for the toolbar.
ToolBarSpacer
A spacer utility widget for the toolbar.
VisualEffectSubviewProperties
WallpaperTintedArea
A widget that applies a wallpaper tint to its child widget.
WindowManipulator
Class that provides methods to manipulate the application's window.

Enums

ColorPickerMode
Describes the possible modes for an NSColorPanel.
ControlSize
The out-of-the-box sizes that certain "control" widgets can be.
DatePickerStyle
Defines the possibles MacosDatePicker styles.
MacosTabPosition
Specifies layout position for MacosTab options inside MacosTabView.
NSAppPresentationOption
Constants that control the presentation of the app, typically for fullscreen apps such as games or kiosks.
NSVisualEffectViewMaterial
Available materials for NSVisualEffectViews.
NSVisualEffectViewState
Available NSVisualEffectViewState values.
NSWindowToolbarStyle
Available toolbar styles.
OverlayVisibilityMode
Visibility of text field overlays based on the state of the current text entry.
PulldownButtonState
PulldownMenuAlignment
ResizableSide
Indicates the draggable side of the ResizablePane for resizing
SidebarItemSize
Enumerates the size specifications of SidebarItems
SmartDashesType
Indicates how to handle the intelligent replacement of dashes in text input.
SmartQuotesType
Indicates how to handle the intelligent replacement of quotes in text input.
TextCapitalization
Configures how the platform keyboard will select an uppercase or lowercase keyboard.
TextInputAction
An action the user has requested the text input control to perform.
TimePickerStyle
Defines the possibles MacosTimePicker styles.
ToolbarItemDisplayMode
Describes how ToolbarItems can be displayed.
ToolbarPopupPlacement
How the popup will be placed relative to the child
ToolbarPopupPosition
Where the popup will be placed vertically relative to the child

Extensions

BrightnessX on Brightness
Brightness extensions
ColorX on Color
MacosDynamicColor on CupertinoDynamicColor
Extension methods on CupertinoDynamicColor.
PushButtonControlSizeX on ControlSize
Shortcuts for various PushButton properties based on the ControlSize.

Constants

kDefaultFocusedBorderDecoration → const BoxDecoration
kDefaultRoundedBorderDecoration → const BoxDecoration
kResizablePaneSafeArea → const EdgeInsets
Default value for ResizablePane top padding
kTitleBarHeight → const double
Defines the height of a regular-sized TitleBar.

Functions

horizontalPositionDependentBox({required Size size, required Size childSize, required Offset target, required bool preferLeft, double verticalOffset = 0.0, double margin = 10.0}) Offset
showMacosAlertDialog<T>({required BuildContext context, required WidgetBuilder builder, bool barrierDismissible = false, Color? barrierColor, String? barrierLabel, bool useRootNavigator = true, RouteSettings? routeSettings}) Future<T?>
Displays a macos alert dialog above the current contents of the app.
showMacosSheet<T>({required BuildContext context, required WidgetBuilder builder, bool barrierDismissible = false, Color? barrierColor, String? barrierLabel, bool useRootNavigator = true, RouteSettings? routeSettings}) Future<T?>
Displays a MacosSheet above the current application.

Typedefs

MacosPopupButtonBuilder = List<Widget> Function(BuildContext context)
A builder to customize popup buttons.
OnColorSelected = void Function(Color color)
The action to perform when a color is selected from the color well.
OnDateChanged = void Function(DateTime date)
{template onDateChanged} The action to perform when a new date is selected. {endtemplate}
OnTimeChanged = void Function(TimeOfDay time)
{template onTimeChanged} The action to perform when a new time is selected. {end-template}