CarpenterHotkeyScope class

Scope hotkey-системы Carpenter.

Компонент делает три вещи:

  • регистрирует команды как Flutter Shortcuts;
  • прокидывает их в один универсальный CarpenterHotkeyIntent;
  • пассивно отслеживает текущее состояние клавиатуры через HardwareKeyboard, не перехватывая события у вложенных widgets.
Inheritance

Constructors

CarpenterHotkeyScope({Key? key, required Widget child, List<CarpenterCommand<void>> commands = const [], CarpenterHotkeyCommandCallback? onCommand, CarpenterHotkeyController? controller, TargetPlatform? platform, bool enabled = true, bool trackPressedKeys = true, bool autofocus = true})
Создает hotkey scope.
const

Properties

autofocus bool
Запрашивать ли фокус для hotkey-ветки при первом показе.
final
child Widget
Дочернее дерево, где работают shortcuts и мониторинг клавиатуры.
final
commands List<CarpenterCommand<void>>
Команды, доступные на этой ветке дерева.
final
controller CarpenterHotkeyController?
Внешний контроллер состояния клавиатуры.
final
enabled bool
Включены ли shortcuts и мониторинг.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onCommand CarpenterHotkeyCommandCallback?
Callback для найденной команды. Это будущая точка подключения роутинга.
final
platform TargetPlatform?
Платформа для выбора комбинаций и форматирования.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
trackPressedKeys bool
Нужно ли отслеживать текущие зажатые клавиши.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<CarpenterHotkeyScope>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

commandsOf(BuildContext context) List<CarpenterCommand<void>>
Возвращает команды ближайшего hotkey scope.
controllerOf(BuildContext context) CarpenterHotkeyController
Возвращает контроллер scope без подписки на обновления.
formatterOf(BuildContext context) CarpenterHotkeyFormatter
Возвращает платформенный форматтер ближайшего hotkey scope.
snapshotOf(BuildContext context) CarpenterHotkeySnapshot
Возвращает текущий снимок клавиатуры и подписывает widget на обновления.