command_palette 0.7.6 command_palette: ^0.7.6 copied to clipboard
Flutter implementation of a Command Palette. Can be brought up via a keyboard shortcut.
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
0.7.6 - 2024-08-23 #
0.7.5 - 2024-08-08 #
Changed #
- Upgrade to Flutter 3.24
- Increase CP default item height from 52 to 56 to comply with new Material 3 designs
0.7.4 - 2023-10-30 #
Added #
- Add FocusNode parameter which is passed to underlying Focus widget
- Added input as a type for an action. This type of action will give the user a text field and accept the processed text, passing it to a callback
0.7.1 - 2023-01-25 #
Changed #
- Create two named constructors for actions:
CommandPaletteAction.single
andCommandPaletteAction.nested
. These handle the setting of theactionType
and makes the required parameters for each explicit. The unnamed constructor has been marked as deprecated, but I have no plans to remove anytime soon. - upgrade to Flutter 3.7.0 and update deprecations in style
0.7.0 - 2023-01-22 #
0.6.1 - 2022-12-15 #
Added #
- Added
CommandPaletteStyle.barrierFilter
, which is an optionalImageFilter
which can be used to add an effect (usually a blurring) behind the command palette when it's open
Changed #
- The default value of
CommandPaletteStyle.borderRadius
has been changed toBorderRadius.all(Radius.circular(5))
Fixed #
CommandPaletteStyle.borderRadius
now correctly applies to the border of the entire modal, and not just the part with the actions/instructions.
0.6.0 - 2022-12-10 #
Fixed #
- Semi-Breaking: Changed the type of
CommandPaletteConfig.openKeySet
andCommandPaletteConfig.closeKeySet
fromLogicalKeySet
toShortcutActivator
(note:LogicalKeySet
already implementsShortcutActivator
, so existing custom shortcuts should still work, but a proposed solution is discussed below). This was done to fix an issue on Web builds for MacOS (discussed here). If you don't set custom values for the open and close key sets (or if you're not targeting Web), then no change will be required on your part. But if you are, the following change is suggested to make sure everything works well: If you're opening the palette with a keyboard shortcut, such as CTRL/CMD+U, then you could go fromLogicalKeySet(LogicalKeyboardKey.control, LogicalKeyboardKey.keyU)
/LogicalKeySet(LogicalKeyboardKey.meta, LogicalKeyboardKey.keyU)
toSingleActivator(LogicalKeyboardKey.keyU, control: true)
/SingleActivator(LogicalKeyboardKey.keyU, meta: true)
. This also changes how the command palette control shortcuts (Up/down/enter/backspace) are handled (fromLogicalKeySet
toSingleActivator
). This should make things a bit cleaner on my end, and more stable going forward. - Escape query correctly so that single a backslash doesn't cause filtering to crash
0.5.1 - 2022-12-02 #
Added #
- Optional
leading
widget forCommandPaletteAction
s which will display a Widget at the left-side of the different command palette options - exporting new widget 'KeyboardKeyIcon', this is the widget used to create the Keyboard Key Icons for the instructions bar and the shortcuts for each action
- Added flag,
showInstructions
, toCommandPaletteConfig
, which when set to true, will show the basic instructions for using the command palette, navigation, selection, and closing.
Changed #
- Flutter 3.3.7
0.5.0 - 2022-07-20 #
Added #
- Open to nested action via
CommandPalette.of(context).openToAction(actionId)
Changed #
- When a nested action is selected, the label of that action will prefix the command palette text field. This can be enabled by setting
prefixNestedActions
to true (this is also the current default) inCommandPaletteStyle
Fixed #
- BREAKING: default open key is now platform dependent. Previously it was always Ctrl+K, but now it will check if the platform is MacOS (this includes Web running on Mac) and if so will change the default open key to Command. While this change does make things function as I originally intended, this is changing default behavior so I'm considering this a breaking change
0.4.1 - 2022-06-09 #
Added #
- allow the setting of size (height, width) and position (top, bottom, left, right) of the command palette modal via the CommandPaletteConfig class
0.3.1 - 2022-06-09 #
Fixed #
- specify supported platforms explicitly
- use kIsWeb to stop error from being thrown when platform is checked
0.3.0 - 2022-02-26 #
0.2.0 - 2022-02-03 #
Changed #
- Flutter 2.10.0
- BREAKING: The configuration for the command palette is now set by a CommandPaletteConfig object that is passed to the CommandPalette constructor. To migrate, wrap all the arguments in the CommandPalette constructor that aren't actions, child, or key, in a CommandPaletteConfig constructor and pass that to the config argument
- Now using a fuzzy search implementation. This should improve search results. This also includes an improved sub-string highlighter. Expect the behavior to be the same as VSCode's command palette, as the logic is an adaptation of what's used there.